send_video函数的拇指参数不起作用!电报机器人Python
context.bot.send_video(chat_id=update.message.chat_id, video=vid, caption='the video', thumb= pic)
VID变量是视频文件ID,PIC变量是
该机器人能够正确发送视频的缩略图照片文件ID,但不会根据需要更改缩略图。视频甚至标题为“视频”!
我的代码或拇指参数有问题吗?
context.bot.send_video(chat_id=update.message.chat_id, video=vid, caption='the video', thumb= pic)
vid variable is the video file id and pic variable is the thumbnail photo file id
The bot is able to send the video correctly but it doesn't change the thumbnail as desired. The video even has the caption "the video"!
Is there something wrong with my code or with the thumb parameter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果视频足够小,AFAIK电报倾向于忽略缩略图。在这种情况下,TG只是从视频中生成拇指。至少对于
inputmedia*
类,事实记录了。
AFAIK Telegram tends to ignore the thumbnail if the video is small enough. In that case, TG just generates the thumb from the video. At least for the
InputMedia*
classes, this is in fact documented.如果您的视频大小为
< 10-20MB
电报将自动生成拇指。但是,在此期间,您可以从本地JPG图像中指定thumb
。请记住,缩略图应采用
jpeg
格式,小于200 kb
的大小。缩略图的宽度和高度不应超过320 PX
。If your video size is
<10-20MB
telegram will automatically generate thumb. But, above that you can specify thethumb
from your local jpg image.Remember that The thumbnail should be in
JPEG
format and less than200 KB
in size. A thumbnail’s width and height should not exceed320 px
.