mirror of
https://gitgud.io/Melon__Bread/auto-ttv-grabber.git
synced 2024-11-24 16:28:30 -05:00
Split up add params
This commit is contained in:
parent
c7782b46b8
commit
6030f2d0dd
14
main.py
14
main.py
@ -69,15 +69,16 @@ def is_live(channel: str) -> bool:
|
||||
def download_stream(channel: str) -> None:
|
||||
"""Downloads a given channel name in its own subprocess"""
|
||||
# TODO: Just clean this up at somepoint
|
||||
addtional_parms: str = ""
|
||||
loging: str = ""
|
||||
ad_skipping: str = ""
|
||||
print(log)
|
||||
if log:
|
||||
addtional_parms += f" --logfile {download_location}/{channel}/log.txt"
|
||||
loging = f"--loglevel info --logfile {download_location}/{channel}/log.txt"
|
||||
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"
|
||||
ad_skipping = "--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: str = f"{channel}_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.ts"
|
||||
cmd: str = (
|
||||
f"{streamlink_location} --retry-max 10{addtional_parms} -o {download_location}/{channel}/{file_name} twitch.tv/{channel} best"
|
||||
)
|
||||
cmd: str = f"{streamlink_location} --retry-max 10 {loging} {ad_skipping} -o {download_location}/{channel}/{file_name} twitch.tv/{channel} best"
|
||||
# TODO: Check if the process failed for some reason
|
||||
downloading[channel] = subprocess.Popen(
|
||||
[cmd],
|
||||
shell=True,
|
||||
@ -118,6 +119,7 @@ def main() -> None:
|
||||
"""Main entry point of the app"""
|
||||
|
||||
# Run untill progam is killed
|
||||
# TODO: Check on the process if it is still alive and restart as needed
|
||||
while True:
|
||||
# Exits the program if there is no channels to grab
|
||||
print("\n------------------------------------")
|
||||
|
Loading…
Reference in New Issue
Block a user