Issue
This Content is from Stack Overflow. Question asked by respect btc
Download tiktok video from url aiogram. How can i solve this error or another way of downloading tiktok video
if message.text.startswith('https://vt.tiktok.com'):
link = f"{message.text}"
video_data = TikTokApi().video(url=f"{link}").video.bytes()
with open(f"{message.from_user.id}.mp4", "wb") as out_file:
out_file.write(video_data)
videos = open(f'{message.from_user.id}.mp4', 'rb')
await bot.send_video(message.chat.id, video=videos, width=1920, height=1080)
Solution
This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.
This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.