Im trying to send a video from a bot with a url. i can send a 5mb .mp4 file but 8mb .mp4 doesn't work.
from the telegram bot api it says that bots can send videos up to 50mb.
has anyone encountred this?
Unfortunately, You can't send video with url if it is bigger than 5mb. Try to send video with Stream.
If you want to send video is bigger than 50mb, you can use custom mtproto server or Telegram Local Server.
Check it: https://core.telegram.org/bots/api#using-a-local-bot-api-server
Related
I've been working on a bot that would send users videos (mostly larger than 500mb).
I've read the telegram bot api docs. There is a restriction of 50MB, with videos/animations/documents.
In the recent changes, Telegram announced now bots can send files upto 2000 MB.
I'm using Python Telegram Bot wrapper. I've tried to send videos using both from direct url and from directory. But it fails and shows the file size limitation error.
I also tried with get requests to Telegram Bot API. It failed.
There are many bots that are uploading files upto 2GB, So, my question is how to do it?
As pointed by #valijon in this answer you could also try to send files through InputStream, http url and cached file IDs. Also, I'd recommend you to take a look at Pyrogram:
# Keep track of the progress while uploading
def progress(current, total):
print(f"{current * 100 / total:.1f}%")
app.send_video("me", "video.mp4", progress=progress)
My organisation is using Google Chat for internal communication. In one of the group in the app I am sending the report of daily automation test run using webhook. Currently the report consist of only text message containing the pass/ fail count.
But I want to send the html report as well with that. I could not found any source which tell the information about how to send the attachment in the bot messages in Google chat.
Please help me if someone knows how to send the attachment report using Google Chat Bot or Webhook.
Per documentation, Bots have limited message types they can send. (Only simple text, or Cards)
I would suggest sending a link to download the report, which is feasible with the bot. See Including links in message text
I have developed a chatbot in Telegram to get user's photo sent using the following API:
https://core.telegram.org/bots/api#sendmessage
And able to get the file use the following API:
https://core.telegram.org/bots/api#getfile
However, the file downloaded lost the EXIF attributes. Is telegram strip all the data? Or is there any way to get the original file?
No there is no way to get original image. Telegram optimize photo for user display.
but if user send the photo as file (document) then you can get the image without any change/optimize from Telegram.
Is there any way to send a voice command to Telegram bot?
I want to send voices to my bot and use google API to convert them to text and then translate and send back.
In order to do this, I need to get the voice first. Is there any way to send the voice to the bot?
You can find file_id from Voice update, and then obtain download path via the getFile method.
This object represents a file ready to be downloaded.
The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>.
In above instance, you can download from https://api.telegram.org/file/bot485609210:mySecret/voice/file_178.
You can send a voice message to the bot, which would be stored on your server. Than convert it to text using Google API, translate and send back. Do you want to send it back as text?
I'm working on a telegram bot and I need to download photo, audio, video sent by user to the bot. Using the only path returned by the get file method I only get a thumbnail. In fact the only result of the get file method contains a really tiny value for the file size. I can't figure out where the problem is. The photos are normally sent by message as photo (not as file).
first you should download the photo with this api to your bot
https://api.telegram.org/bot<token>/getfile?file_id={the file_id of the photo you want to download}
then it returns you a response of a File which has an attribute named file_path
then using the file_path you can download the photo full size using this
https://api.telegram.org/file/bot<token>/<file_path>
all of this is based on official documentation found here .
Telegram API Doc