From 83e1b18c5b50a8035145e349a45743536dfb752a Mon Sep 17 00:00:00 2001 From: Mattias Tall Date: Tue, 26 May 2026 11:45:15 +0200 Subject: [PATCH] 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 --- backend/services/ytdlp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/services/ytdlp.py b/backend/services/ytdlp.py index e606243..6447981 100644 --- a/backend/services/ytdlp.py +++ b/backend/services/ytdlp.py @@ -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(), ]