Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13891

having trouble uploading video to telegram with aiogram lib

$
0
0

was writing a bot that goes through several tokens and sends a video

error i encountered:

aiogram.exceptions.TelegramBadRequest: Telegram server says - Bad Request: wrong file identifier/HTTP URL specified

code:

import asynciofrom aiogram import Bot, Dispatcher, typesfrom io import BytesIOimport requeststokens = ['6766800741:AAHq3w*****************************','6759714409:AAFabo*****************************','6822677705:AAFylR*****************************']dp = Dispatcher()async def popa():    resp = requests.get('https://cdn77-vid-mp4.xvideos-cdn.com/tWE5jUC1yt64rY5u3i-WcA==,1704260661/videos/3gp/e/6/c/xvideos.com_e6c4845505f215a6fc52c97645444d97.mp4?ui=MTA5LjI1Mi43Mi4xMTgtL3ZpZGVvNzQzMTEwMDkvdGdpcmxzLnh4eF9zaGVf')    vid = BytesIO(resp.content)    types.BufferedInputFile(vid.read(), 'ytgbyuivtby.mp4')    await bot.send_video('-100*******747', 'ytgbyuivtby.mp4')if __name__ == "__main__":    for t in tokens:        bot = Bot(t)        asyncio.run(popa())

Viewing all articles
Browse latest Browse all 13891

Trending Articles