lanbogao commited on
Commit
56ace91
1 Parent(s): 13bd0f6

Fix 'dict_keys' object has no attribute 'length'

Browse files
Files changed (1) hide show
  1. 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.length == 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")
 
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")