Spaces:
Sleeping
Sleeping
'dict_keys' object has no attribute 'get'
Browse files- fetchYoutubeSubtitle.py +2 -2
fetchYoutubeSubtitle.py
CHANGED
@@ -4,9 +4,9 @@ import yt_dlp
|
|
4 |
|
5 |
def getVttUrlFromSubtitles(item, lang='en', vttType="vtt"):
|
6 |
langs = item.keys()
|
7 |
-
key =
|
8 |
for item in langs[key]:
|
9 |
-
if(item.get("ext") ==
|
10 |
return item.get("url")
|
11 |
return None
|
12 |
|
|
|
4 |
|
5 |
def getVttUrlFromSubtitles(item, lang='en', vttType="vtt"):
|
6 |
langs = item.keys()
|
7 |
+
key = lang if lang in langs else ('en' if 'en' in langs else langs[0] )
|
8 |
for item in langs[key]:
|
9 |
+
if(item.get("ext") == vttType):
|
10 |
return item.get("url")
|
11 |
return None
|
12 |
|