revert: remove ios player_client arg from all yt-dlp calls

It caused timeouts and failures on search/flat-playlist/metadata
operations — those extractors don't support the ios client path.
Keeping only the _META_MIN_GAP increase (5s → 12s) which only
affects background polite calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 06:00:41 +02:00
parent 8dcbad6e70
commit 140bf4acf6
2 changed files with 2 additions and 9 deletions

View File

@@ -743,7 +743,6 @@ def _fetch_popular_task(channel_id: int, youtube_channel_id: str, channel_name:
"yt-dlp", url, "yt-dlp", url,
"--dump-json", "--flat-playlist", "--dump-json", "--flat-playlist",
"--quiet", "--quiet",
"--extractor-args", "youtube:player_client=ios",
*ytdlp._cookie_args(), *ytdlp._cookie_args(),
], timeout=120) ], timeout=120)

View File

@@ -211,7 +211,6 @@ def search_youtube(query: str, max_results: int = 40, polite: bool = False) -> l
"--dump-json", "--dump-json",
"--flat-playlist", "--flat-playlist",
"--quiet", "--quiet",
"--extractor-args", "youtube:player_client=ios",
*_cookie_args(), *_cookie_args(),
], timeout=60) ], timeout=60)
@@ -310,7 +309,6 @@ def fetch_video_metadata(video_id: str, polite: bool = False) -> dict | None:
base_cmd = [ base_cmd = [
"yt-dlp", url, "yt-dlp", url,
"--dump-json", "--no-download", "--no-playlist", "--dump-json", "--no-download", "--no-playlist",
"--extractor-args", "youtube:player_client=ios",
] ]
runner = _meta_run if polite else _run runner = _meta_run if polite else _run
stdout, stderr, code = runner([*base_cmd, *cookie_args], timeout=30) stdout, stderr, code = runner([*base_cmd, *cookie_args], timeout=30)
@@ -381,7 +379,6 @@ def fetch_channel_metadata(channel_id: str, max_videos: int = 30, start_video: i
"--dump-single-json", "--dump-single-json",
"--flat-playlist", "--flat-playlist",
"--quiet", "--quiet",
"--extractor-args", "youtube:player_client=ios",
*_cookie_args(), *_cookie_args(),
] ]
if start_video > 1: if start_video > 1:
@@ -616,7 +613,6 @@ def download_subs_only(video_id: str, subtitle_langs: str) -> bool:
"--write-subs", "--write-auto-subs", "--write-subs", "--write-auto-subs",
"--sub-langs", subtitle_langs, "--sub-langs", subtitle_langs,
"--convert-subs", "vtt", "--convert-subs", "vtt",
"--extractor-args", "youtube:player_client=ios",
"-o", output_template, "-o", output_template,
*_cookie_args(), *_cookie_args(),
], timeout=60) ], timeout=60)
@@ -632,8 +628,7 @@ def fetch_available_subs(video_id: str) -> dict:
BCP-47 lang codes. Manual = human-made; auto = auto-generated captions. BCP-47 lang codes. Manual = human-made; auto = auto-generated captions.
""" """
url = f"https://www.youtube.com/watch?v={video_id}" url = f"https://www.youtube.com/watch?v={video_id}"
base_cmd = ["yt-dlp", url, "--dump-json", "--no-download", "--no-playlist", base_cmd = ["yt-dlp", url, "--dump-json", "--no-download", "--no-playlist"]
"--extractor-args", "youtube:player_client=ios"]
cookie_args = _cookie_args() cookie_args = _cookie_args()
stdout, _, code = _meta_run([*base_cmd, *cookie_args], timeout=30) stdout, _, code = _meta_run([*base_cmd, *cookie_args], timeout=30)
if code != 0 and cookie_args: if code != 0 and cookie_args:
@@ -675,7 +670,7 @@ def fetch_video_comments(youtube_video_id: str, max_comments: int = 20) -> list[
"--write-info-json", "--write-info-json",
"--write-comments", "--write-comments",
# Format: thread_count,total_count,replies_per_thread,reply_pages # Format: thread_count,total_count,replies_per_thread,reply_pages
"--extractor-args", f"youtube:player_client=ios;max_comments={max_comments},{max_comments},0,0;comment_sort=top", "--extractor-args", f"youtube:max_comments={max_comments},{max_comments},0,0;comment_sort=top",
"--skip-download", "--skip-download",
"--no-playlist", "--no-playlist",
"--output", out_tmpl, "--output", out_tmpl,
@@ -932,7 +927,6 @@ def start_download(
"--no-part", "--no-mtime", "--no-part", "--no-mtime",
"-o", output_template, "-o", output_template,
"--newline", "--progress", "--no-colors", "--newline", "--progress", "--no-colors",
"--extractor-args", "youtube:player_client=ios",
*subtitle_args, *subtitle_args,
*cookie_args, *cookie_args,
] ]