Search code examples
pythontelegramtelegram-bottelethonpyrogram

How to upload instant playable video to telegram


I am making a telegram bot to upload videos in my local PC. But when I sent the video, that message is very dumb. like this

Image 1

But I need videos like this

Image 2

Image 3

my code is

from pyrogram import Client
app = Client(
    "session",
    api_id=329,
    api_hash="7943a36fdcf9"
    )
with app:
    app.send_video(chat_id = channel, video = 'vid.mp4',supports_streaming = True)

is there any specific specific methods for sending a proper video? How can I send a video properly


Solution

  • Your video file is too big. Telegram will handle videos < 10 MB and automatically create a thumbnail for you. For videos larger than that you'll have to supply the information about the video yourself. Resolution (width and height), length, thumbnail, etc..

    Additionally, you can omit the supports_streaming argument, as Pyrogram defaults this to True anyway.

    To get information about your video you could use something like ffprobe.