-1

I want to send one large video that is accessible via a public file url to a Telegram chat by chunks. And these chunks should be uploaded separately.

The reason for that is that my server is really weak and I dont want to get the video by making a request and then send it in a classic way.

I thought I can first upload the file partially to Telegram servers and then send it. I have tried to look at the source code of Client().save_file() pyrogram (python MTProto Telegram library) method, but was not able to figure out how I can achieve my goal.

To clarify, I want to do so that my program can get a file chunk (for example, using python`s Response().iter_content()), upload it to Telegram and repeat if there are more chunks to upload. Then it should just send a file to some Telegram chat. It should not form a video on my server and just send it

So the python code (note that I can accept a solution where other programming languages are used) may look like this:

import requests

for chunk in requests.get('FILE_URL', stream=True).iter_content():
    # Upload a chunk to Telegram server


# Send uploaded file to some Telegram chat

Please, give any information that can help (maybe in comments)

Deep Drop
  • 29
  • 6

0 Answers0