# Flickr Download
## Introduction
[![pre-commit](https://github.com/beaufour/flickr-download/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/beaufour/flickr-download/actions/workflows/pre-commit.yml) [![test](https://github.com/beaufour/flickr-download/actions/workflows/test.yml/badge.svg)](https://github.com/beaufour/flickr-download/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/beaufour/flickr-download/badge.svg)](https://coveralls.io/github/beaufour/flickr-download)
Simple script to download a [Flickr](http://flickr.com) set.
To use it you need to get your own Flickr API key here:
<https://www.flickr.com/services/api/misc.api_keys.html>
flickr_download -k <api key> -s <api secret> -d <set id>
It can also list the public set ids for a given user:
flickr_download -k <api key> -s <api secret> -l <user name>
The user name can be passed in as a URL, email, or user name.
Get a public set using the title and id to name the downloaded files:
flickr_download -k <api key> -s <api secret> -d <set id> -n title_and_id
Download private or restricted photos by authorizing against the users account. (see below)
## Installation
To install this script use the Python pip utility bundled with your Python distribution:
> pip install flickr_download
## API key
Get your [Flickr API key](http://www.flickr.com/services/api/).
You can also set your API key and secret in `~/.flickr_download`:
api_key: my_key
api_secret: my_secret
## User Authentication Support
The script also allows you to authenticate as a user account. That way you can download sets that
are private and public photos that are restricted. To use this mode, initialize the authorization by
running the script with the `t` parameter to authorize the app.
flickr_download -k <api key> -s <api secret> -t
This will save `~/.flickr_token` containing the authorization. Subsequent calls with `-t` will use the
stored token. For example using
flickr_download -k <api key> -s <api secret> -l <USER>
with _USER_ set to your own username, will only fetch your publicly available sets, whereas adding `-t`
flickr_download -k <api key> -s <api secret> -l <USER> -t
will fetch all your sets including private restricted sets.
Note, if you want to log in as another user delete `~/.flickr_token`.
## Downloading a lot of photos
If you are downloading a lot of photos, two parameters will speed things up. Especially on errors (which the Flickr API seems to like to throw regularly). Those parameters are:
* `--cache <cache_file>` – this will cache API responses in the given file, and will thus speed up repeated calls to the same API
* `--metadata_store` - this will store metadata information for the set downloads in `.metadata.db`, which makes it faster to skip already downloaded files.
So to download all the sets for a given user `XXX`, including private photos and sets, do:
> flickr_download.py -api_key KEY -api_secret SECRET --user_auth --cache api_cache --metadata_store --download_user XXX
## Optional arguments
-h, --help show this help message and exit
-k API_KEY, --api_key API_KEY
Flickr API key
-s API_SECRET, --api_secret API_SECRET
Flickr API secret
-t, --user_auth Enable user authentication
-l USER, --list USER List photosets for a user
-d SET_ID, --download SET_ID
Download the given set
-p USERNAME, --download_user_photos USERNAME
Download all photos for a given user
-u USERNAME, --download_user USERNAME
Download all sets for a given user
-i PHOTO_ID, --download_photo PHOTO_ID
Download one specific photo
-q SIZE_LABEL, --quality SIZE_LABEL
Quality of the picture. Examples: Original/Large/Medium/Small. By default the largest available is used.
-n NAMING_MODE, --naming NAMING_MODE
Photo naming mode. Use --list_naming to get a list of possible NAMING_MODEs
-m, --list_naming List naming modes
-o, --skip_download Skip the actual download of the photo
-j, --save_json Save photo info like description and tags, one .json file per photo
-c CACHE_FILE, --cache CACHE_FILE
Cache results in CACHE_FILE (speed things up on large downloads in particular)
--metadata_store Store information about downloads in a metadata file (helps with retrying downloads)
-v, --verbose Turns on verbose logging
--version Lists the version of the tool
Raw data
{
"_id": null,
"home_page": "https://github.com/beaufour/flickr-download",
"name": "flickr-download",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Allan Beaufour",
"author_email": "allan@beaufour.dk",
"download_url": "https://files.pythonhosted.org/packages/cc/c3/b244b8c75e80cef752cb25efa54b89a1207e50da94c0ead71a3ae7d52283/flickr_download-0.3.6.tar.gz",
"platform": null,
"description": "# Flickr Download\n\n## Introduction\n\n[![pre-commit](https://github.com/beaufour/flickr-download/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/beaufour/flickr-download/actions/workflows/pre-commit.yml) [![test](https://github.com/beaufour/flickr-download/actions/workflows/test.yml/badge.svg)](https://github.com/beaufour/flickr-download/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/beaufour/flickr-download/badge.svg)](https://coveralls.io/github/beaufour/flickr-download)\n\nSimple script to download a [Flickr](http://flickr.com) set.\n\nTo use it you need to get your own Flickr API key here:\n<https://www.flickr.com/services/api/misc.api_keys.html>\n\n flickr_download -k <api key> -s <api secret> -d <set id>\n\nIt can also list the public set ids for a given user:\n\n flickr_download -k <api key> -s <api secret> -l <user name>\n\nThe user name can be passed in as a URL, email, or user name.\n\nGet a public set using the title and id to name the downloaded files:\n\n flickr_download -k <api key> -s <api secret> -d <set id> -n title_and_id\n\nDownload private or restricted photos by authorizing against the users account. (see below)\n\n## Installation\n\nTo install this script use the Python pip utility bundled with your Python distribution:\n\n > pip install flickr_download\n\n## API key\n\nGet your [Flickr API key](http://www.flickr.com/services/api/).\n\nYou can also set your API key and secret in `~/.flickr_download`:\n\n api_key: my_key\n api_secret: my_secret\n\n## User Authentication Support\n\nThe script also allows you to authenticate as a user account. That way you can download sets that\nare private and public photos that are restricted. To use this mode, initialize the authorization by\nrunning the script with the `t` parameter to authorize the app.\n\n flickr_download -k <api key> -s <api secret> -t\n\nThis will save `~/.flickr_token` containing the authorization. Subsequent calls with `-t` will use the\nstored token. For example using\n\n flickr_download -k <api key> -s <api secret> -l <USER>\n\nwith _USER_ set to your own username, will only fetch your publicly available sets, whereas adding `-t`\n\n flickr_download -k <api key> -s <api secret> -l <USER> -t\n\nwill fetch all your sets including private restricted sets.\n\nNote, if you want to log in as another user delete `~/.flickr_token`.\n\n## Downloading a lot of photos\n\nIf you are downloading a lot of photos, two parameters will speed things up. Especially on errors (which the Flickr API seems to like to throw regularly). Those parameters are:\n\n* `--cache <cache_file>` \u2013 this will cache API responses in the given file, and will thus speed up repeated calls to the same API\n* `--metadata_store` - this will store metadata information for the set downloads in `.metadata.db`, which makes it faster to skip already downloaded files.\n\nSo to download all the sets for a given user `XXX`, including private photos and sets, do:\n\n > flickr_download.py -api_key KEY -api_secret SECRET --user_auth --cache api_cache --metadata_store --download_user XXX\n\n## Optional arguments\n\n -h, --help show this help message and exit\n -k API_KEY, --api_key API_KEY\n Flickr API key\n -s API_SECRET, --api_secret API_SECRET\n Flickr API secret\n -t, --user_auth Enable user authentication\n -l USER, --list USER List photosets for a user\n -d SET_ID, --download SET_ID\n Download the given set\n -p USERNAME, --download_user_photos USERNAME\n Download all photos for a given user\n -u USERNAME, --download_user USERNAME\n Download all sets for a given user\n -i PHOTO_ID, --download_photo PHOTO_ID\n Download one specific photo\n -q SIZE_LABEL, --quality SIZE_LABEL\n Quality of the picture. Examples: Original/Large/Medium/Small. By default the largest available is used.\n -n NAMING_MODE, --naming NAMING_MODE\n Photo naming mode. Use --list_naming to get a list of possible NAMING_MODEs\n -m, --list_naming List naming modes\n -o, --skip_download Skip the actual download of the photo\n -j, --save_json Save photo info like description and tags, one .json file per photo\n -c CACHE_FILE, --cache CACHE_FILE\n Cache results in CACHE_FILE (speed things up on large downloads in particular)\n --metadata_store Store information about downloads in a metadata file (helps with retrying downloads)\n -v, --verbose Turns on verbose logging\n --version Lists the version of the tool\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Download photos from Flickr",
"version": "0.3.6",
"project_urls": {
"Homepage": "https://github.com/beaufour/flickr-download",
"Repository": "https://github.com/beaufour/flickr-download"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b87870e031f32ad6f357460b98df8690bb505c7ef65c0b63d86fcf3e54ae0bd7",
"md5": "3df071a1b32cde589289bd869dde761b",
"sha256": "6d0acaeae9b681aed9841e0e49b1635af176bba385d449f5bbbcd6814691736c"
},
"downloads": -1,
"filename": "flickr_download-0.3.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3df071a1b32cde589289bd869dde761b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 15856,
"upload_time": "2023-09-09T13:05:44",
"upload_time_iso_8601": "2023-09-09T13:05:44.087835Z",
"url": "https://files.pythonhosted.org/packages/b8/78/70e031f32ad6f357460b98df8690bb505c7ef65c0b63d86fcf3e54ae0bd7/flickr_download-0.3.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ccc3b244b8c75e80cef752cb25efa54b89a1207e50da94c0ead71a3ae7d52283",
"md5": "d805059038905242eef5afa25da8de85",
"sha256": "e194b33c7238ff31d41773245a974292c0e4158388fe15c1f6ddd1b31d6b5da4"
},
"downloads": -1,
"filename": "flickr_download-0.3.6.tar.gz",
"has_sig": false,
"md5_digest": "d805059038905242eef5afa25da8de85",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 15719,
"upload_time": "2023-09-09T13:05:45",
"upload_time_iso_8601": "2023-09-09T13:05:45.081967Z",
"url": "https://files.pythonhosted.org/packages/cc/c3/b244b8c75e80cef752cb25efa54b89a1207e50da94c0ead71a3ae7d52283/flickr_download-0.3.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-09 13:05:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "beaufour",
"github_project": "flickr-download",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "flickr-download"
}