mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-08-29 04:06:42 +08:00
gotd's downloader is size-unaware: when a file's size is an exact multiple of the 1MiB part size, it issues one final upload.getFile at offset == size, which Telegram rejects with 400 OFFSET_INVALID, failing the whole download. Wrap the client to answer such requests with an empty chunk, matching the EOF semantics the downloader expects. Regression test uses a fake client with real server behavior (OFFSET_INVALID past EOF).