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)
Related
In the Telegram app, you can send photos that self-destruct and can't be screenshotted by clicking on the clock icon before sending them. Is there any way to reproduce this behavior using the Telegram Bot API?
I'm using python-telegram-bot and couldn't find anything in its docs, but i'm not even sure if the API allows it. I could delete the messages after some time using bot.delete_message, however, the important part here is that the images shouldn't be screenshottable.
I'm using python-telegram-bot and couldn't find anything in docs, but i'm not even sure if the API allows it.
Telegram Bot API does not support such method yet.
I could delete the messages after some time using bot.delete_message, however, the important part here is that the images shouldn't be screenshottable.
Yes, bot can delete messages "manually" but there's no way to control the ability of making screenshots.
I was getting started with telegram bots and I was wondering if there's a way to get a BOT to search through the files posted in a channel (and possibly download them, if the user asks for it).
For instance, if a BOT has a command "/search" and the user searches a file using certain keywords, then the BOT should answer with the requested file, if found on the channel, and it should also provide an internal link to download it.
I noticed that the APIs provide a getFile method that maybe could be useful in this case, I just wanted to know if this thing is achievable!
Hope I've made myself clear!
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
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 want to continuously listen to LinkedIn stream watching for users' activity such as adding connection, writing new posts, etc. It's just like watching the Twitter stream to look for certain tweets. How is this possible? Any API? Need help plz. If its paid API, I am ready to have it.