lanbogao commited on
Commit
3dadd80
1 Parent(s): 56ace91

Add async to functions.

Browse files
Files changed (1) hide show
  1. fetchYoutubeSubtitle.py +2 -2
fetchYoutubeSubtitle.py CHANGED
@@ -10,7 +10,7 @@ def getVttUrlFromSubtitles(item, lang='en', vttType="vtt"):
10
  return item.get("url")
11
  return None
12
 
13
- def getSubtitle(url: str, lang: Optional[str] = 'en', vttType="vtt") -> Optional[str]:
14
  ydl_opts = {
15
  "writesubtitles": True,
16
  "allsubtitles": True,
@@ -31,7 +31,7 @@ def getSubtitle(url: str, lang: Optional[str] = 'en', vttType="vtt") -> Optional
31
  return subtitle.read().decode()
32
  return None
33
 
34
- def fetchSubtitleUrls(url: str) -> json:
35
  ydl_opts = {
36
  "writesubtitles": True,
37
  "allsubtitles": True,
 
10
  return item.get("url")
11
  return None
12
 
13
+ async def getSubtitle(url: str, lang: Optional[str] = 'en', vttType="vtt") -> Optional[str]:
14
  ydl_opts = {
15
  "writesubtitles": True,
16
  "allsubtitles": True,
 
31
  return subtitle.read().decode()
32
  return None
33
 
34
+ async def fetchSubtitleUrls(url: str) -> json:
35
  ydl_opts = {
36
  "writesubtitles": True,
37
  "allsubtitles": True,