Mango's Music Library Handler

Authentication

🔐
Authentication Required
All POST API endpoints require an Authorization header with your API token.

GET API endpoints marked with the key & lock also require authentication.

Format: Authorization: Bearer YOUR_TOKEN

GET Endpoints

GET
/api/list
List all uploaded song filenames.
GET
/api/tasks/{task_id}
Check the status and results of a background task.
Path parameter: task_id
🔐 GET
/api/cookies/status
Get status and preview of cookies.txt file, including size and last modified date.
GET
/health
Health check endpoint to verify the API is running.

POST Endpoints

POST
/api/upload
Upload new songs from YouTube URLs.
Request JSON body:
{
  "urls": ["youtube_url1", "youtube_url2", ...],
  "custom_names": ["custom1", "custom2"]  (optional)
}
POST
/api/delete
Delete uploaded songs.
Request JSON body:
{
  "filenames": ["file1.ogg", "file2.ogg"]
}
POST
/api/song/replace
Replace a song with a new YouTube audio.
Request JSON body:
{
  "old_filename": "old.ogg",
  "new_url": "youtube_url",
  "custom_name": "optional_custom_name"
}
POST
/api/song/rename
Rename a song entry.
Request JSON body:
{
  "old_filename": "old.ogg",
  "new_filename": "new.ogg"
}
POST
/api/cookies/update
Update or overwrite cookies.txt used by yt-dlp.
Request JSON body:
{
  "cookies_content": "raw cookies.txt content here"
}
POST
/api/tasks/clear
Clear one or more task IDs.
Request JSON body (optional):
{
  "task_ids": ["id1", "id2"]
}
POST
/api/token/add
Add a new token to the system.
Request JSON body:
{
  "token": "your_new_token"
}
POST
/api/token/remove
Remove a token from the system.
Request JSON body:
{
  "token": "token_to_remove"
}