Spaces:
Sleeping
Sleeping
Fix code error
Browse files- fetchYoutubeSubtitle.py +1 -1
fetchYoutubeSubtitle.py
CHANGED
@@ -26,7 +26,7 @@ def getSubtitle(url: str, lang: Optional[str] = 'en', vttType="vtt") -> Optional
|
|
26 |
with ydl.urlopen(subtitle_url) as subtitle:
|
27 |
return subtitle.read().decode()
|
28 |
if info_dict.get("automatic_captions"):
|
29 |
-
subtitle_url = getVttUrlFromSubtitles(info_dict.get("automatic_captions"),
|
30 |
with ydl.urlopen(subtitle_url) as subtitle:
|
31 |
return subtitle.read().decode()
|
32 |
return None
|
|
|
26 |
with ydl.urlopen(subtitle_url) as subtitle:
|
27 |
return subtitle.read().decode()
|
28 |
if info_dict.get("automatic_captions"):
|
29 |
+
subtitle_url = getVttUrlFromSubtitles(info_dict.get("automatic_captions"), lang, vttType)
|
30 |
with ydl.urlopen(subtitle_url) as subtitle:
|
31 |
return subtitle.read().decode()
|
32 |
return None
|