X-Git-Url: https://vcs.fsf.org/?p=video-tweet.git;a=blobdiff_plain;f=README.md;h=1e3c03545ea05817e912d226cdde3802a014ccf8;hp=7bae6154b84ac38e225e82780d2d3e7ecd7c2317;hb=HEAD;hpb=7b285c008030ac4218e1408b39d3a09ae136fa61 diff --git a/README.md b/README.md index 7bae615..1e3c035 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,30 @@ -# Large Video Upload +Original repo: https://github.com/twitterdev/large-video-upload-python +Changes here are meant to be rebased. -This python sample demonstrates the following process of uploading large video files asynchronously with the Twitter API. +# Large Media Upload + +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. Check **STATUS** of video processing. -5. Tweeting with attached video. - -Large video files are longer than 30 second up to 140 seconds and/or a file size larger than 15 megabytes up to 512 megabytes. +4. Check **STATUS** 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](https://developer.twitter.com/en/docs/media/upload-media/overview) 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: ``` - $ pip install requirements.txt + $ pipenv shell + $ pipenv install ``` -2. Fill in your consumer keys and access tokens in `async-upload.py`: +2. Fill in your [consumer keys and access tokens](https://developer.twitter.com/en/apps) in `async-upload.py`: ``` CONSUMER_KEY = 'your-consumer-key' @@ -29,8 +33,16 @@ Large video files are longer than 30 second up to 140 seconds and/or a file size ACCESS_TOKEN_SECRET = 'your-access-secret' ``` -3. Run script: +3. Edit path to your media file in `async-upload.py`: + + ``` + VIDEO_FILENAME = 'path/to/video/file' + ``` + +4. Run script: ``` $ python async-upload.py - ``` \ No newline at end of file + ``` + +Questions? Check our [developer discussion forums](https://https://twittercommunity.com/c/media-apis).