mirror of
https://github.com/Dineshkarthik/telegram_media_downloader.git
synced 2024-12-26 00:33:31 +08:00
fix: use own fork of Pyrogram to achieve chronological order of chat history
This commit is contained in:
parent
9a2cef55bc
commit
6c48df4a27
2 changed files with 3 additions and 5 deletions
|
@ -2,7 +2,6 @@
|
|||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
from datetime import datetime as dt
|
||||
from typing import List, Optional, Tuple, Union
|
||||
|
||||
import pyrogram
|
||||
|
@ -123,7 +122,7 @@ async def _get_media_meta(
|
|||
_type,
|
||||
"{}_{}.{}".format(
|
||||
_type,
|
||||
dt.utcfromtimestamp(media_obj.date).isoformat(), # type: ignore
|
||||
media_obj.date.isoformat(), # type: ignore
|
||||
file_format,
|
||||
),
|
||||
)
|
||||
|
@ -311,8 +310,7 @@ async def begin_import(config: dict, pagination_limit: int) -> dict:
|
|||
await client.start()
|
||||
last_read_message_id: int = config["last_read_message_id"]
|
||||
messages_iter = client.get_chat_history(
|
||||
config["chat_id"],
|
||||
offset_id=last_read_message_id,
|
||||
config["chat_id"], offset_id=last_read_message_id, reverse=True
|
||||
)
|
||||
messages_list: list = []
|
||||
pagination_count: int = 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Pyrogram==2.0.33
|
||||
https://github.com/Dineshkarthik/pyrogram/archive/refs/heads/master.zip
|
||||
PyYAML==6.0
|
||||
rich==12.5.1
|
||||
TgCrypto==1.2.3
|
||||
|
|
Loading…
Reference in a new issue