Download the PHP package detain/phlix-plugin-myanimelist without Composer
On this page you can find all versions of the php package detain/phlix-plugin-myanimelist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download detain/phlix-plugin-myanimelist
More information about detain/phlix-plugin-myanimelist
Files in detain/phlix-plugin-myanimelist
Package phlix-plugin-myanimelist
Short Description MyAnimeList metadata provider — anime titles, descriptions, episodes, ratings via the MAL API v2.
License MIT
Homepage https://github.com/detain/phlix-plugin-myanimelist
Informations about the package phlix-plugin-myanimelist
phlix-plugin-myanimelist
MyAnimeList metadata provider plugin for Phlix — anime titles, descriptions, episodes, ratings via the MyAnimeList API v2.
Overview
This plugin fetches structured anime metadata from MyAnimeList
using the official MAL API v2 (https://api.myanimelist.net/v2):
- Search (
GET /anime?q=...) — resolve a filename to a MAL anime ID - Details (
GET /anime/{id}?fields=...) — fetch titles, synopsis, episodes, rating, studio
Every request carries an X-MAL-CLIENT-ID header with your MAL client ID.
Features
- Title search — query MAL for the best-matching anime ID
- Full metadata — primary/English/Japanese titles, synonyms, genres, year, type, rating
- Episode info — episode count and average episode runtime
- Synopsis — long-form description text
- No SDK — plain HTTP/JSON over the PHP stream wrapper; no extra dependencies
Install
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:
- The server downloads and validates the manifest, runs
composer install --no-dev, and stores a row in thepluginstable. - Configure your MyAnimeList client ID in the plugin settings form.
- Enable the plugin.
Getting a MAL Client ID
- Sign in at myanimelist.net.
- Go to API → Create ID.
- Create an app and copy the Client ID (the Client Secret is not needed for read-only metadata).
Configuration
Configure these in the Phlix admin Plugins → Configure dialog.
| Setting | Type | Required | Default | Description |
|---|---|---|---|---|
client_id |
string (secret) | Yes | — | Your MyAnimeList API Client ID, sent as the X-MAL-CLIENT-ID header. |
use_ssl_verification |
boolean | No | true |
Verify TLS certificates when calling the MAL API. |
Where to get your Client ID
Create an API application at myanimelist.net/apiconfig
(App Type "web" or "other"), then copy its Client ID into client_id.
How It Works
When the MetadataManager calls lookup($filePath):
- Parse filename — extract anime title from file path (strips S##E##, group tags, resolution suffixes)
- Search —
GET /anime?q=<title>&limit=10and take the first result's ID - Fetch details —
GET /anime/{id}?fields=...for full anime data - Map response — translate the MAL JSON layout to MetadataManager's expected return shape
MAL API Notes
- Protocol: REST/JSON over HTTPS to
https://api.myanimelist.net/v2 - Auth: every request sends
X-MAL-CLIENT-ID: <client_id> - Search:
GET /anime?q=<query>&limit=10→{ "data": [ { "node": { "id", "title", ... } } ] } - Details:
GET /anime/{id}?fields=id,title,main_picture,alternative_titles,start_date,synopsis,mean,num_scoring_users,genres,num_episodes,media_type,status,studios,average_episode_duration,rating
See the MAL API v2 reference for full details.
Data Returned
A no-match returns [].
Fork as a Starter
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/MyanimelistMetadataProvider.phpwith your own implementation. - Run tests:
composer install && vendor/bin/phpunit.
Testing
The unit tests exercise the parse/map helpers via Reflection with fixture
JSON — no live network calls are made; the HTTP paths covered by
tests/Unit/MyanimelistTransportTest.php and
tests/Unit/MyanimelistMetadataProviderAdapterTest.php run through anonymous
\Workerman\Http\Client subclasses instead.
phpunit.xml declares a Cobertura report, so a run with a coverage driver also
writes coverage.xml; .github/workflows/test.yml runs the suite on PHP 8.3
and 8.4 and uploads that file to Codacy.
License
MIT — see LICENSE.
All versions of phlix-plugin-myanimelist with dependencies
detain/phlix-shared Version ^0.18.0
psr/container Version ^1.1 || ^2.0
psr/log Version ^1.0 || ^2.0 || ^3.0
workerman/http-client Version ^3.1