MohammadMokhalled / Telegram-Media-Mass-Downloader

A simple Python tool that lets you find and download photos and videos from Telegram chats. Pick what you want, update when a photo was sent, and get started easily.
MIT License
2 stars 1 forks source link

AttributeError on video download #4

Open gensth opened 3 weeks ago

gensth commented 3 weeks ago

Thanks for this great project. Its very helpful to restore "old" media from Telegram chats!

Unfortunately, I encountered an error: When calling python cli_handler.py download <chatid> --videos ... the following error was thrown Telegram-Media-Mass-Downloader/downloader.py", line 55, in download_media_from_chat elif download_videos and message.media and message.media.document: ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'MessageMediaPhoto' object has no attribute 'document'

There seems to be the fix by replacing the line 55 with elif download_videos and isinstance(message.media, MessageMediaDocument): I'll try to create a pull request :).

Best regards and thanks for publishing this repository (and all others)!

MohammadMokhalled commented 6 days ago

Thanks for your comment. Great, that you mentioned the problem. looking forward to the PR.