Skip to main content

Download tweet images and videos

Project description

[![Build Status](https://travis-ci.org/morinokami/twitter-image-downloader.svg?branch=master)](https://travis-ci.org/morinokami/twitter-image-downloader)

### About
With this program, you can download all images uploaded by a specific twitter user.

### Setup
First, before downloading images, you have to install dependencies using pip:
```
$ pip install -r requirements.txt
```
Of course, you need your api key and api secret as well. if you don't have them, consult [Twitter Developers](https://dev.twitter.com/) and create your application. After you get your api key and api secret, create a json file which should look like:
```
{
"api_key": "your api key",
"api_secret": "your api secret"
}
```

### Usage
To download the images the user of id "foo" has uploaded, enter the command below in the command line:
```
$ python3 twt_img.py foo dest_path -c confidentials.json
```
where ```dest_path``` is the directory where images will be downloaded, and ```confidentials.json``` is a json file containing your api key and api secret.

You can specify which size of images to download using the optional argument ```-s``` (or ```--size```). There are five values you can use for it: ```large```, ```medium```, ```small```, ```orig```, or ```thumb```. If you don't specify this value, images of large size will be downloaded by default.

Provide a number to the ```-l``` or ```--limit``` argument (e.g. ```-l 25```) to limit how many tweets are checked for images (starting with the most recent). Note that if you're using ```--limit``` but not ```--rts```, tweets may be checked in batches smaller than this limit.

Using the ```--rts``` flag, you can also download images contained in retweets.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page