soberhacker / obsidian-telegram-sync

Transfer messages and files from Telegram to Obsidian
GNU Affero General Public License v3.0
321 stars 30 forks source link

ETELEGRAM: 400 Bad Request: file is too big #79

Closed knopki closed 1 year ago

knopki commented 1 year ago

Version: 1.1.1

When a message with a large video is sent to the bot, there is an error in the console. Neither the message nor the attachment is created.

Error: ETELEGRAM: 400 Bad Request: file is too big
    at eval (plugin:telegram-sync:60565:17)
From previous event:
    at Promise2.longStackTracesCaptureStackTrace [as _captureStackTrace] (plugin:telegram-sync:6737:27)
    at Promise2._then (plugin:telegram-sync:8516:23)
    at Promise2.then (plugin:telegram-sync:8430:25)
    at TelegramBotPolling._polling (plugin:telegram-sync:60219:48)
    at eval (plugin:telegram-sync:60262:58)

I wish:

  1. Be able to download large files.
  2. If you can't download an attachment, at least save the message.
knopki commented 1 year ago

"Big file" is like 60 Mb.

burtasov commented 1 year ago

Hi! It will be resolved as soon as possible. There is an official limits for bots - 20 MB max file size possible to download. You can find approves here bot api using search query "20 MB". I have an idea how to skip this check, but need time to implement this.

knopki commented 1 year ago

Thank you so much! But it is equally important to be able to handle any errors: try to save at least something (at least the text of the message), give feedback to the chat (the text of the error, for example).

soberhacker commented 1 year ago

Hi @knopki , Try

Thank you so much! But it is equally important to be able to handle any errors: try to save at least something (at least the text of the message), give feedback to the chat (the text of the error, for example).

Hi @knopki, try this new plugin release with error handling. Big Files support is still in process.

https://github.com/soberhacker/obsidian-telegram-sync/releases/tag/1.2.0

Best Regards

knopki commented 1 year ago

Error is handled! Thank you! image

Maybe it is worth to skip file with error in handleFiles() and save message anyway?

soberhacker commented 1 year ago

Error is handled! Thank you! image

Maybe it is worth to skip file with error in handleFiles() and save message anyway?

"...save message..." do you mean file caption?

knopki commented 1 year ago

"...save message..." do you mean file caption?

⏳⏳⏳ Yes, I mean captions.

Sorry, I have no experience with the Telegram API and don't know specific terminology. But according to the code and Bot API documentation, I mean caption.

soberhacker commented 1 year ago

"...save message..." do you mean file caption?

⏳⏳⏳ Yes, I mean captions.

Sorry, I have no experience with the Telegram API and don't know specific terminology. But according to the code and Bot API documentation, I mean caption.

Fixed in release 1.3.0 https://github.com/soberhacker/obsidian-telegram-sync/releases/tag/1.3.0

knopki commented 1 year ago

Fixed in release 1.3.0

Works great! Thank you!

soberhacker commented 1 year ago

done https://github.com/soberhacker/obsidian-telegram-sync/releases/tag/1.6.0