尝试发布视频文件时遇到错误代码:400
。你知道吗
错误:
400 Bad Request
b'{
"ok":false,
"error_code":400,
"description":"Bad Request: there is no video in the request"
}'
请告知问题所在(视频文件工作并存在于所述路径中)
def sendVideo(bot_token,bot_chatID):
url = "https://api.telegram.org/bot"+ bot_token +"/sendVideo";
files = {'file': open('C:/Users/myUser/Desktop/telegram/t_video.mp4', 'rb')}
data = {'chat_id' : bot_chatID}
r = requests.post(url, files=files)
print(r.status_code, r.reason, r.content)
改变一下这个
为了这个
因为Bot API需要
video
参数名来确定媒体的类型。你知道吗你忘了把
data=data
(或params=data
)加到requests.post()
来传递chat_id
。你知道吗相关问题 更多 >
编程相关推荐