mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-11 04:02:41 +02:00
Overhaul the Docsify documentation (English + Russian) so it matches the current codebase and follows one consistent pattern. Content accuracy (post-migration): - Rewrite development/autoloader.md to PSR-4 / Composer (the old XC_Autoloader scanner, igbinary tmp/cache/autoload_map and registerDirectories are gone). - PascalCase every source path (src/core -> src/Core, domain/Stream, cli/Commands, public/Controllers, Infrastructure/Redis, ...) across all docs. - Replace the removed autoload.php references with vendor/autoload.php (build_system, bootstrap-contexts, error-handling, modules). - ssl-generation: note that the installer now auto-generates a unique self-signed certificate before Nginx starts. Common pattern (Clean & uniform): - Strip emoji from headings; remove the in-page Navigation blocks (the Docsify sidebar already provides navigation). - One H1 + intro per doc; uniform "Related files" / "Связанные файлы" section, added to the code-centric docs that lacked it. Structure: - Remove the empty stray docs/api/; move updates_checklist.md into builds/; link the previously-orphaned ucs-integration.md. - Regroup the sidebars (split the oversized guides group into Developer Guides / Security & Access / Integrations; fold builds into Build & Release). Augment: - dev-workflow: Local Setup (make dev-tools) + Quality Checks (phpstan, cs, gates). - build_system: Composer Dependencies section (committed prod-only vendor, committed lock, dev tools via composer install, no build-time vendor step). en/ru parity: - Apply the same structure, fixes and pattern to docs/ru/ (translated), including a new Russian ucs-integration.md. The en and ru file sets are now identical.
4.1 KiB
4.1 KiB
Get Playlist
This API provides authentication and playlist generation features for XC_VM. Clients can authenticate using a username/password or token, after which a personalized playlist is generated.
File Location
The playlist API is handled by PlaylistApiController:
src/Public/Controllers/Api/PlaylistApiController.php
Authentication
The API requires authentication either via username and password or via token. This ensures secure access to the content.
Base URL
http://<your-domain>:80/playlist
Endpoints
1. Authentication and Playlist Generation
Method & Endpoint:
GET /
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | Yes* | Username for authentication (required if token is not used). |
| password | string | Yes* | Password for authentication (required if token is not used). |
| token | string | Yes* | Authentication token (required if username and password are not used). |
| type | string | No | Device type (default: m3u_plus). |
| key | string | No | Content type (live — live TV, movies — movies, radio_streams — radio, series — TV shows). |
| output | string | No | Output format (hls or m3u). |
| nocache | boolean | No | If true, disables caching. |
💡 Yes — one option is required: either username/password or token.
Example Requests:
curl -X GET "http://<your-domain>:80/playlist/username/password/type&output=hls&key=live"
curl -X GET "http://<your-domain>:80/playlist/token/type&output=hls&key=live"
Response:
- Playlist file in the requested format (M3U or HLS).
Error Codes
If an error occurs, the API returns the corresponding error codes for easier troubleshooting.
| Error Code | Description |
|---|---|
| NO_CREDENTIALS | Missing authentication data. |
| INVALID_CREDENTIALS | Invalid username, password, or token. |
| BLOCKED_USER_AGENT | User agent is blocked. |
| EXPIRED | Account has expired. |
| DEVICE_NOT_ALLOWED | Device type is not allowed. |
| BANNED | User is banned. |
| DISABLED | Account is disabled. |
| EMPTY_USER_AGENT | User agent is required but missing. |
| NOT_IN_ALLOWED_IPS | IP address is not allowed. |
| NOT_IN_ALLOWED_COUNTRY | Country is not allowed. |
| NOT_IN_ALLOWED_UAS | User agent is not allowed. |
| ISP_BLOCKED | ISP is blocked. |
| ASN_BLOCKED | ASN restriction applied. |
| DOWNLOAD_LIMIT_REACHED | Too many requests. |
| GENERATE_PLAYLIST_FAILED | Failed to generate playlist. |
⚠️ Tip: Check server logs for more details if errors occur.
Notes
- Query Parameters: Make sure all parameters are provided correctly to avoid authentication errors.
- Restrictions: The API applies filters by user agent, IP address, and country to enhance security.
- Rate Limiting: Request limits are enforced to prevent server overload.
- Recommendations: Use tools like cURL or Postman for testing. In production, integrate this API into your application for automated playlist generation.
💬 If you have integration questions, open an issue in the repository.