Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telegram] sendMediaGroup - 400 Bad Request for documents array or mix #650

Open
VladimirCores opened this issue Aug 29, 2021 · 4 comments
Labels

Comments

@VladimirCores
Copy link

When I try to send multiple documents I got the error:

0|npm start  | AxiosError: Telegram API - 400 Bad Request: wrong file identifier/HTTP URL specified
0|npm start  |     at TelegramClient.<anonymous> (/.../node_modules/messaging-api-telegram/dist/TelegramClient.js:67:27)
0|npm start  |     at Generator.throw (<anonymous>)
0|npm start  |     at rejected (/.../node_modules/messaging-api-telegram/dist/TelegramClient.js:6:65)
0|npm start  |     at runMicrotasks (<anonymous>)
0|npm start  |     at processTicksAndRejections (internal/process/task_queues.js:95:5)
0|npm start  | Error Message -
0|npm start  |   Telegram API - 400 Bad Request: wrong file identifier/HTTP URL specified
0|npm start  | Request -
0|npm start  |   POST /sendMediaGroup
0|npm start  | Request Data -
0|npm start  |   {
0|npm start  |     "chat_id": "@groupid",
0|npm start  |     "media": [
0|npm start  |       {
0|npm start  |         "type": "document",
0|npm start  |         "media": "https://64.media.tumblr.com/e5382624feb56e3b32740a22b3305ee8/ca057c4fa92f6baa-d7/s500x750/7797a8155b711abc2732c432ec5a8c37b1860b84.gif"
0|npm start  |       },
0|npm start  |       {
0|npm start  |         "type": "document",
0|npm start  |         "media": "https://64.media.tumblr.com/0f40868b31818022a7c70929ce45fb44/ca057c4fa92f6baa-5b/s500x750/2837ebfa5540ac6351a122bba26a89f648328cb2.gif"
0|npm start  |       },
0|npm start  |       {
0|npm start  |         "type": "document",
0|npm start  |         "media": "https://64.media.tumblr.com/a9e19e401667c4407fdab006d6f56354/ca057c4fa92f6baa-42/s500x750/716719270053218835f34ad4e4deb89cdc935d6b.gif"
0|npm start  |       },
0|npm start  |       {
0|npm start  |         "type": "document",
0|npm start  |         "media": "https://64.media.tumblr.com/19c75eb828ed442b9aae91289956209a/ca057c4fa92f6baa-85/s500x750/b0e8779ed8a2a598d54f02356bf0889901ff914d.gif"
0|npm start  |       }
0|npm start  |     ]
0|npm start  |   }
0|npm start  | Response -
0|npm start  |   400 Bad Request
0|npm start  | Response Data -
0|npm start  |   {
0|npm start  |     "ok": false,
0|npm start  |     "error_code": 400,
0|npm start  |     "description": "Bad Request: wrong file identifier/HTTP URL specified"
0|npm start  |   }

However in the original documentation its written that sending InputMediaDocument should be possible:
Screen Capture_select-area_20210830024908

@wtflink
Copy link
Member

wtflink commented Aug 30, 2021

It seems like the error Telegram API - 400 Bad Request: wrong file identifier/HTTP URL specified occur when you send a file which name is not starting with letter.

Try to make your file names starting with letter instead of number, send the request again, see if this error persist?

ref: https://stackoverflow.com/questions/47005393/telegram-bot-bad-request-wrong-file-identifier-http-url-specified

@VladimirCores
Copy link
Author

Strange because posting individual document has no problem:

await tg.sendDocument('@sprclstr', "https://64.media.tumblr.com/a9e19e401667c4407fdab006d6f56354/ca057c4fa92f6baa-42/s500x750/716719270053218835f34ad4e4deb89cdc935d6b.gif")

Screen Capture_select-area_20210830140001

@wtflink any other thought?

@wtflink
Copy link
Member

wtflink commented Aug 30, 2021

This issue seems familiar to your case, did you check your file size?
telegraf/telegraf#1481

@VladimirCores
Copy link
Author

The file size is not big, as I wrote above the gif content can be posted one by one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants