turn into working cli tool
[video-tweet.git] / README.md
CommitLineData
d3ac7c48
IK
1Original repo: https://github.com/twitterdev/large-video-upload-python
2Changes here are meant to be rebased.
3
8d43f6fe 4# Large Media Upload
97f85f28 5
8d43f6fe 6This Python sample demonstrates the following process of uploading large media (video / GIF / image) files asynchronously with the Twitter API, via the "chunked upload" method.
97f85f28 7
81. **INIT** media upload.
92. **APPEND** chunked data.
103. **FINALIZE** media uploaded.
8d43f6fe
AP
114. Check **STATUS** of media processing.
125. Tweet with attached media.
97f85f28 13
8d43f6fe 14Large video files are longer than 30 seconds / up to 140 seconds, and/or a file size larger than 15 megabytes up to 512 megabytes.
97f85f28 15
8d43f6fe 16[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.
97f85f28 17
18## Running the sample
19
201. Install requirements:
21
22 ```
8d43f6fe
AP
23 $ pipenv shell
24 $ pipenv install
97f85f28 25 ```
26
8d43f6fe 272. Fill in your [consumer keys and access tokens](https://developer.twitter.com/en/apps) in `async-upload.py`:
97f85f28 28
29 ```
30 CONSUMER_KEY = 'your-consumer-key'
31 CONSUMER_SECRET = 'your-consumer-secret'
32 ACCESS_TOKEN = 'your-access-token'
33 ACCESS_TOKEN_SECRET = 'your-access-secret'
34 ```
35
8d43f6fe 363. Edit path to your media file in `async-upload.py`:
03695c65
AP
37
38 ```
39 VIDEO_FILENAME = 'path/to/video/file'
40 ```
41
424. Run script:
97f85f28 43
44 ```
45 $ python async-upload.py
03695c65
AP
46 ```
47
48Questions? Check our [developer discussion forums](https://https://twittercommunity.com/c/media-apis).