python-3.x - 无法将音频上传到 Telegram 错误请求 : failed to ge

我有 mp3 的工作 url,我正在尝试通过此 url 将音频发送到 Telegram。它有时会起作用,但大多数时候会出错

"A request to the Telegram API was unsuccessful. The server returned HTTP 400 
Bad Request. Response body:
[b'{"ok":false,"error_code":400,"description":"Bad Request: failed to get HTTP 
URL content"}']"

我不明白为什么,因为我检查了大小和类型,一切都很清楚,我在 Telegram API 的文档中找不到更多的限制。谁知道错误的原因是什么?

链接到 mp3 - http://data3.api.xn--41a.ws/vkp/cs9-5v4.userapi.com/p15/51bdb5ec5899ed.mp3

最佳答案

检查文件大小。

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.

Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.

关于python-3.x - 无法将音频上传到 Telegram 错误请求 : failed to get HTTP URL content,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45492171/

相关文章:

mysql - phpmyadmin error 403 - Forbidden rejected

java - 如何配置 Hibernate Envers 以避免实体修订查询中的某些集合(连接表)

amazon-dynamodb - DynamoDB PutItem 然后 UpdateItem 与

reactjs - 从 create-react-app 发出构建文件

vb.net - 字符串中的代码格式 - 我可以将文本设为粗体吗?

node.js - 更新 Docker 镜像中的 npm

amazon-web-services - 如何将多个域名路由到同一个 amazon S3 存储桶位

python-3.x - Visual Studio 代码 pylint : Error when

Angular 2 - 如何将响应式(Reactive)表单元素动态绑定(bind)到事件?

python - 清除 Selenium 作用链