From d519900ba8c9ca2d3e194951e8574698835258e4 Mon Sep 17 00:00:00 2001 From: Rain Date: Fri, 5 Apr 2024 20:49:48 -0400 Subject: [PATCH] What is this path issue? --- main.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 7671212..12c7d4b 100755 --- a/main.py +++ b/main.py @@ -16,7 +16,7 @@ downloading = {} # Default Config Settings config = configparser.ConfigParser() streamlink_location = "streamlink" -download_location = str(f"{Path.home()}/Downloads/Streams/") +download_location = f"{Path.home()}/Downloads/Streams" skip_ads = False @@ -57,21 +57,29 @@ def download_stream(channel): addtional_parms = "" if skip_ads: addtional_parms = "--twitch-proxy-playlist=https://lb-eu.cdn-perfprod.com,https://lb-eu2.cdn-perfprod.com,https://lb-na.cdn-perfprod.com,https://lb-as.cdn-perfprod.com,https://as.luminous.dev --twitch-disable-ads" + file_name = f"{channel}_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.ts" + # cmd = [ + # f"{streamlink_location}", + # "--loglevel none", + # "--retry-max 10", + # f"{addtional_parms}", + # f"-o {download_location}/{channel}/{file_name}", + # f"twitch.tv/{channel}", + # "best", + # ] + # print(cmd) downloading[channel] = subprocess.Popen( [ f"{streamlink_location}", "--loglevel none", "--retry-max 10", - addtional_parms, - f"-o {download_location}/{channel}/{datetime.now()}.ts", - f"https://twitch.tv/{channel}", + f"{addtional_parms}", + f"-o {download_location}/{channel}/{file_name}", + "twitch.tv/ActionButton", "best", - ], - start_new_session=True, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, + ] ) - write_log(channel) + # write_log(channel) def check_system(): @@ -80,6 +88,7 @@ def check_system(): if not shutil.which("streamlink"): sys.exit("ERROR: streamlink is not found in the systems path!") + # TODO: Combine the channel_list into the config # Checks if the channel_list exists and if not makes one if not os.path.exists("channel_list.txt"): print("ERROR:'channel_list.txt' does not exist, creating now!")