Peertube: Add a subtitles API

Created on 22 Mar 2019  路  3Comments  路  Source: Chocobozzz/PeerTube

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:

  1. listens for new videos via RSS feed;
  2. automatically downloads any video posted by authenticated users;
  3. generates draft subtitles with Mozilla's DeepSpeech among its CommonVoice datasets;
  4. publishes them on the web platform;
  5. lets the community peer-reviews new subtitles;
  6. eventually deal with a Weblate server API to allow the community to translate subtitles in other languages;
  7. send peer-reviewed subtitles to the PeerTube instance via the subtitles API, with the user token.

Here is a suggestion for a subtitles API specification:

  • GET: Get a video subtitles file

    • parameters:



      • id (string): The video id or uuid;


      • language (string): the language code, as defined in ISO 639-1;



    • responses:



      • 200: successful operation;


      • 404: subtitle not found for the given video id and language;



  • POST: Put a video subtitles file

    • parameters:



      • id (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 to true);



    • responses:



      • 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 if overwrite is set to true);



  • DELETE: Remove a video subtitles file

    • parameters:



      • id (string): The video id or uuid;


      • language (string): the language code, as defined in ISO 639-1;



    • responses:



      • 204: successful operation;


      • 404: subtitle not found for the given video id and language.



Component Component

Most helpful comment

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XenonFiber picture XenonFiber  路  3Comments

NoraCodes picture NoraCodes  路  3Comments

kabo picture kabo  路  3Comments

milleniumbug picture milleniumbug  路  3Comments

Jorropo picture Jorropo  路  3Comments