From 44ce28bee7f0f687660888f727a69f49593bfd3d Mon Sep 17 00:00:00 2001 From: Dantenerosas Date: Wed, 18 Oct 2023 00:44:31 +0300 Subject: [PATCH] test wip --- src/core/master_service.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/master_service.py b/src/core/master_service.py index fdcc90d..20f4282 100644 --- a/src/core/master_service.py +++ b/src/core/master_service.py @@ -70,12 +70,12 @@ class MasterService: downloader: BaseParser | YappyParser | MyMailParser | TelegramParser = MasterService.get_parser(video_params) match downloader: case TelegramParser(): - if _check_config(): - loop = asyncio.get_event_loop() - asyncio.set_event_loop(loop) - loop.run_until_complete(downloader.video_download()) - # loop.close() - return result + loop = asyncio.get_running_loop() + asyncio.set_event_loop(loop) + f: asyncio.Future = asyncio.run_coroutine_threadsafe(downloader.video_download()) + r = f.result(60) + # loop.close() + return r case _: result = downloader.video_download() return result