问题描述
使用 Telethon 上传视频文件时是否可以设置视频文件的宽度和高度? 我正在使用此功能上传视频
await client.send_file(entity='@bot',file=path_to_file,progress_callback=callback,caption=caption)
解决方法
指向 Telethon 文档的链接: https://tl.telethon.dev/constructors/document_attribute_video.html
您可以使用 DocumentAttributeVideo
设置视频的持续时间、宽度和高度。
示例:
from telethon.tl.types import DocumentAttributeVideo
client.send_file(...,attributes=(DocumentAttributeVideo(0,0),))