fix streamlink

This commit is contained in:
Roy Olav Purser 2023-07-23 12:27:36 +02:00
parent 4593cf84c5
commit a1ac365fad
Signed by: roypur
GPG Key ID: 90142918D5E59AD3

View File

@ -203,6 +203,8 @@ class StreamProvider:
class StreamlinkRunner(StreamProvider):
def stream(self):
if "youtube.com" in urllib.parse.urlparse(self.upstream).hostname.lower():
return StreamData(None, None, None, None, None, None, False)
try:
session = None
if self.proxy is None or self.proxy.proxy is None:
@ -212,7 +214,7 @@ class StreamlinkRunner(StreamProvider):
media = session.resolve_url(self.upstream)
streams = None
if isinstance(media, tuple):
plugin = media[0](media[1])
plugin = media[1](session=session, url=media[2])
streams = plugin.streams()
else:
streams = media.streams()
@ -393,7 +395,7 @@ async def get_any(upstream, proxy, logger):
if isinstance(cached, StreamData):
return cached
tasks = []
if not "youtube" in upstream.lower():
tasks.append(asyncio.create_task(get_streamlink(upstream, proxy, logger)))
tasks.append(asyncio.create_task(get_ytdl(upstream, proxy, logger)))
tasks.append(asyncio.create_task(get_meta(upstream, proxy, logger)))