send_video函数的拇指参数不起作用!电报机器人Python

发布于 2025-01-27 22:26:18 字数 228 浏览 5 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

Bonjour°[大白 2025-02-03 22:26:18

如果视频足够小,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.

寄风 2025-02-03 22:26:18

如果您的视频大小为< 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 the thumb from your local jpg image.
Remember that The thumbnail should be in JPEG format and less than 200 KB in size. A thumbnail’s width and height should not exceed 320 px.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文