fix proxy url
This commit is contained in:
parent
0505fee331
commit
6463dd8cda
@ -81,7 +81,7 @@ class StreamProvider():
|
||||
self.logger = logger
|
||||
proxy = str(proxy)
|
||||
if len(proxy) > 5:
|
||||
self.proxy = "socks5://" + proxy
|
||||
self.proxy = proxy
|
||||
async def run(self):
|
||||
data = None
|
||||
try:
|
||||
@ -120,7 +120,7 @@ class YoutubeRunner(StreamProvider):
|
||||
opts = {}
|
||||
opts["logger"] = DummyLogger()
|
||||
if isinstance(self.proxy, str):
|
||||
opts["proxy"] = self.proxy
|
||||
opts["proxy"] = f'socks5://{self.proxy}'
|
||||
with youtube_dl.YoutubeDL(opts) as ydl:
|
||||
info = ydl.extract_info(self.upstream, download=False)
|
||||
vformats = info.get("formats")
|
||||
|
Loading…
Reference in New Issue
Block a user