Update app.py
Browse files
app.py
CHANGED
@@ -17,11 +17,11 @@ import ffmpeg
|
|
17 |
def process_video(video_file, youtube_url, language_choice):
|
18 |
if language_choice == None:
|
19 |
return None, "Select a language to translate to."
|
20 |
-
elif video_file == None and youtube_url ==
|
21 |
return None, "Upload either a video or a valid youtube URL."
|
22 |
-
elif video_file != None and youtube_url !=
|
23 |
return None, "Videos contradict. Delete either the uploaded video or youtube URL."
|
24 |
-
elif video_file == None and youtube_url !=
|
25 |
yt = YouTube(youtube_url)
|
26 |
yt.streams.filter(progressive=True, file_extension='mp4').first().download(filename="original.mp4")
|
27 |
video_file = "original.mp4"
|
|
|
17 |
def process_video(video_file, youtube_url, language_choice):
|
18 |
if language_choice == None:
|
19 |
return None, "Select a language to translate to."
|
20 |
+
elif video_file == None and youtube_url == "":
|
21 |
return None, "Upload either a video or a valid youtube URL."
|
22 |
+
elif video_file != None and youtube_url != "":
|
23 |
return None, "Videos contradict. Delete either the uploaded video or youtube URL."
|
24 |
+
elif video_file == None and youtube_url != "":
|
25 |
yt = YouTube(youtube_url)
|
26 |
yt.streams.filter(progressive=True, file_extension='mp4').first().download(filename="original.mp4")
|
27 |
video_file = "original.mp4"
|