oops no hardcoding

This commit is contained in:
2021-11-06 20:42:54 +01:00
parent 707f908ebf
commit 6658c96615
+2 -2
View File
@@ -5,7 +5,7 @@ from yt_dlp import YoutubeDL
import sys import sys
if len(sys.argv) < 2: 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] config_path = sys.argv[1]
@@ -17,7 +17,7 @@ file = open(config_path, "r")
youtube_dl_opts = {} 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"): for vid_url in vid_urls.split("\n"):
if vid_url == "": if vid_url == "":