This commit is contained in:
Dantenerosas 2023-10-18 00:47:58 +03:00 committed by nikili0n
parent 44ce28bee7
commit 5392b0f0e1
2 changed files with 2 additions and 2 deletions

View File

@ -5,6 +5,6 @@ from src.core.master_service import MasterService
if __name__ == '__main__':
freeze_support()
loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
ms = MasterService(loop)
ms.loop.run_until_complete(ms.run())

View File

@ -70,7 +70,7 @@ class MasterService:
downloader: BaseParser | YappyParser | MyMailParser | TelegramParser = MasterService.get_parser(video_params)
match downloader:
case TelegramParser():
loop = asyncio.get_running_loop()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
f: asyncio.Future = asyncio.run_coroutine_threadsafe(downloader.video_download())
r = f.result(60)