It’s been 10 hours, I’ve tried occasionally but the server returns either
{“errors”:[{“message”:“Over capacity”,“code”:130}]}
or
{“errors”:[{“message”:“Internal error”,“code”:131}]}
I’ve also tried to verify that at least the steps are correct but I get different errors from twurl:
$ twurl -H upload.twitter.com “/1.1/media/upload.json” -d “command=INIT&media_type=video/mp4&total_bytes=2432638”
{“media_id”:707657874483257345,“media_id_string”:“707657874483257345”,“expires_after_secs”:86400}
$ twurl -H upload.twitter.com “/1.1/media/upload.json” -d “command=APPEND&media_id=707657874483257345&segment_index=0” --file shortvid.mp4 --file-field “media”
$ twurl -H upload.twitter.com “/1.1/media/upload.json” -d “command=FINALIZE&media_id=707657874483257345”
{“media_id”:707657874483257345,“media_id_string”:“707657874483257345”,“size”:2432638,“expires_after_secs”:86400,“video”:{“video_type”:“video/mp4”}}
$ twurl -H upload.twitter.com “/1.1/media/upload.json” -d “command=STATUS&media_id=707657874483257345”
{“errors”:[{“code”:38,“message”:“media parameter is missing.”}]}
Though I think the documentation says media_id … https://dev.twitter.com/rest/reference/post/media/upload-chunked
twurl -H upload.twitter.com “/1.1/media/upload.json” -d “command=STATUS&media=707657874483257345”
{“errors”:[{“code”:324,“message”:“The validation of media ids failed.”}]}
Is there any other way to debug this?
Thanks in advance.
Update: Also tried https://github.com/twitterdev/django-rest-apis now. (BTW, there’s a step missing in the setup instructions: python manage.py makemigrations home --settings=app.settings_my without it the video upload view breaks)
Using videos that are downloaded from twitter (using https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/videos) it also fails:
https://upload.twitter.com/1.1/media/upload.json INIT request: {‘media_type’: ‘video/mp4’, ‘command’: ‘INIT’, ‘total_bytes’: 2432638, ‘media_category’: u’amplify_video’}
https://upload.twitter.com/1.1/media/upload.json INIT response: {u’media_id_string’: u’707671080480051200’, u’media_id’: 707671080480051200, u’expires_after_secs’: 15552000}
https://upload.twitter.com/1.1/media/upload.json APPEND request: segment 0
https://upload.twitter.com/1.1/media/upload.json APPEND response: <Response [204]>
https://upload.twitter.com/1.1/media/upload.json FINALIZE request: 707671080480051200
https://upload.twitter.com/1.1/media/upload.json FINALIZE response: {u’media_id_string’: u’707671080480051200’, u’media_id’: 707671080480051200, u’processing_info’: {u’check_after_secs’: 5, u’state’: u’pending’}, u’expires_after_secs’: 15552000, u’size’: 2432638}
https://upload.twitter.com/1.1/media/upload.json STATUS request: {‘media_id’: u’707671080480051200’, ‘command’: ‘STATUS’}
https://upload.twitter.com/1.1/media/upload.json STATUS response: {u’media_id_string’: u’707671080480051200’, u’media_id’: 707671080480051200, u’processing_info’: {u’check_after_secs’: 5, u’state’: u’in_progress’, u’progress_percent’: 94}}
https://api.twitter.com/1.1/statuses/update.json request: {‘status’: u’Test video’, ‘media_ids’: [u’707671080480051200’]}
https://api.twitter.com/1.1/statuses/update.json response: {“errors”:[{“code”:44,“message”:“media parameter is invalid.”}]}