using python. video will be uploaded but cover can not be seen. what's wrong?
import asyncio
from telegram import Bot
async def upload_video():
# Create a bot instance
bot = Bot(token=bot_token)
# Send the video to the channel with the specified cover image as thumbnail
with open(video_path, 'rb') as video, open(cover_path, 'rb') as cover:
await bot.send_video(
chat_id=channel_id,
video=video,
caption="Your Video Caption Here",
thumbnail=cover
)
# Run the asynchronous function
loop = asyncio.get_event_loop()
loop.run_until_complete(upload_video())
Does tg API even allows doin' so?
Have you checked the API docs? https://core.telegram.org/bots/api#sendvideo The thumbnail needs to be a JPEG, less than 200kB and 320x320 maximum. Does your file fit these requirements?
The video dimension is 1080*1920 I think thumbnail should be the same And in the docs it says it should be 320*320 not it must be
Everything allowed
Did you already try a smaller image?
Tried now and worked! I didn't expect that can be a problem Thanks Felix
Обсуждают сегодня