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:
@@ -211,7 +211,6 @@ def search_youtube(query: str, max_results: int = 40, polite: bool = False) -> l
|
||||
"--dump-json",
|
||||
"--flat-playlist",
|
||||
"--quiet",
|
||||
"--extractor-args", "youtube:player_client=ios",
|
||||
*_cookie_args(),
|
||||
], timeout=60)
|
||||
|
||||
@@ -310,7 +309,6 @@ def fetch_video_metadata(video_id: str, polite: bool = False) -> dict | None:
|
||||
base_cmd = [
|
||||
"yt-dlp", url,
|
||||
"--dump-json", "--no-download", "--no-playlist",
|
||||
"--extractor-args", "youtube:player_client=ios",
|
||||
]
|
||||
runner = _meta_run if polite else _run
|
||||
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",
|
||||
"--flat-playlist",
|
||||
"--quiet",
|
||||
"--extractor-args", "youtube:player_client=ios",
|
||||
*_cookie_args(),
|
||||
]
|
||||
if start_video > 1:
|
||||
@@ -616,7 +613,6 @@ def download_subs_only(video_id: str, subtitle_langs: str) -> bool:
|
||||
"--write-subs", "--write-auto-subs",
|
||||
"--sub-langs", subtitle_langs,
|
||||
"--convert-subs", "vtt",
|
||||
"--extractor-args", "youtube:player_client=ios",
|
||||
"-o", output_template,
|
||||
*_cookie_args(),
|
||||
], 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.
|
||||
"""
|
||||
url = f"https://www.youtube.com/watch?v={video_id}"
|
||||
base_cmd = ["yt-dlp", url, "--dump-json", "--no-download", "--no-playlist",
|
||||
"--extractor-args", "youtube:player_client=ios"]
|
||||
base_cmd = ["yt-dlp", url, "--dump-json", "--no-download", "--no-playlist"]
|
||||
cookie_args = _cookie_args()
|
||||
stdout, _, code = _meta_run([*base_cmd, *cookie_args], timeout=30)
|
||||
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-comments",
|
||||
# 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",
|
||||
"--no-playlist",
|
||||
"--output", out_tmpl,
|
||||
@@ -932,7 +927,6 @@ def start_download(
|
||||
"--no-part", "--no-mtime",
|
||||
"-o", output_template,
|
||||
"--newline", "--progress", "--no-colors",
|
||||
"--extractor-args", "youtube:player_client=ios",
|
||||
*subtitle_args,
|
||||
*cookie_args,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user