Answer the question
In order to leave comments, you need to log in
How to specify the width of the video to send via telegram bot?
I use:
import time
import random
import requests
import os
filesVideo = os.listdir("video/")
countVideo = len(files)
if countVideo == 0:
exit()
fileUploadIndexVideo = random.randint(0, countVideo - 1)
fileToUploadVideo = filesVideo[fileUploadIndexVideo]
fdVideo = open("video/" + fileToUploadVideo, 'rb')
urlVideo = "https://api.telegram.org/bot" + TOKEN + "/sendVideo";
filesVideo = {'video': fdVideo}
dataVideo = {'chat_id': CHAT_ID}
r = requests.post(urlVideo, files=filesVideo, data=dataVideo)
fdVideo.close()
os.remove("video/" + fileToUploadVideo)
Answer the question
In order to leave comments, you need to log in
It says like that you can specify the width and height of the video. width and height parameters
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question