@@ -35,6 +35,7 @@ This document describes the available endpoints and their usage. All endpoints r
3535 - [ POST /api/tasks/inspect] ( #post-apitasksinspect )
3636 - [ POST /api/tasks/{id}/mark] ( #post-apitasksidmark )
3737 - [ DELETE /api/tasks/{id}/mark] ( #delete-apitasksidmark )
38+ - [ POST /api/tasks/{id}/metadata] ( #post-apitasksidmetadata )
3839 - [ GET /api/task\_ definitions/] ( #get-apitask_definitions )
3940 - [ GET /api/task\_ definitions/{identifier}] ( #get-apitask_definitionsidentifier )
4041 - [ POST /api/task\_ definitions/] ( #post-apitask_definitions )
658659
659660---
660661
662+ ### POST /api/tasks/{id}/metadata
663+ ** Purpose** : Generate metadata files for a scheduled task, including NFO files, thumbnails, and JSON metadata compatible with media centers.
664+
665+ ** Path Parameter** :
666+ - ` id ` : Task ID.
667+
668+ ** Response** :
669+ ``` json
670+ {
671+ "id" : " channel_or_playlist_id" ,
672+ "id_type" : " youtube|twitch|..." ,
673+ "title" : " Channel/Playlist Title" ,
674+ "description" : " Description text..." ,
675+ "uploader" : " Uploader name" ,
676+ "tags" : [" tag1" , " tag2" ],
677+ "year" : 2024 ,
678+ "json_file" : " path/to/Title [id].info.json" ,
679+ "nfo_file" : " path/to/tvshow.nfo" ,
680+ "thumbnails" : {
681+ "poster" : " path/to/poster.jpg" ,
682+ "fanart" : " path/to/fanart.jpg" ,
683+ "thumb" : " path/to/thumb.jpg" ,
684+ "banner" : " path/to/banner.jpg" ,
685+ "icon" : " path/to/icon.jpg" ,
686+ "landscape" : " path/to/landscape.jpg"
687+ }
688+ }
689+ ```
690+ or
691+ ``` json
692+ { "error" : " ..." }
693+ ```
694+
695+ ** Files Generated** :
696+ - ` tvshow.nfo ` - NFO file for media center compatibility (Kodi, Jellyfin, Emby, etc.)
697+ - ` Title [id].info.json ` - yt-dlp metadata file.
698+ - ` poster.jpg ` , ` fanart.jpg ` , ` thumb.jpg ` , ` banner.jpg ` , ` icon.jpg ` , ` landscape.jpg ` - Thumbnail images (if available from the source)
699+
700+ ** Notes** :
701+ - This endpoint fetches metadata from the URL associated with the task
702+ - Files are saved to the task's configured folder (or default download path)
703+ - Existing files will be overwritten.
704+ - Thumbnail images are only downloaded if available from the source.
705+ - The NFO file follows the Kodi tvshow.nfo format
706+
707+ ** Status Codes** :
708+ - ` 200 OK ` - Metadata generated successfully
709+ - ` 400 Bad Request ` - Missing task ID, invalid folder path, or failed to fetch metadata
710+ - ` 404 Not Found ` - Task does not exist
711+
712+ ---
713+
661714### GET /api/task_definitions/
662715** Purpose** : Retrieve all task definitions.
663716
0 commit comments