tangyoha / telegram_media_downloader

基于Dineshkarthik的项目, 电报视频下载,电报资源下载,跨平台,支持web查看下载进度 ,支持bot下发指令下载,支持下载已经加入的私有群但是限制下载的资源, telegram media download,Download media files from a telegram conversation/chat/channel up to 2GiB per file
MIT License
2.04k stars 236 forks source link

[Bug]: 转发 mediagroup会变成多个消息 #156

Open icaca opened 3 months ago

icaca commented 3 months ago

telegram_media_downloader version or commit

310f5f25e705b82fe316ab26bab51b0afec41615

What OS are you seeing the problem on?

Other Linux Distro

Python Version

3.11.7

What happened?

收到mediagroup 后,会触发多次 self.client.add_handler(MessageHandler(listen_forward_msg))

导致最后的消息不是group,而是单个资源

Expected Behavior

希望能用使用mediagroup发送整合后的资源

Current Behavior

mediagroup被拆分成了多个资源,分开发送

Possible Solution

修改库pyrogram,mediagroup 只出发一次message事件

Steps to Reproduce

No response

Relevant log output

{13686196842918084: {269: None, 270: pyrogram.raw.types.InputSingleMedia(media=pyrogram.raw.types.InputMediaDocument(id=pyrogram.raw.types.InputDocument(id=6325685635218672616, access_hash=664237647553207384, file_reference=b'\x04w\xde*\n\x00\x00\x01\x0ee\xf8YMU\xfaP\x83\xf4\x02\t\xe6\xc6\x9esh\xac\xee2\x1a')), random_id=7347720996482187280, message=''), 271: None}}

 {13686196842918084: {269: None, 270: None, 271: pyrogram.raw.types.InputSingleMedia(media=pyrogram.raw.types.InputMediaDocument(id=pyrogram.raw.types.InputDocument(id=6325685635218672617, access_hash=-5515283423846417700, file_reference=b'\x04w\xde*\n\x00\x00\x01\x0fe\xf8YMu\x08\xc9\x07\xb0a"\xa2\xac\xdd\x14l\xf3il\xa5')), random_id=7347720996482187288, message='')}}

{13686196842918084: {269: pyrogram.raw.types.InputSingleMedia(media=pyrogram.raw.types.InputMediaDocument(id=pyrogram.raw.types.InputDocument(id=6325685635218672615, access_hash=-8770086123798877738, file_reference=b'\x04w\xde*\n\x00\x00\x01\re\xf8YM\x05\xb6\xd1\xe5\xc7\xdcV\xc0\x95R30\x97]\xd6\xe7')), random_id=7347721000777154568, message=''), 270: None, 271: None}}