Fix max_comments format: use full 4-tuple for yt-dlp YouTube extractor
max_comments takes thread_count,total,replies_per_thread,reply_pages. Passing just one value left the rest unset which caused yt-dlp to fetch only 1 comment. Now passes 20,20,0,0 to fetch 20 top-level comments with no replies. Also switch --no-download to --skip-download. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -398,10 +398,10 @@ def fetch_video_comments(youtube_video_id: str, max_comments: int = 20) -> list[
|
||||
"yt-dlp", url,
|
||||
"--write-info-json",
|
||||
"--write-comments",
|
||||
"--extractor-args", f"youtube:max_comments={max_comments};comment_sort=top",
|
||||
"--no-download",
|
||||
# Format: thread_count,total_count,replies_per_thread,reply_pages
|
||||
"--extractor-args", f"youtube:max_comments={max_comments},{max_comments},0,0;comment_sort=top",
|
||||
"--skip-download",
|
||||
"--no-playlist",
|
||||
"--quiet",
|
||||
"--output", out_tmpl,
|
||||
*_cookie_args(),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user