If you find this project helpful, consider supporting me with a small donation.
JW Player API Downloader is a Python command-line tool for downloading audio and video content from JW Player sites using the JW Player API. This tool enables bulk downloading of media files with metadata preservation, progress tracking, and flexible format selection.
Key Features:
- Download audio-only files (.m4a format)
- Download video files (.mp4 format)
- Download both audio and video simultaneously
- Bulk download all media from a JW Player site
- Metadata export with source information
- Progress tracking and file size display
- Automatic filename sanitization
- Skip existing files option
- Comprehensive logging
- Python 3.6+ - Required for running the application
- JW Player API credentials - API Secret and Site ID from your JW Player dashboard
- Internet connection - Required for API calls and media downloads
- Operating System: Windows, macOS, or Linux
- RAM: Minimum 512MB available
- Storage: Sufficient space for downloaded media files
- Network: Stable internet connection for API requests
It's highly recommended to install this script in a virtual environment to avoid dependency conflicts:
# Clone the repository
git clone https://github.com/PeerHoffmann/jw_player_api_downloader.git
cd jw_player_api_downloader
# Create virtual environment
python3 -m venv jwplayer-downloader-env
# Activate virtual environment
source jwplayer-downloader-env/bin/activate
# Install dependencies
pip install requests# Clone the repository
git clone https://github.com/PeerHoffmann/jw_player_api_downloader.git
cd jw_player_api_downloader
# Create virtual environment
python -m venv jwplayer-downloader-env
# Activate virtual environment
jwplayer-downloader-env\Scripts\activate
# Install dependencies
pip install requests# Always activate the virtual environment before using the script
source jwplayer-downloader-env/bin/activate # Linux/macOS
# or
jwplayer-downloader-env\Scripts\activate # Windows
# Run the script
python jw_player_api_downloader.py --help
# When done, deactivate the virtual environment
deactivate# Create directory and download just the script file
mkdir jw_player_api_downloader
cd jw_player_api_downloader
# Download the script directly from GitHub
wget https://raw.githubusercontent.com/PeerHoffmann/jw_player_api_downloader/main/jw_player_api_downloader.py
# Install dependencies (consider using virtual environment)
pip install requests# Clone repository
git clone https://github.com/PeerHoffmann/jw_player_api_downloader.git
cd jw_player_api_downloader
# Install dependencies system-wide
pip install requestsTest the installation:
python jw_player_api_downloader.py --helpCreate a .env file or set environment variables:
# Required API credentials
export JW_API_SECRET="enter_your_api_key_here"
export JW_SITE_ID="enter_your_site_id_here"
# Optional settings
export JW_DOWNLOAD_DIR="./downloads"JW_API_SECRET=enter_your_api_key_here
JW_SITE_ID=enter_your_site_id_here
JW_DOWNLOAD_DIR=./downloads- Log into your JW Player dashboard
- Navigate to Account > API Credentials
- Copy your API Secret
- Navigate to Content > Sites
- Copy your Site ID from the URL or site settings
python jw_player_api_downloader.py --api-secret YOUR_API_SECRET --site-id YOUR_SITE_IDpython jw_player_api_downloader.py --api-secret YOUR_API_SECRET --site-id YOUR_SITE_ID --type videopython jw_player_api_downloader.py --api-secret YOUR_API_SECRET --site-id YOUR_SITE_ID --type bothpython jw_player_api_downloader.py --download-dir /path/to/downloads --type audiopython jw_player_api_downloader.py --export-metadatapython jw_player_api_downloader.py --skip-existing false| Option | Description | Default |
|---|---|---|
--api-secret |
JW Player API Secret | From JW_API_SECRET env var |
--site-id |
JW Player Site ID | From JW_SITE_ID env var |
--download-dir |
Download directory path | ./downloads |
--type |
Download type: audio, video, both | audio |
--skip-existing |
Skip existing files | true |
--export-metadata |
Export metadata only | false |
- Audio files:
{MEDIA_ID}_audio.m4a - Video files:
{MEDIA_ID}_{QUALITY}.mp4 - Metadata:
media_mapping.json - Extended metadata:
metadata_with_sources.json - Logs:
jwplayer_download.log
Common Issues:
- Authentication Error: Verify API Secret and Site ID are correct
- Rate Limiting: Tool includes automatic rate limiting (0.1-0.5s delays)
- Network Timeouts: Check internet connection stability
- Insufficient Storage: Ensure adequate disk space for downloads
- Permission Errors: Check write permissions for download directory
- Virtual Environment Issues: Ensure virtual environment is activated before running
Debug Mode:
Check jwplayer_download.log for detailed error information.
- Python - Programming language runtime | GitHub | Docs
- Requests - HTTP library for API calls | GitHub | Docs
- argparse - Command-line argument parsing
- logging - Logging framework
- pathlib - File path operations
- urllib.parse - URL parsing utilities
- json - JSON data handling
- time - Time-related functions
- os - Operating system interface
- JW Player Management API v2 - Media listing and metadata
- JW Player Delivery API v2 - Media source URLs
- Fork the repository
- Create a virtual environment (recommended)
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Follow PEP 8 style guidelines
- Include docstrings for all functions
- Add logging for important operations
- Handle errors gracefully
- Maintain backward compatibility
- Update documentation for any new features
- Add tests if applicable
- Ensure all existing functionality works
- Update CHANGELOG.md with changes
If you find this project helpful, consider supporting me with a small donation.
More information about me and my projects can be found at https://www.peer-hoffmann.de.
If you need support with search engine optimization for your website, online shop, or international project, feel free to contact me at https://www.om96.de.