From bda0b009165bcae7e7c5a4beadaafafc76ea699e Mon Sep 17 00:00:00 2001 From: Derek Date: Mon, 23 Feb 2026 20:53:38 -0600 Subject: [PATCH] output path --- extract_comments.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extract_comments.py b/extract_comments.py index 62fbd40..672535a 100644 --- a/extract_comments.py +++ b/extract_comments.py @@ -2,13 +2,14 @@ import json from yt_dlp import YoutubeDL url = "https://www.youtube.com/watch?v=lW7vWfRI5oI" +output_path = "docs/comments.json" with YoutubeDL({"skip_download": True, "getcomments": True}) as derexXD: info = derexXD.extract_info(url, download=False) comments = sorted(info.get("comments", []), key=lambda x: x.get("timestamp", 0)) -with open("docs/comments.json", "w") as file: +with open(output_path, "w") as file: json.dump(comments, file, indent=2) print(f"Done\nExtracted {len(comments)} comments from el video (sorted oldest to newest)")