lanbogao commited on
Commit
0806569
1 Parent(s): 837c7ae

Use web + ios.

Browse files
Files changed (1) hide show
  1. fetchYoutubeSubtitle.py +9 -6
fetchYoutubeSubtitle.py CHANGED
@@ -133,13 +133,14 @@ async def fetchSubtitlebyType(
133
  "skip_download": True,
134
  "socket_timeout": 10,
135
  "extractor_retries": 0,
 
136
  "extractor_args": {
137
  "youtube": {
138
  "player_skip": [
139
  "configs",
140
  "initial",
141
  ], # skip "webpage" will cause l2P5PgL1LfI missing some langs,
142
- "player_client": ["web"],
143
  "skip": ["hls", "dash"], # don't skip "translated_subs"
144
  }
145
  },
@@ -246,16 +247,18 @@ def xml_caption_to_srt(xml_captions: str) -> str:
246
  async def fetchSubtitleUrls(url: str, proxy: Optional[str] = None) -> json:
247
  ydl_opts = {
248
  "noplaylist": True,
249
- # "writesubtitles": False,
 
250
  # "allsubtitles": False,
251
- "listsubtitles": True,
252
- # "skip_download": True,
253
  "socket_timeout": 10,
254
  "extractor_retries": 0,
 
255
  "extractor_args": {
256
  "youtube": {
257
- "player_skip": ["configs", "initial"], # "webpage",
258
- "player_client": ["web"],
259
  "skip": ["hls", "dash"], # , "translated_subs"
260
  }
261
  },
 
133
  "skip_download": True,
134
  "socket_timeout": 10,
135
  "extractor_retries": 0,
136
+ # "debug_printtraffic": True,
137
  "extractor_args": {
138
  "youtube": {
139
  "player_skip": [
140
  "configs",
141
  "initial",
142
  ], # skip "webpage" will cause l2P5PgL1LfI missing some langs,
143
+ "player_client": ["ios"],
144
  "skip": ["hls", "dash"], # don't skip "translated_subs"
145
  }
146
  },
 
247
  async def fetchSubtitleUrls(url: str, proxy: Optional[str] = None) -> json:
248
  ydl_opts = {
249
  "noplaylist": True,
250
+ "writesubtitles": True,
251
+ "writeautomaticsub": True,
252
  # "allsubtitles": False,
253
+ # "listsubtitles": True,
254
+ "skip_download": True,
255
  "socket_timeout": 10,
256
  "extractor_retries": 0,
257
+ # "debug_printtraffic": True,
258
  "extractor_args": {
259
  "youtube": {
260
+ "player_skip": ["configs", "initial"],
261
+ "player_client": ["ios"],
262
  "skip": ["hls", "dash"], # , "translated_subs"
263
  }
264
  },