minor fixes
This commit is contained in:
parent
5bb7a72c6c
commit
724e07179d
@ -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