What is this path issue?

This commit is contained in:
Rain Clark 2024-04-05 20:49:48 -04:00
parent a0ae115748
commit d519900ba8

27
main.py
View File

@ -16,7 +16,7 @@ downloading = {}
# Default Config Settings # Default Config Settings
config = configparser.ConfigParser() config = configparser.ConfigParser()
streamlink_location = "streamlink" streamlink_location = "streamlink"
download_location = str(f"{Path.home()}/Downloads/Streams/") download_location = f"{Path.home()}/Downloads/Streams"
skip_ads = False skip_ads = False
@ -57,21 +57,29 @@ def download_stream(channel):
addtional_parms = "" addtional_parms = ""
if skip_ads: 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" 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( downloading[channel] = subprocess.Popen(
[ [
f"{streamlink_location}", f"{streamlink_location}",
"--loglevel none", "--loglevel none",
"--retry-max 10", "--retry-max 10",
addtional_parms, f"{addtional_parms}",
f"-o {download_location}/{channel}/{datetime.now()}.ts", f"-o {download_location}/{channel}/{file_name}",
f"https://twitch.tv/{channel}", "twitch.tv/ActionButton",
"best", "best",
], ]
start_new_session=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
) )
write_log(channel) # write_log(channel)
def check_system(): def check_system():
@ -80,6 +88,7 @@ def check_system():
if not shutil.which("streamlink"): if not shutil.which("streamlink"):
sys.exit("ERROR: streamlink is not found in the systems path!") 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 # Checks if the channel_list exists and if not makes one
if not os.path.exists("channel_list.txt"): if not os.path.exists("channel_list.txt"):
print("ERROR:'channel_list.txt' does not exist, creating now!") print("ERROR:'channel_list.txt' does not exist, creating now!")