Spaces:
Runtime error
Runtime error
David Li commited on
Commit ·
e32a8a0
1
Parent(s): 5f40cee
feat: fix again
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ def get_video_id(url):
|
|
| 34 |
# get latest file with .srt or .vtt
|
| 35 |
subtitle_file = max(glob.glob(f"**/*.vtt"), key=os.path.getctime)
|
| 36 |
|
| 37 |
-
if subtitle_file
|
| 38 |
try:
|
| 39 |
subtitle_file = glob.glob(f"{video_id}/*.srt")[0]
|
| 40 |
except Exception as e:
|
|
|
|
| 34 |
# get latest file with .srt or .vtt
|
| 35 |
subtitle_file = max(glob.glob(f"**/*.vtt"), key=os.path.getctime)
|
| 36 |
|
| 37 |
+
if subtitle_file is None:
|
| 38 |
try:
|
| 39 |
subtitle_file = glob.glob(f"{video_id}/*.srt")[0]
|
| 40 |
except Exception as e:
|