TelegramBadRequest: Telegram server says - Bad Request: file is too big

Пытаюсь скачать отправленное видео через aiogram

videos = message.video
text = message.caption
print(text)
file_id = videos.file_id
file_path = await bot.get_file(file_id)
await bot.download_file(file_path.file_path, f'path/to/save/{file_id}.mp4')

получаю ошибку

aiogram.exceptions.TelegramBadRequest: Telegram server says - Bad Request: file is too big

есть ли какой нибудь способ скачать большой файл? Спасибо за любую помощь


Ответы (1 шт):

Автор решения: CausonQ

Есть. Использовать Local Bot API Server

The Bot API server source code is available at telegram-bot-api. You can run it locally and send the requests to your own server instead of https://api.telegram.org. If you switch to a local Bot API server, your bot will be able to:

Download files without a size limit.

Upload files up to 2000 MB.

Upload files using their local path and the file URI scheme.

Use an HTTP URL for the webhook.

Use any local IP address for the webhook.

Use any port for the webhook.

Set max_webhook_connections up to 100000.

Receive the absolute local path as a value of the file_path field without the need to download the file after a getFile request.

→ Ссылка