From a1ac365fadeb064600e0823d7c1a65d1e825b59d Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sun, 23 Jul 2023 12:27:36 +0200 Subject: [PATCH] fix streamlink --- backend/stream_providers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/stream_providers.py b/backend/stream_providers.py index d83c094..2a24c2f 100755 --- a/backend/stream_providers.py +++ b/backend/stream_providers.py @@ -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,8 +395,8 @@ 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_streamlink(upstream, proxy, logger))) tasks.append(asyncio.create_task(get_ytdl(upstream, proxy, logger))) tasks.append(asyncio.create_task(get_meta(upstream, proxy, logger)))