lanbogao commited on
Commit
1dbc6b0
1 Parent(s): c2eed51

'dict_keys' object has no attribute 'get'

Browse files
Files changed (1) hide show
  1. 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 = lang if langs.get(lang) else ('en' if langs.get('en') else langs[0] )
8
  for item in langs[key]:
9
- if(item.get("ext") == type):
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