Open meness opened 6 years ago
Same here.
Same here too, with sendPhoto, and the photo URL works fine. Small jpeg image with 27KB. And it's the same image URL that I'm using in Facebook Messenger Bot that works. :(
https://wtmqerubko.localtunnel.me//img/promocao/20180212-20180217/10.jpg
with sendPhoto, and the URL works fine, and the photo starts with a letter.
https://trello-attachments.s3.amazonaws.com/5666779e6c24bb815183689c/597f79754996f872478fb5c8/600x264/79a80ac19fe1a4390cba895c920944f2/S61028-20071611.jpg
Same here! 50 similar photos works fine. I have problem only with this one
https://s8.hostingkartinok.com/uploads/images/2018/08/d895b2471743055da86415f4af06b010.jpg
same here with sendPhoto and sendDocument 3 out of 86 got problem
Same here. Any solution?
+1 for sending audio
I was able to fix it in my case.
I was generating the file name dynamically and it had a hidden newline at the end.
I ran .replace(/\n$/, "")
on the value before passing it to send audio and it worked.
I have the same issue with sendPhoto. Still not solution?
+1 still no solution ?
@alytvynov Post the url here. It works in a lot of cases.
still having the same issue
I had solved this problem. And I answred here: https://stackoverflow.com/a/62672868/12866353
Hope this will help.
Having the same issue with sendPhoto
Having the same issue with sendPhoto
would you mind providing the image URL?
Having the same issue with sendPhoto
would you mind providing the image URL?
https://telegram.ke.precisionag.org/photo/images/explore.jpg
It looks like your image is too big to send.
API doc says:
Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.
Having the same issue with sendPhoto
would you mind providing the image URL?
https://telegram.ke.precisionag.org/photo/images/explore.jpg
It looks like your image is too big to send.
API doc says:
Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.
You're right, I changed the file size and it the sendPhoto
method worked, thanks
Same (i think) here, but with sendMessage method. I fixed when changed the URL from "http://**host**:port/etc..." to "http://**host.some.thing**:port/etc...".
Ps: host is hosted on a server only visible inside intranet.
Prueben enviar la url pero acortada yo asi lo soucione
Have the problem with sendAudio with URL string. So what is the solution ?
EDIT : I added ?random=64 and it worked.
Have the problem with sendAudio with URL string. So what is the solution ?
EDIT : I added ?random=64 and it worked.
What a uncertainty of program! lol
I've found out adding at the end of URL the query string:
?0
is enough to make it work 🤔
I've found out adding at the end of URL the query string:
?0
is enough to make it work 🤔
In my case I had a big difference, which I discovered after trying what you suggested.
this link does not generate error: https://ipfs.io/ipfs/QmUDTs1yCKM3XFHTEPABJb9b23VN77mbmoszRgbsQFQyYM/947.png this link does generate error: ipfs://QmT6kas8VTpkMZtT6EU2FJBejwnJTzVsMvxixSAMNWKitE/5293.png
placing '?0' at the end of the second link, it works 🤣
@PerfectInsect I got the same problem, in my url https://lgd-1304243501.cos.ap-nanjing.myqcloud.com/huahuadan_1.mp4, placing ?0 it does not work, but pacing ?00 it works, amazing!🤣
is this solved cause i also getting same error
Just to add an info: it is in fact a problem of the telegram API, not the node-telegram-bot-api. I tried bypassing the SDK and making the request directly with a HTTP request and it failed with the same images I tried before.
But I noticed 2 different errors from 2 different images:
data: {
ok: false,
error_code: 400,
description: 'Bad Request: MEDIA_EMPTY'
}
data: {
ok: false,
error_code: 400,
description: 'Bad Request: failed to get HTTP URL content'
}
I solved this problem when using the sendPhoto
method using a buffer and passing this buffer as a parameter. But it doesn't work with "editMessageMedia" since it only accepts a string for the media.
const imgBuffer = await axios
.get(movieImagePath, { responseType: "arraybuffer" })
.then((response) => Buffer.from(response.data, "binary"))
I've found out adding at the end of URL the query string:
?0
is enough to make it work 🤔
Worked! OMG!
I am using the latest version of the library.
Expected Behavior
This has to handle
http://dl.nex1music.ir/1396/07/03/Mohsen%20Salehi%20-%20Bigharari.mp3
URL, but gives an error. The given URL works out of the library properly.Actual Behavior
Steps to reproduce the Behavior