nst / STTwitter

A stable, mature and comprehensive Objective-C library for Twitter REST API 1.1
BSD 3-Clause "New" or "Revised" License
999 stars 161 forks source link

Chunked media uploads with video do not respect 5MB chunk limit, which causes upload failures #203

Closed garrettmurray closed 9 years ago

garrettmurray commented 9 years ago

Currently, -postMediaUploadAPPENDWithVideoURL:mediaID:uploadProgressBlock:successBlock:errorBlock: does not support breaking video uploads up into multiple appends at or under the 5MB chunk limit specified by Twitter's API requirements (https://dev.twitter.com/rest/reference/post/media/upload-chunked). This means if you attempt to upload a video that is file size > 5MB (say, an 8MB file), you will get an API failure on APPEND as your chunk is around 8MB.

It looks like the APPEND method is hard-coded to do a single append chunk rather than breaking up the data into actual chunks and doing a segment for each. This means all video files greater than 5MB in size will fail.

nst commented 9 years ago

Thank you for reporting that.

Could you please confirm that the method does now work as you expect?

garrettmurray commented 9 years ago

@nst Thanks for the quick work on this. I haven't had a chance to test it yet due to the fact that because of a test cycle, we had to fork and add some of this functionality ourselves, but we'll be transitioning back to your code for this process and I'll report back. Thanks!