Spaces:
Sleeping
Sleeping
Fix 'dict_keys' object has no attribute 'length'
Browse files- fetchYoutubeSubtitle.py +1 -1
fetchYoutubeSubtitle.py
CHANGED
@@ -42,7 +42,7 @@ def fetchSubtitleUrls(url: str) -> json:
|
|
42 |
info_dict = ydl.extract_info(url, download=False)
|
43 |
if info_dict.get("subtitles"):
|
44 |
langs = info_dict.get("subtitles").keys()
|
45 |
-
if not (langs
|
46 |
return info_dict.get("subtitles")
|
47 |
if info_dict.get("automatic_captions"):
|
48 |
return info_dict.get("automatic_captions")
|
|
|
42 |
info_dict = ydl.extract_info(url, download=False)
|
43 |
if info_dict.get("subtitles"):
|
44 |
langs = info_dict.get("subtitles").keys()
|
45 |
+
if not (len(langs) == 1 and "live_chat" in langs):
|
46 |
return info_dict.get("subtitles")
|
47 |
if info_dict.get("automatic_captions"):
|
48 |
return info_dict.get("automatic_captions")
|