AniDB metadata provider plugin for Phlix — anime titles, descriptions, episodes, ratings via UDP API and daily title dump.
This plugin fetches structured anime metadata from AniDB using:
- UDP API (
api.anidb.net:9000) — fetch anime details, descriptions, episodes - Daily title dump (
anime-titles.dat.gz) — fast offline title→AID lookups without hitting the API
- Title dump search — fast fuzzy-match search against all AniDB anime titles
- Full metadata — romaji/english/kanji titles, synonyms, genres, year, type, rating
- Description — fetch long descriptions via separate ANIMEDESC command
- Flood protection — 4-second rate limiting between API calls (per AniDB rules)
- Session management — keepalive pings every 30 min, auto-reconnect on 506 INVALID SESSION
- Episode info — planned (not yet implemented)
The plugin is unsigned by design. Install via the Phlix admin UI:
-
Log in to your Phlix server as an admin user (
users.is_admin = 1). -
Browse to
/admin/plugins. -
Paste this URL into the Install from URL form:
https://raw.githubusercontent.com/detain/phlix-plugin-anidb/main/plugin.json -
The server downloads and validates the manifest, runs
composer install --no-dev, and stores a row in thepluginstable. -
Configure your AniDB credentials in the plugin settings form:
- Username: your AniDB username
- API Password: your AniDB API password (from your AniDB profile, NOT your login password)
-
Enable the plugin.
| Setting | Type | Required | Default | Description |
|---|---|---|---|---|
username |
string | Yes | — | AniDB username |
api_key |
string (secret) | Yes | — | AniDB API password from profile |
use_title_dump |
boolean | No | true |
Use daily title dump for fast search |
title_dump_url |
string | No | AniDB official | URL to anime-titles.dat.gz |
The plugin registers an AnidbMetadataProviderAdapter with the host MetadataManager.
When the server needs anime metadata it calls the adapter's search() or
getDetails() methods (the adapter's lookup() method is also available for
file-path-based lookups):
- search(title) — resolve an anime title to an AID using the title dump or API fallback
- getDetails(aid) — fetch full anime metadata by AID
- lookup(filePath) — extract anime name from a file path and return metadata
Internal flow (when lookup() or getDetails() is called):
- Fetch details — send
ANIME aid=...for full anime data - Fetch description — send
ANIMEDESC aid=...for the full synopsis - Map response — translate AniDB field layout to MetadataManager's expected return shape
- Protocol: UDP (not HTTP) to
api.anidb.net:9000 - Flood protection: ≤ 0.5 packets/sec after first 5, minimum 4 seconds between packets
- Session: valid 35 minutes; keep alive with PING every ~30 minutes
- Flood ban: reusing the same local UDP port is critical to avoid IP-level bans
See the AniDB UDP API docs for full details.
[
'title' => 'Seikai no Monshou', // Primary romanized title
'original_name' => 'Crest of the Stars', // English official title (or kanji)
'overview' => 'A space opera...', // Description (fetched separately)
'year' => 1999, // First release year
'genres' => ['SciFi', 'Space'], // Category tags
'rating' => 8.53, // AniDB rating (0-10)
'vote_count' => 3225, // Number of votes
'poster_url' => 'https://api.anidb.net/images/1.jpg', // null if no picname
'fanart_url' => null, // Not provided by AniDB
'episodes' => 13, // Episode count (null if unknown)
'type' => 'tv', // Normalized type (tv, movie, ova, etc.)
'anidb_id' => 1, // AniDB AID
'titles' => ['Seikai no Monshou', 'Crest of the Stars', '星界の紋章'],
'status' => 'Finished', // Finished / Currently Airing / Upcoming
'runtime_ticks' => null, // Not provided by AniDB
'studio' => null, // AniDB uses categories instead
]This plugin is based on phlix-plugin-example. To create your own metadata provider:
- Fork or copy this repository.
- Edit
plugin.json— pick a newname(must start withphlix-plugin-), bumpversionto0.1.0, changeentryto your FQCN. - Edit
composer.json— rename the package, update PSR-4 autoload prefix. - Replace
src/AnidbMetadataProvider.phpwith your own implementation. - Run tests:
composer install && vendor/bin/phpunit.
composer install
vendor/bin/phpunit
vendor/bin/phpunit --testdox # verbose outputMIT — see LICENSE.