downloader: Hard-code source quality for non-twitch providers

since they can't do any other quality, but we still want to be able to set other qualities
for twitch streams.

Really qualities should be per-channel but I'm being lazy.
pull/355/head
Mike Lang 1 year ago committed by Mike Lang
parent 304e7b0fd9
commit 5f42b8419e

@ -639,15 +639,18 @@ def main(channels, base_dir=".", qualities="source", metrics_port=8001, backdoor
managers = [] managers = []
for channel, important, type, url in channels: for channel, important, type, url in channels:
channel_qualities = qualities
if type == "twitch": if type == "twitch":
provider = TwitchProvider(channel, auth_token=twitch_auth_token) provider = TwitchProvider(channel, auth_token=twitch_auth_token)
elif type == "url": elif type == "url":
provider = URLProvider(url) provider = URLProvider(url)
channel_qualities = ["source"]
elif type == "youtube": elif type == "youtube":
provider = YoutubeProvider(url) provider = YoutubeProvider(url)
channel_qualities = ["source"]
else: else:
raise ValueError(f"Unknown type {type!r}") raise ValueError(f"Unknown type {type!r}")
manager = StreamsManager(provider, channel, base_dir, qualities, important=important) manager = StreamsManager(provider, channel, base_dir, channel_qualities, important=important)
managers.append(manager) managers.append(manager)
def stop(): def stop():

Loading…
Cancel
Save