From 6658c96615a9dc06d04c6e6f6af5d2e8e5089beb Mon Sep 17 00:00:00 2001 From: Matthww Date: Sat, 6 Nov 2021 20:42:54 +0100 Subject: [PATCH] oops no hardcoding --- scripts/channel_to_redis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/channel_to_redis.py b/scripts/channel_to_redis.py index c4814ff..4f10e25 100644 --- a/scripts/channel_to_redis.py +++ b/scripts/channel_to_redis.py @@ -5,7 +5,7 @@ from yt_dlp import YoutubeDL import sys if len(sys.argv) < 2: - raise Exception("Expected path to file as argument") + raise Exception("Expected youtube playlist/channel/video") config_path = sys.argv[1] @@ -17,7 +17,7 @@ file = open(config_path, "r") youtube_dl_opts = {} -vid_urls = subprocess.run(["yt-dlp", "--print", "id", "https://www.youtube.com/playlist?list=PLM2V-zC1RStc1TttVrVXCTQ5AW_jN0fFS"], capture_output=True).stdout.decode("utf-8") +vid_urls = subprocess.run(["yt-dlp", "--print", "id", f"{sys.argv[1]}"], capture_output=True).stdout.decode("utf-8") for vid_url in vid_urls.split("\n"): if vid_url == "":