A Plex Metadata Provider for ThePornDB, compatible with Plex Media Server 1.43+.
This solution uses the new Plex Metadata Provider API to fetch metadata directly from ThePornDB when Plex scans your library.
Plex Media Server <--> TPDB Provider (FastAPI) <--> ThePornDB API
:32400 :32500 api.theporndb.net
- Plex Media Server 1.43 or later
- Docker (recommended) or Python 3.11+
- ThePornDB API key
Get your API key from: https://theporndb.net (create account > API settings)
Using Docker Compose (recommended):
# Clone the repository
git clone https://github.com/mystrock/plex-tpdb-scanner.git
cd plex-tpdb-scanner
# Set your API key
export TPDB_API_KEY=your_api_key_here
# Start the provider
docker-compose up -dUsing the pre-built image:
docker run -d \
--name tpdb-provider \
-p 32500:32500 \
-e TPDB_API_KEY=your_api_key_here \
ghcr.io/mystrock/plex-tpdb-scanner:latestRunning directly with Python:
pip install -r requirements.txt
export TPDB_API_KEY=your_api_key_here
python -m uvicorn provider.main:app --host 0.0.0.0 --port 32500- Open Plex Web App
- Go to Settings > Agents (under Manage)
- Click Add Custom Provider
- Enter the provider URL:
http://<your-server-ip>:32500 - Click Add Provider
- Go to Settings > Libraries
- Create a new library or edit an existing one
- In Advanced settings:
- Enable ThePornDB as a metadata source
- Drag it to the top of the list if you want it as the primary source
- Scan your library
The provider uses environment variables for configuration:
| Variable | Default | Description |
|---|---|---|
TPDB_API_KEY |
(required) | Your ThePornDB API key |
TPDB_PORT |
32500 |
Port the provider listens on |
TPDB_LOG_LEVEL |
INFO |
Logging level (DEBUG, INFO, WARNING, ERROR) |
When Plex scans your library, it sends the filename/title to the provider. The provider:
- Searches ThePornDB for matching scenes
- Returns potential matches with scores
- When Plex selects a match, fetches full metadata including:
- Title, release date, summary
- Poster and fanart images
- Studio name
- Performers with photos
- Tags/genres
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Provider manifest |
/library/metadata/matches |
POST | Search for matching scenes |
/library/metadata/{id} |
GET | Get full metadata for a scene |
Test the provider is running:
# Check manifest
curl http://localhost:32500/
# Test search
curl -X POST http://localhost:32500/library/metadata/matches \
-H "Content-Type: application/json" \
-d '{"type":1,"title":"scene title here"}'- Verify the provider is running:
curl http://localhost:32500/ - Check the provider URL is accessible from your Plex server
- Restart Plex Media Server after adding the provider
- Verify your API key is correct
- Check provider logs for errors:
docker logs tpdb-provider - Try searching for the scene manually on theporndb.net
- Check that the provider is selected in your library's advanced settings
- Try "Refresh Metadata" on a specific item
- Check provider logs for API errors
# Install dependencies
pip install -r requirements.txt
# Run in development mode with auto-reload
uvicorn provider.main:app --reload --port 32500
# Run with debug logging
TPDB_LOG_LEVEL=DEBUG uvicorn provider.main:app --port 32500MIT License