Spaces:
Runtime error
Runtime error
ernestchu
commited on
Commit
·
3697c1b
1
Parent(s):
8db2239
fix bug
Browse files
app.py
CHANGED
@@ -66,6 +66,7 @@ def download_video(url):
|
|
66 |
try:
|
67 |
ydl.cache.remove()
|
68 |
meta = ydl.extract_info(url)
|
|
|
69 |
thumb_url = meta['thumbnail']
|
70 |
thumb_location = f"videos/{meta['id']}.{thumb_url.split('.')[-1]}"
|
71 |
wget.download(thumb_url, out=thumb_location)
|
@@ -74,11 +75,11 @@ def download_video(url):
|
|
74 |
print(f'error with download_video function: {error}')
|
75 |
save_location = None
|
76 |
thumb_location = None
|
77 |
-
|
78 |
except IndexError as err:
|
79 |
print(f"can't find suitable video formats. we are not able to process video larger than 95 Mib at the moment")
|
80 |
-
fps, save_location, thumb_location,
|
81 |
-
return(fps, save_location, thumb_location,
|
82 |
|
83 |
def process_video_parallel(video, skip_frames, dest_path, num_processes, process_number):
|
84 |
cap = cv2.VideoCapture(video)
|
|
|
66 |
try:
|
67 |
ydl.cache.remove()
|
68 |
meta = ydl.extract_info(url)
|
69 |
+
title = meta['title']
|
70 |
thumb_url = meta['thumbnail']
|
71 |
thumb_location = f"videos/{meta['id']}.{thumb_url.split('.')[-1]}"
|
72 |
wget.download(thumb_url, out=thumb_location)
|
|
|
75 |
print(f'error with download_video function: {error}')
|
76 |
save_location = None
|
77 |
thumb_location = None
|
78 |
+
title = None
|
79 |
except IndexError as err:
|
80 |
print(f"can't find suitable video formats. we are not able to process video larger than 95 Mib at the moment")
|
81 |
+
fps, save_location, thumb_location, title = None, None, None, None
|
82 |
+
return(fps, save_location, thumb_location, title)
|
83 |
|
84 |
def process_video_parallel(video, skip_frames, dest_path, num_processes, process_number):
|
85 |
cap = cv2.VideoCapture(video)
|