Skip to content

About

This project is a Python script to fetch and download media items and gallery content from the ParentZone API.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

Media Downloader

Why this exists

ParentZone holds your photos and videos, but offers no clear export path for your own data. I disagree with that — these are your family's memories, and without a way to get them out there's a real risk of losing them (for example if your account or the service goes away). This tool exists to let you download and keep your own copy.

This project is a Python command-line script to fetch and download media items and gallery content from the ParentZone API (parentzone.me).

Features

  • Fetch posts and gallery items from the API.
  • Download media files to a local directory.
  • Automatically handles API key retrieval from environment variables or a local file.
  • Updates the creation date on the downloaded files based on the metadata.

Download (no Python needed)

Pre-built, standalone executables are published automatically for Windows, macOS, and Linux on every release — you don't need Python installed to use them.

  1. Go to the Releases page.
  2. Download the zip for your operating system from the latest release:
    • release-media-downloader-windows-latest.zip — Windows
    • release-media-downloader-macos-latest.zip — macOS
    • release-media-downloader-ubuntu-latest.zip — Linux
  3. Unzip it. Inside you'll find the executable (media-downloader on macOS/Linux, media-downloader.exe on Windows).
  4. Run it. On first launch it will prompt you for your API key (see Extracting the API Key) and save it alongside the binary in config.ini. Media is downloaded into an out/ folder next to the executable.

macOS/Windows note: because these binaries aren't code-signed, the OS may warn that the app is from an unidentified developer. On macOS, right-click the binary → Open to allow it; on Windows, choose More info → Run anyway on the SmartScreen prompt.

If you'd rather run from source or build the binary yourself, see the sections below.

Requirements (for running from source)

  • Python 3.7 or higher
  • requests library (version 2.25.1 or higher)
  • python-dateutil library (version 2.9.0 or higher)

Setup (for Python users)

  1. Clone the Repository:

    git clone https://github.com/skycubeuk/media-downloader.git
    cd media-downloader
  2. Install Dependencies: Install the required Python libraries:

    pip install -r requirements.txt
  3. Set Up the API Key: Copy the example config and add your key:

    cp config.ini.example config.ini

    Then edit config.ini and set api_key. config.ini is gitignored so your key is never committed. If you don't create it, the script will prompt you for the key on first run and save it to config.ini.

    Alternatively, you can set the API_KEY environment variable (this takes precedence over config.ini):

    export API_KEY=your_api_key

    If you don't know how to extract the API key, refer to the Extracting the API Key section below.

Build a native executable (Windows, macOS, Linux)

You can package the script so it runs without installing Python by using the bundled PyInstaller helper. Run the build on the operating system you want to target:

python build.py

The resulting binary is placed in dist/ (e.g., dist/media-downloader).

Configuration

The script uses a config.ini file to store configuration settings, including the API key and directory paths. If the API key is not set in the environment or the config.ini file, the script will prompt you to enter it and save it automatically.

Example config.ini File

[Credentials]
api_key=your_api_key

[Paths]
log_dir=./log
out_dir=./out
  • [Credentials]: Stores the API key.
  • [Paths]: Specifies the directories for logs and output files.

Usage

Run the script using:

python main.py

The script will:

  1. Fetch posts and gallery items from the API.
  2. Download media files to the ./out directory.

You can override paths and the posts query without editing the source:

python main.py --out ./out --log ./log --query 'typeIDs[]=14&typeIDs[]=12' --api-key YOUR_KEY

Extracting the API Key

To extract the API key from the web application, follow these steps:

  1. Open the Web Application:

    • Navigate to the web application where the API is being used.
  2. Open Developer Tools:

    • Press F12 or Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (Mac) to open the browser's developer tools.
  3. Go to the Network Tab:

    • Click on the "Network" tab in the developer tools.
  4. Filter Requests:

    • Reload the page and look for network requests. Use the filter box to search for requests to the API endpoint (e.g., https://api.parentzone.me).
  5. Inspect Headers:

    • Click on one of the requests to the API. In the "Headers" section, look for the x-api-key header under "Request Headers".
  6. Copy the API Key:

    • Copy the value of the x-api-key header.
  7. Save the API Key:

    • Paste the API key into the config.ini file or set it as an environment variable.

License

This project is licensed under the MIT License.

About

This project is a Python script to fetch and download media items and gallery content from the ParentZone API.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages