From 5969e241284c6eb1f92e4d3a9d5ef2998716b17f Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Thu, 27 May 2021 20:39:29 +0200 Subject: [PATCH] catch provider timeout --- backend/stream_providers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/stream_providers.py b/backend/stream_providers.py index 5f26212..a894330 100755 --- a/backend/stream_providers.py +++ b/backend/stream_providers.py @@ -100,7 +100,11 @@ async def get_any(upstream, proxy, logger): tasks.append(asyncio.create_task(get_ytdl(upstream, proxy, logger))) result = None for task in asyncio.as_completed(tasks, timeout=5.0): - temp_result = await task + temp_result = None + try: + temp_result = await task + except Exception as e: + logger.info(e) if isinstance(temp_result, str): result = temp_result break