Downloading trending flickr-pictures

Apr 3, 2016, tags: python, programming, and photography

flickr-downloader is a small script I wrote to easily fetch the latest trending flickr-pictures (and set as desktop-background).

It’s a commandline-tool taking optional argumnts specifying minimum dimensions and ratio. It requires a flickr-api-key which you check out from your flickr settings-page.

For example,

./ -r --min-size 1280x720 --ratios 1.7-1.8 --post-step feh-bg -v 

finds trending pictures with minimum dimensions 1280x720 and uses feh to set as background.

All options:

? ./ -h
usage: [-h] [-k APIKEY] [-p PATH] [-c COUNT] [-r]
                            [-m MIN_SIZE] [-q RATIOS] [-t THREADS] [-v]
                            [-e {feh-bg}]

Download interesting-pictures from flickr. Reads flickr-apikey from env-var
APIKEY_FLICKR or optional --apikey-flag.

optional arguments:
  -h, --help            show this help message and exit
  -k APIKEY, --apikey APIKEY
                        API-key for flickr
  -p PATH, --path PATH  Path to download photos to
  -c COUNT, --count COUNT
                        Download this many pictures.
  -r, --random          Randomly pick interesting photos
  -m MIN_SIZE, --min-size MIN_SIZE
                        Minimum dimensions of sought photos. Example:
  -q RATIOS, --ratios RATIOS
                        Look for picture-ratios in this range.
  -t THREADS, --threads THREADS
                        Number of green threads used for downloading.
  -v, --verbose         Verbose output
  -e {feh-bg}, --post-step {feh-bg}
                        feh-bg : Set desktop-background using feh.

Check it out on github.