mirror of
https://gitgud.io/Melon__Bread/auto-ttv-grabber.git
synced 2024-11-24 16:28:30 -05:00
More clean up with type hints
This commit is contained in:
parent
aaf2173894
commit
33d7ae24fb
10
main.py
10
main.py
@ -8,6 +8,7 @@ import time
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
channel_list: List[str] = []
|
channel_list: List[str] = []
|
||||||
@ -53,12 +54,13 @@ def write_log(channel: str) -> None:
|
|||||||
def download_stream(channel: str) -> None:
|
def download_stream(channel: str) -> None:
|
||||||
"""Downloads a given channel name in its own subprocess"""
|
"""Downloads a given channel name in its own subprocess"""
|
||||||
# TODO: Just clean this up at somepoint
|
# TODO: Just clean this up at somepoint
|
||||||
addtional_parms = ""
|
addtional_parms: str = ""
|
||||||
print(str(skip_ads))
|
|
||||||
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"
|
file_name: str = f"{channel}_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.ts"
|
||||||
cmd = f"{streamlink_location} --loglevel none --retry-max 10 {addtional_parms} -o {download_location}/{channel}/{file_name} twitch.tv/{channel} best"
|
cmd: str = (
|
||||||
|
f"{streamlink_location} --loglevel none --retry-max 10 {addtional_parms} -o {download_location}/{channel}/{file_name} twitch.tv/{channel} best"
|
||||||
|
)
|
||||||
downloading[channel] = subprocess.Popen(
|
downloading[channel] = subprocess.Popen(
|
||||||
[cmd],
|
[cmd],
|
||||||
shell=True,
|
shell=True,
|
||||||
|
Loading…
Reference in New Issue
Block a user