Add chunked video upload functionality #396

Merged
karambir merged 1 commit from upload-video-endpoint into master 2015-10-06 12:29:51 -07:00
karambir commented 2015-09-24 05:42:32 -07:00 (Migrated from github.com)

This is a simple implementation of twitter's chunked media upload api. Following points need to be noted:

  • I have added a separate endpoint for this instead of using the upload_media.
  • It needs a media_type as required by twitter. Though in my own project, I am using python mimetypes module.
  • It uses .seek to calculate size of media file if not given.
  • As twitter have a limit of 5mb per chunk upload, I am uploading in 1mb chunks. I had to use StringIO as helpers._transparent_params is checking for read attribute on file contents.

Please let me know what you guys think.

This is a simple implementation of twitter's [chunked media upload api](https://dev.twitter.com/rest/public/uploading-media#chunkedupload). Following points need to be noted: - I have added a separate endpoint for this instead of using the `upload_media`. - It needs a media_type as required by twitter. Though in my own project, I am using python mimetypes module. - It uses `.seek` to calculate size of media file if not given. - As twitter have a limit of 5mb per chunk upload, I am uploading in 1mb chunks. I had to use `StringIO` as `helpers._transparent_params` is checking for `read` attribute on file contents. Please let me know what you guys think.
karambir commented 2015-09-24 05:46:17 -07:00 (Migrated from github.com)

I also had to change something in api.py as twitter returns 204 No Content for append calls

I also had to change something in `api.py` as twitter returns 204 No Content for append calls
michaelhelmick commented 2015-10-06 12:29:43 -07:00 (Migrated from github.com)

This look good, thanks!

This look good, thanks!
djedi commented 2015-12-02 10:37:55 -08:00 (Migrated from github.com)

When will this update be on PyPI?

When will this update be on PyPI?
michaelhelmick commented 2016-01-03 04:57:36 -08:00 (Migrated from github.com)

@djedi Sorry, been a bit busy. I'll do a release this week!

@djedi Sorry, been a bit busy. I'll do a release this week!
karambir commented 2016-01-14 12:10:33 -08:00 (Migrated from github.com)

👍

:+1:
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#396
No description provided.