alfem / telegram-downloader-bot

A Telegram bot for file downloading automation
Other
129 stars 50 forks source link

Error running #6

Closed carpediem75 closed 4 years ago

carpediem75 commented 5 years ago

This is what I get:

python2 telegram-download-bot.py Traceback (most recent call last): File "telegram-download-bot.py", line 116, in photo=photos[-1] IndexError: list index out of range

the bot on Telegram say that all is OK but don't answer

alfem commented 5 years ago

What kind of message or content are you sending to the bot?

carpediem75 commented 5 years ago

nothing. I run " python2 telegram-download-bot.py" in the folder of the project on ubuntu 18.04 The error is shown immediatly

alfem commented 5 years ago

are you reusing and old bot?

carpediem75 commented 5 years ago

no. if fixed the error adding an if to test if photos length is bigger than zero: if (len(photos)>0): photo=photos[-1]

but I don't understand why it happens, it is inside a try... no I get another error: raise BadRequest(message) telegram.error.BadRequest: File is too big

the file is a pdf of 2 megabyte

alfem commented 5 years ago

The 'try' only captures "AttributeError" exceptions.

About the file size, is a Telegram limit for bots, as I answered here: https://github.com/alfem/telegram-downloader-bot/issues/4