图片问题:pyrogram.types.inputmediaphoto
我尝试了url send_media_group照片。在文档中说我可以使用http链接,但会提供一个错误消息:
pyrogram.errors.exceptions.bad_request_400.mediainvalid:telegram说:[400 Media_invalid] - 媒体无效(由“ Message.uploadMedia”引起,
当我尝试以文件为文件时,一切都可以。当然,我可以首先下载然后作为文件发送。但是它将降低发送速度。
代码:
url = https://photo.jpg
await app.send_media_group(
msg.chat.id,
[
InputMediaPhoto(url)
]
)
Im trying send_media_group photo by url. In documentation says that i can use HTTP links, but gives an error message:
pyrogram.errors.exceptions.bad_request_400.MediaInvalid: Telegram says: [400 MEDIA_INVALID] - The media is invalid (caused by "messages.UploadMedia")
When I try to send as file, everything works. Of course, I can first download and then send as a file. But it will slow down the sending speed.
Code:
url = https://photo.jpg
await app.send_media_group(
msg.chat.id,
[
InputMediaPhoto(url)
]
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经使用了您的代码,并从URL上传了一个图像,
如果您提供图像的URL,那就更好了
I have Used your code and Uploaded a Image from the URL,
It would be Better if you Provide the url of Image your trying to Upload
给定的链接的图像可能太大了。 Telegram不会获取大于10 MB的媒体,您必须下载然后自己上传。
The image at the link given may be too large. Telegram doesn't fetch media larger than 10 MB and you'll have to download then upload yourself.