Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sample Python code for uploading video up to 140 seconds and/or up to 512Mb.

License

NotificationsYou must be signed in to change notification settings

xdevplatform/large-video-upload-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Python sample demonstrates the following process of uploading large media (video / GIF / image) files asynchronously with the Twitter API, via the "chunked upload" method.

  1. INIT media upload.
  2. APPEND chunked data.
  3. FINALIZE media uploaded.
  4. CheckSTATUS of media processing.
  5. Tweet with attached media.

Large video files are longer than 30 seconds / up to 140 seconds, and/or a file size larger than 15 megabytes up to 512 megabytes.

Learn more about the Twitter Media APIs. Pay attention to the other requirements such as encoding, frame size and video formats supported, as these may be reasons for uploads failing at the processing stage.

Running the sample

  1. Install requirements:

    $ pipenv shell$ pipenv install
  2. Fill in yourconsumer keys and access tokens inasync-upload.py:

    CONSUMER_KEY = 'your-consumer-key'CONSUMER_SECRET = 'your-consumer-secret'ACCESS_TOKEN = 'your-access-token'ACCESS_TOKEN_SECRET = 'your-access-secret'
  3. Edit path to your media file inasync-upload.py:

VIDEO_FILENAME = 'path/to/video/file'
  1. Run script:

    $ python async-upload.py

Questions? Check ourdeveloper discussion forums.

About

Sample Python code for uploading video up to 140 seconds and/or up to 512Mb.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp