fix proxy url again

This commit is contained in:
Roy Olav Purser 2021-05-29 11:08:17 +02:00
parent 6463dd8cda
commit f83c311246
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -10,8 +10,8 @@ streamlink_default_session = streamlink.Streamlink()
def setup(proxies): def setup(proxies):
for proxy in proxies: for proxy in proxies:
streamlink_sessions[proxy] = streamlink.Streamlink() streamlink_sessions[proxy] = streamlink.Streamlink()
streamlink_sessions[proxy].set_option("http-proxy", proxy) streamlink_sessions[proxy].set_option("http-proxy", "socks5://" + proxy)
streamlink_sessions[proxy].set_option("https-proxy", proxy) streamlink_sessions[proxy].set_option("https-proxy", "socks5://" + proxy)
class DummyLogger(): class DummyLogger():
def debug(self, msg): def debug(self, msg):
@ -120,7 +120,7 @@ class YoutubeRunner(StreamProvider):
opts = {} opts = {}
opts["logger"] = DummyLogger() opts["logger"] = DummyLogger()
if isinstance(self.proxy, str): if isinstance(self.proxy, str):
opts["proxy"] = f'socks5://{self.proxy}' opts["proxy"] = "socks5://" + self.proxy
with youtube_dl.YoutubeDL(opts) as ydl: with youtube_dl.YoutubeDL(opts) as ydl:
info = ydl.extract_info(self.upstream, download=False) info = ydl.extract_info(self.upstream, download=False)
vformats = info.get("formats") vformats = info.get("formats")