'"telegram.error.BadRequest: Wrong file identifier/http url specified" when trying to send certain URLs
I have this function that basically sends messages to a chat group in telegram with data from new documentaries.
chat_id = *chat_number*
images = 'https://m.media-amazon.com/images/M/MV5BZGZjZDg0MzYtY2NhNy00YjM4LWI2YzQtYTk4Zjk0ZmRiY2VmXkEyXkFqcGdeQXVyOTU1MTMxOQ@@._V1_.jpg'
message = bot.send_photo(chat_id, images, caption = text, parse_mode = 'HTML')
Normally it works but this link in particular (also another ones) raises an error in telegram. How could I do to avoid this error? I dont want to turn the url into a file and sending afterwards, there's any other option?
this is the error:
raise BadRequest(message) telegram.error.BadRequest: Wrong file identifier/http url specified
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|