Closed roipoussiere closed 5 years ago
This could become a must-have once the plugin engine is done.
I guess a lot of developpers could rely on this API to offer different tools around this feature.
We have a subtitle API: https://github.com/Chocobozzz/PeerTube/blob/develop/server/controllers/api/videos/captions.ts#L22
But it's not documented yet.
A subtitles API, allowing users to import a subtitle for a given video via the PeerTube API, could have a significant impact in the PeerTube network accessibility, and some interesting projects could emerge.
For instance, with a such API we could imagine a web service dedicated to video captioning, on which PeerTube users subscribe, that:
Here is a suggestion for a subtitles API specification:
GET
: Get a video subtitles fileid
(string): The video id or uuid;language
(string): the language code, as defined in ISO 639-1;200
: successful operation;404
: subtitle not found for the given video id and language;POST
: Put a video subtitles fileid
(string): The video id or uuid;language
(string): the language code, as defined in ISO 639-1;overwrite
(boolean): if a subtitle already exist for the specified video id and language, the request return a 409 error (default totrue
);200
: successful operation;404
: subtitle not found for the given video id and language;409
(conflict): a subtitle already exist for the specified video id and language (only triggered ifoverwrite
is set totrue
);DELETE
: Remove a video subtitles fileid
(string): The video id or uuid;language
(string): the language code, as defined in ISO 639-1;204
: successful operation;404
: subtitle not found for the given video id and language.