-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ready for deployment
- Loading branch information
Showing
15 changed files
with
116 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
from django.urls import path | ||
from .views import VideoView, SubtitleView | ||
from .views import VideoView, SubtitleView, statusView | ||
|
||
app_name = 'api' | ||
|
||
urlpatterns = [ | ||
path('upload/', VideoView.as_view()), | ||
path('subtitle/<int:id>', SubtitleView.as_view()), | ||
] | ||
path('subtitle/<int:id>/', SubtitleView.as_view()), | ||
path('status/<str:task_id>/', statusView, name="status"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env python | ||
"""Django's command-line utility for administrative tasks.""" | ||
import os | ||
import sys | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap'); | ||
|
||
body { | ||
box-sizing: border-box; | ||
margin: 30px; | ||
padding: 10px; | ||
font-family: 'Montserrat', sans-serif; | ||
} | ||
|
||
h1 { | ||
font-weight: 700; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% extends "base.html" %} {% block script %} | ||
<script> | ||
window.onload = function () { | ||
function getStatus(url) { | ||
fetch(url).then(function (response) { | ||
response | ||
.json() | ||
.then(function (data) { | ||
if (data.status === "SUCCESS") { | ||
window.location.replace("{% url 'pages:subtitle' id %}"); | ||
} else if (data.status === "FALIURE") { | ||
document.getElementById("progress").innerHTML = | ||
"Error while extracting subtitle"; | ||
return; | ||
} | ||
}) | ||
.catch(function (error) { | ||
console.log(error.message); | ||
}); | ||
}); | ||
setInterval(getStatus, 10000, url); | ||
} | ||
|
||
var url = "{% url 'api:status' task_id %}"; | ||
getStatus(url); | ||
}; | ||
</script> | ||
{% endblock %} {% block content %} | ||
<div | ||
class="card position-absolute top-50 start-50 translate-middle" | ||
style="width: 18rem" | ||
id="progress" | ||
> | ||
<div class="card-body"> | ||
<h1 class="card-title">Please Wait</h1> | ||
<p class="card-text"> | ||
Your video is being uploaded and subtitles are being extracted. | ||
</p> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
from .views import index, subtitleView | ||
from .views import index, subtitleView, progressView | ||
from django.urls import path | ||
|
||
app_name = 'pages' | ||
|
||
urlpatterns = [ | ||
path('', index, name='index'), | ||
path('subtitle/<int:id>', subtitleView, name='subtitle'), | ||
] | ||
path('progress/<str:task_id>/<int:id>', progressView, name="progress"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters