https://t.me/haoruanfenxianggroup/350217
日常和DMCA对着干。
使用Telethon备份频道消息到另一个频道。
Telethon是TG客户端的Python实现,可以用于一些批处理操作以及bot,想要使用Telethon,首先需要访问 my.telegram.org 通过自己账号创建应用程序并获取API ID和API HASH。
通过
下面是一个示例:https://github.com/ZGQ-inc/-/blob/main/code/python/telethon/for.py
TG有风控,机制我还没完全搞懂,
更多示例:
使用
https://github.com/ZGQ-inc/-/blob/main/code/python/telethon/getJSON.py
使用
https://github.com/ZGQ-inc/-/blob/main/code/python/telethon/getUID.py
*请妥善保管session文件。
日常和DMCA对着干。
使用Telethon备份频道消息到另一个频道。
Telethon是TG客户端的Python实现,可以用于一些批处理操作以及bot,想要使用Telethon,首先需要访问 my.telegram.org 通过自己账号创建应用程序并获取API ID和API HASH。
通过
forward_messages()方法转发频道消息:https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.messages.MessageMethods.forward_messages下面是一个示例:https://github.com/ZGQ-inc/-/blob/main/code/python/telethon/for.py
TG有风控,机制我还没完全搞懂,
start_id和end_id的范围最好不要超过1000,每次需要冷却15分钟,如果一下子转发太多,会导致频道被官方封禁。更多示例:
使用
get_messages()方法获取消息元数据并格式化为JSON:https://github.com/ZGQ-inc/-/blob/main/code/python/telethon/getJSON.py
使用
get_participants()方法遍历群组成员ID并输出到JSON:https://github.com/ZGQ-inc/-/blob/main/code/python/telethon/getUID.py
*请妥善保管session文件。