tdlib / telegram-bot-api

Telegram Bot API server
https://core.telegram.org/bots
Boost Software License 1.0
2.94k stars 569 forks source link

Does telegram-bot-api still not support uploading files up to 4G? #583

Closed nbtu closed 1 month ago

nbtu commented 1 month ago

I am already a premium member of telegram. I tried to use telegram-bot-api to upload files, but it does not seem to support files larger than 2G.

curl -F video=@20240503.mp4 -X POST "http://localhost:8081/bot${TOKEN}/sendVideo?chat_id=${chat_id}&supports_streaming=true"|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3495M    0    77  100 3495M      0  8050k  0:07:24  0:07:24 --:--:-- 4071k
{
  "ok": false,
  "error_code": 400,
  "description": "Bad Request: FILE_PARTS_INVALID"
}
levlam commented 1 month ago

Bot API server supports uploading of files of any size allowed by Telegram, but the user must be a Premium user to be able to upload files bigger than 2000 MB. Bots can't be Premium users, therefore they aren't allowed to upload files bigger than 2000 MB.

nbtu commented 1 month ago

Bot API server supports uploading of files of any size allowed by Telegram, but the user must be a Premium user to be able to upload files bigger than 2000 MB. Bots can't be Premium users, therefore they aren't allowed to upload files bigger than 2000 MB.

Thanks for your reply.

mostafa-norouzi commented 2 weeks ago

Recently I faced with a bot that can upload files to telegram up to 4gig! So how can it possible?

nbtu commented 2 weeks ago

Recently I faced with a bot that can upload files to telegram up to 4gig! So how can it possible?

a bot≠ bot api Are you sure it is using bot api to upload files to Telegram? The bot's backend can also use Telegram API

mostafa-norouzi commented 2 weeks ago

Telegram API isn't limited to 50MB ? So how a bot can use it and send 4gig!?

Sarisan commented 2 weeks ago

Telegram API isn't limited to 50MB ? So how a bot can use it and send 4gig!?

I presume it doesn't upload any files, instead it passes the file_id of already uploaded document by premium user.

mostafa-norouzi commented 2 weeks ago

The bot receive URL and give the file, So it can't do such a thing, but with your hint , maybe bot split file with zip based on limit (2gigs). I don't already have membership and it's just a guess!