Spaces:
Runtime error
Runtime error
1. Set socket_timeout default 10 and set 20 when proxy.
Browse files2. extractor_retries to 0
3. extract youtube by android only.
- fetchYoutubeSubtitle.py +13 -3
fetchYoutubeSubtitle.py
CHANGED
@@ -46,11 +46,19 @@ async def fetchSubtitlebyType(url: str, lang: Optional[str] = 'en', subType: Opt
|
|
46 |
"allsubtitles": True,
|
47 |
"subtitleslangs": [lang] if lang else [],
|
48 |
"skip_download": True,
|
49 |
-
"socket_timeout":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
|
52 |
if proxy:
|
53 |
-
ydl_opts.update({"proxy": proxy})
|
54 |
|
55 |
title = "unknow"
|
56 |
duration = ""
|
@@ -122,9 +130,11 @@ async def fetchSubtitleUrls(url: str, proxy: Optional[str] = None) -> json:
|
|
122 |
"writesubtitles": False,
|
123 |
"allsubtitles": True,
|
124 |
"skip_download": True,
|
|
|
|
|
125 |
}
|
126 |
if proxy:
|
127 |
-
ydl_opts.update({"proxy": proxy})
|
128 |
|
129 |
title = "unknow"
|
130 |
duration = ""
|
|
|
46 |
"allsubtitles": True,
|
47 |
"subtitleslangs": [lang] if lang else [],
|
48 |
"skip_download": True,
|
49 |
+
"socket_timeout": 10,
|
50 |
+
"extractor_retries": 0,
|
51 |
+
"extractor_args": {
|
52 |
+
"youtube": {
|
53 |
+
"player_skip": ["webpage", "configs", "initial"],
|
54 |
+
"player_client": ["android"],
|
55 |
+
"skip": ["hls", "dash", "translated_subs"],
|
56 |
+
}
|
57 |
+
},
|
58 |
}
|
59 |
|
60 |
if proxy:
|
61 |
+
ydl_opts.update({"proxy": proxy, "socket_timeout": 20})
|
62 |
|
63 |
title = "unknow"
|
64 |
duration = ""
|
|
|
130 |
"writesubtitles": False,
|
131 |
"allsubtitles": True,
|
132 |
"skip_download": True,
|
133 |
+
"socket_timeout": 10,
|
134 |
+
"extractor_retries": 0
|
135 |
}
|
136 |
if proxy:
|
137 |
+
ydl_opts.update({"proxy": proxy, "socket_timeout": 20})
|
138 |
|
139 |
title = "unknow"
|
140 |
duration = ""
|