Skip to content

pixelstuermer/pixieset-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixieset downloader pixieset downloader python v3.9
badge badge
pixieset downloader pixieset downloader

works on my machine

pixieset-downloader

Batch download of Pixieset collections.
See GitHub pages or GitHub project.

TL;DR

Download the latest release and install Python 3.9.6, then switch to the root directory and run pip install -r requirements.txt. Find out the required arguments base_url, collection_id, collection_key, gallery_name and obtain a valid HTTP session cookie. The optional arguments --filename, --separator and --regex can specify the images to download and the target file names.

Then run the following:

python pixieset-downloader.py [-f FILENAME] [-s SEPARATOR] [-r REGEX] base_url collection_id collection_key gallery_name cookie

Or run the following for CLI usage help:

python pixieset-downloader.py -h

About

Python script to download all found images of a Pixieset collection. The mandatory arguments for the Pixieset API requests must unfortunately be found out via the browser developer tools when a collection website is accessed. The script can filter the images to be downloaded via a user-given RegEx, and it stores the images according to a user-defined naming scheme.

Requirements

Built with/for Python 3.9.6. The required packages can be easily installed by running pip install -r requirements.txt before executing the script.

Required Arguments Paper Chase

Accessing the protected Pixieset API to get the page/overview data requires some research at first:

  1. Visit the collection with your browser and log in (if the collection is private)

  2. After the gallery view has loaded, open the developer tools of your browser

  3. Depending on your browser, the PHPSESSID HTTP session cookie can be found at the "storage" or "application" panel

  4. The other required data can be found at the "network" tab (a refresh of the page might be required to see the requests): The Pixieset client fires a loadphotos request, which must further be inspected

    • The base_url is the URL from the beginning up to where the query parameters start

    • The cuk query parameter serves as the collection_key argument

    • The cid query parameter serves as the collection_id argument

    • The gs query parameter serves as the gallery_name argument

The following loadphotos request example shows the mapping between the query parameters and the script arguments again:

https://josevilla.pixieset.com/client/loadphotos/?cuk=lilyandjonathan&cid=3301757&gs=highlights&fk=&page=1

base_url = URL = https://josevilla.pixieset.com/client/loadphotos
collection_key = cuk = lilyandjonathan
collection_id = cid = 3301757
gallery_name = gs = highlights

How To Use

When the required arguments have been found out, the script is pretty straight forward to use. It at least requires the following mandatory arguments:

  • base_url: The URL where the original Pixieset client makes its requests to, also required for the script to load the page/overview data

  • collection_id: The technical identifier of the collection

  • collection_key: The human-readable name (slug) of the collection

  • gallery_name: Collections can have multiple galleries, this argument specifies from which gallery to get the images from

  • cookie: After logging in via a browser first, the cookie ensures that the protected endpoints can be requested by the script as well

With the following optional arguments, the images can be filtered and the target file names can be adjusted:

  • -f or --filename: The file naming scheme (if not given, the original cryptic Pixieset name is used)

  • -s or --separator: The counter separator to use when a custom file naming scheme is specified (if not given _ is used as the default)

  • -r or --regex: The RegEx filter to specify which images to download (if not given .* is used and all found images are downloaded)

It is recommended to surround at least the RegEx argument with apostrophes: "{complex-regex}".

Example

The following example accesses the publicly available example collection of Pixieset named lilyandjonathan. The ID 3301757 can be found out when browsing the example collection and using the browser’s developer tools. The same applies to the given HTTP session cookie, which is not revealed in the example below. It downloads all images of the highlights gallery having xxlarge in their name. It then saves them with the naming scheme example and uses - as the counter separator.

python pixieset-downloader.py https://josevilla.pixieset.com/client/loadphotos 3301757 lilyandjonathan highlights {cookie} -r ".*xxlarge.*" -f "example" -s "-"

Limitations

The downloaded images might still be watermarked and are maybe with lower quality than the originals – which is good to support your local photographers! It is also not guaranteed that absolutely all images have been downloaded, so this should be verified manually.

Changelog

Unreleased (XXXX-XX-XX)

Added

Changed

Fixed

1.0.2 (2021-11-23)

Fixed

  • Enabled HTTP requests by using none as user-agent header

1.0.1 (2021-08-14)

Added

  • Readme and automated GitHub pages

Fixed

  • Minor typos

1.0.0 (2021-08-14)

Added

  • Basic functionality and project setup

  • Batch download of Pixieset collections

    • Based on a base url, a collection ID and key, a gallery name and a valid HTTP cookie

    • With the possibility to specify target file names and a counter separator

    • With an optional filter for image names via RegEx