From c9e64d2814e80e779d5081904e948c87df7eb766 Mon Sep 17 00:00:00 2001 From: Mattias Tall Date: Tue, 26 May 2026 11:27:26 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20comment=20extractor=20args=20separator=20?= =?UTF-8?q?(,=20=E2=86=92=20;)=20and=20use=20comment=5Fsort=3Dtop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit yt-dlp separates extractor args with ; not ,. The malformed arg was causing max_comments to parse as a garbage string, fetching ~1 comment. Also swap max_comment_depth (not a real YouTube extractor arg) for comment_sort=top to get highest-engagement comments first. Co-Authored-By: Claude Sonnet 4.6 --- backend/services/ytdlp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/services/ytdlp.py b/backend/services/ytdlp.py index b4792af..1ff1585 100644 --- a/backend/services/ytdlp.py +++ b/backend/services/ytdlp.py @@ -391,7 +391,7 @@ def fetch_video_comments(youtube_video_id: str, max_comments: int = 20) -> list[ "yt-dlp", url, "--dump-json", "--write-comments", - "--extractor-args", f"youtube:max_comments={max_comments},max_comment_depth=1", + "--extractor-args", f"youtube:max_comments={max_comments};comment_sort=top", "--no-download", "--no-playlist", "--quiet",