ay = {'access_token': token, 'v': '5.123'}
r = requests.post('https://api.vk.com/method/shortVideo.create', data=ay,
headers=headers)
Получаю ответ:
{'response': {'owner_id': 11111, 'video_id': 111111, 'upload_url': 'https://vu.mycdn.me/upload.do?sig=89ea737665b949045a9ae8f573f68fd22695b917&expires=1602828062932&clientType=13&appId=512000384397&id=2073322662253&userId=0'}}
Пытаюсь загрузить видео по ссылке из upload_url
upload_url = r.json()['response']['upload_url']
resp = requests.post(upload_url, files={'file': open('1.mp4', 'rb')}, data=ay)
Получаю ошибку 403 "HTTP Status 403 - Can't get file item containing data"
<html><head><title>Apache Tomcat/7.0.79 (ok11) - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - Can't get file item containing data</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Can't get file item containing data</u></p><p><b>description</b> <u>Access to the specified resource has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.79 (ok11)</h3></body></html>