Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morinokami/twitter-image-downloader
A python program for downloading images from twitter.
https://github.com/morinokami/twitter-image-downloader
Last synced: 2 days ago
JSON representation
A python program for downloading images from twitter.
- Host: GitHub
- URL: https://github.com/morinokami/twitter-image-downloader
- Owner: morinokami
- License: mit
- Created: 2015-10-18T14:45:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T06:48:09.000Z (about 2 years ago)
- Last Synced: 2024-12-23T12:06:30.280Z (5 days ago)
- Language: Python
- Size: 83 KB
- Stars: 122
- Watchers: 7
- Forks: 20
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CircleCI](https://circleci.com/gh/morinokami/twitter-image-downloader.svg?style=svg)](https://circleci.com/gh/morinokami/twitter-image-downloader)
## What it does
Download all images uploaded by a specified Twitter user.
## What you need
- Python 3 (>= 3.7)
## Setup
First, you need to install `twitter-image-dl`:
```sh
$ pip install twitter-image-dl
```Next, you need to generate your api key and api secret key.
If you don't have them, go to [Twitter Developers](https://dev.twitter.com/)
and create your application.
After you get your api key and api secret key, create a json file like this:```
{
"api_key": "your api key",
"api_secret": "your api secret key"
}
```## Usage
To download the images the user of id "foo" has uploaded, enter the command
like the following on the command line:```
$ twt_img foo -c confidentials.json
```where `confidentials.json` is the json file containing your api keys.
This command creates a directory called `foo` and save images to that
directory.If you want to save images to a directory other than `foo`, use `-d` or
`--dest` argument to specify the destination.You can specify which size of images to download using the optional argument
`-s` (or `--size`). There are five values you can specify:- `large`
- `medium`
- `small`
- `orig`
- `thumb`If you don't specify this value, images of `large` size will be downloaded
by default.Using the `--rts` flag, you can also download images contained in retweets.
Provide a number to the `-l` or `--limit` argument (e.g. `-l 25`) to limit how
many tweets are inspected for images (starting with the most recent). Note that
if you're using `--limit` without `--rts`, the number of tweets inspected can
be smaller than the specified limit.## Testing
Install dependencies for testing and run tests like this:
```sh
$ git clone [email protected]:morinokami/twitter-image-downloader.git
$ cd twitter-image-downloader
$ pipenv install --dev
$ pipenv run test
```