This commit is contained in:
nikili0n 2023-10-18 00:44:31 +03:00 committed by Dantenerosas
parent 69eb65f32b
commit dc066a17ab

View File

@ -70,12 +70,12 @@ class MasterService:
downloader: BaseParser | YappyParser | MyMailParser | TelegramParser = MasterService.get_parser(video_params) downloader: BaseParser | YappyParser | MyMailParser | TelegramParser = MasterService.get_parser(video_params)
match downloader: match downloader:
case TelegramParser(): case TelegramParser():
if _check_config(): loop = asyncio.get_running_loop()
loop = asyncio.get_event_loop() asyncio.set_event_loop(loop)
asyncio.set_event_loop(loop) f: asyncio.Future = asyncio.run_coroutine_threadsafe(downloader.video_download())
loop.run_until_complete(downloader.video_download()) r = f.result(60)
# loop.close() # loop.close()
return result return r
case _: case _:
result = downloader.video_download() result = downloader.video_download()
return result return result