2019-10-24 03:27:36 +00:00
|
|
|
# Download twitter resources
|
|
|
|
|
|
|
|
Download tweet images and videos. Run threads which has a event loop to download resources asynchronously.
|
|
|
|
|
|
|
|
```
|
|
|
|
pip3 install twitter-dl
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
usage: twitter-dl [-h] [-c CONFIDENTIAL]
|
|
|
|
[-s {large,medium,small,thumb,orig}]
|
2019-10-24 08:34:12 +00:00
|
|
|
[--video] [--nophoto]
|
2019-10-24 03:27:36 +00:00
|
|
|
[-l LIMIT] [--rts]
|
|
|
|
[--thread-number THREAD_NUMBER]
|
|
|
|
[--coro-number CORO_NUMBER]
|
|
|
|
[--since SID]
|
2019-11-03 11:30:48 +00:00
|
|
|
[--tweet] [--list] [--file]
|
2019-10-24 03:27:36 +00:00
|
|
|
resource_id dest
|
|
|
|
|
2019-10-24 08:34:12 +00:00
|
|
|
Download all images and/or videos uploaded by a twitter user you specify
|
2019-10-24 03:27:36 +00:00
|
|
|
|
|
|
|
positional arguments:
|
2019-11-04 01:16:23 +00:00
|
|
|
resource_id An ID of a twitter user. Also accept user id files, list or
|
2019-10-24 03:27:36 +00:00
|
|
|
tweet id.
|
2019-11-04 01:16:23 +00:00
|
|
|
dest Specify where to put images/videos
|
2019-10-24 03:27:36 +00:00
|
|
|
|
|
|
|
optional arguments:
|
|
|
|
-h, --help show this help message and exit
|
|
|
|
-c CONFIDENTIAL, --confidential CONFIDENTIAL
|
2019-11-04 01:16:23 +00:00
|
|
|
a json file containing (a key and a secret) or bearer_token
|
2019-10-24 03:27:36 +00:00
|
|
|
-s {large,medium,small,thumb,orig}, --size {large,medium,small,thumb,orig}
|
|
|
|
specify the size of images
|
2019-10-24 08:34:12 +00:00
|
|
|
--tweet indicate resource_id is a numbered tweet id
|
|
|
|
--list indicate resource_id is a list (user:slug)
|
2019-11-03 11:30:48 +00:00
|
|
|
--file indicate resource_id is a username file(each in a line)
|
2019-10-24 03:27:36 +00:00
|
|
|
--video include video
|
|
|
|
--nophoto exclude photo
|
|
|
|
-l LIMIT, --limit LIMIT
|
2019-10-24 08:34:12 +00:00
|
|
|
the maximum number of tweets to check (most recent first)
|
2019-10-24 03:27:36 +00:00
|
|
|
--rts save images contained in retweets
|
2019-10-24 08:34:12 +00:00
|
|
|
--thread-number THREAD_NUMBER
|
|
|
|
--coro-number CORO_NUMBER
|
|
|
|
--since SID
|
2019-11-14 09:26:24 +00:00
|
|
|
--subdir used with --file to save media to different dirs for each user
|
2019-10-24 03:27:36 +00:00
|
|
|
```
|
2019-11-04 01:16:23 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
Examples:
|
|
|
|
twitter-dl --tweet 1191067520033337345 pv
|
|
|
|
twitter-dl --rts -l 10 --video ladygaga pv
|
|
|
|
twitter-dl --rts -l 10 --video --nophoto --list YouTube:hey-fam pv
|
|
|
|
twitter-dl --rts -l 10 --video --file idfiles.txt pv
|
|
|
|
```
|