skip to Main Content

I’m using python and telebotAPI for my bot and I noticed that the command bot.send_video(chat_id, open(file_name, 'rb')) only sends videos smaller than 10mb, is there a way to send very large video files?

UPDATE:
After some comments I read in the telegram documentation: if the file is already stored somewhere on the Telegram servers, you don’t need to reupload it: each file object has a file_id field, simply pass this file_id as a parameter instead of uploading. There are no limits for files sent this way. So how I can send a video to the telegram server and then send the file_id to the chat?

2

Answers


  1. There is an attribute in send_video function as ‘timeout’. By default timeout is 20s. If you need more time for sending your video, set it at your desired time in seconds. For example:

    bot.send_video(chat_id='receiver chat id', video=open(file_name, 'rb')), timeout=10000)
    

    Good Luck!

    Login or Signup to reply.
  2. To send using ‘file_id’ – for example, send file to the bot, the bot will trigger callback, find the remoteFile there, and take id – it will look something like this

    AAMCAgADGQEAAqCnXv7lHCkd-2Br08TSugdUR45LVyIAAnoIABJctPlLDk4X8ug8tDcaMSmVLgADAQAHbQADoKoAAhgE
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search