minor fixes
This commit is contained in:
parent
d404aa92a6
commit
6d9f8ae704
2
main.py
2
main.py
@ -5,4 +5,4 @@ from src.core.master_service import MasterService
|
||||
if __name__ == '__main__':
|
||||
freeze_support()
|
||||
ms = MasterService()
|
||||
ms.loop.run_until_complete(ms.run())
|
||||
ms.loop.run_until_complete(ms.run())
|
||||
|
@ -87,8 +87,6 @@ class MasterService:
|
||||
result = downloader.video_download()
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_parser(params: dict):
|
||||
try:
|
||||
|
@ -2,8 +2,8 @@ api_hash: cb06da2bf01e15627434223242b6446d
|
||||
api_id: 21648766
|
||||
chat:
|
||||
- chat_id: landigos
|
||||
download_filter: id == 6989
|
||||
last_read_message_id: 6989
|
||||
download_filter: id == 6986
|
||||
last_read_message_id: 6986
|
||||
file_formats:
|
||||
video:
|
||||
- all
|
||||
|
@ -487,9 +487,11 @@ async def worker(client: pyrogram.client.Client):
|
||||
if node.client:
|
||||
await download_task(node.client, message, node)
|
||||
app.is_running = False
|
||||
app.loop.stop()
|
||||
else:
|
||||
await download_task(client, message, node)
|
||||
app.is_running = False
|
||||
app.loop.stop()
|
||||
except Exception as e:
|
||||
logger.exception(f"{e}")
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import os
|
||||
from asyncio import gather
|
||||
from urllib.parse import urlparse
|
||||
@ -30,7 +31,9 @@ class TelegramParser(BaseParser):
|
||||
mode="w+", encoding="utf-8") as f:
|
||||
YAML().dump(config, f)
|
||||
if _check_config():
|
||||
app.loop.run_until_complete(gather(*[download_all_chat(client), worker(client)]))
|
||||
asyncio.run_coroutine_threadsafe(download_all_chat(client), app.loop)
|
||||
asyncio.run_coroutine_threadsafe(worker(client), app.loop)
|
||||
app.loop.run_forever()
|
||||
client.stop()
|
||||
app.is_running = False
|
||||
logger.info("Stopped!")
|
||||
|
Loading…
Reference in New Issue
Block a user