PlayerStream
EN
Ko-fi

Guides / Create an addon

Addon · subtitles

Subtitle addon.

Subtitles by language for each movie or episode. They appear during playback, in the subtitle list, alongside the video's own and those from other addons.

Only subtitles you have permission for. Whoever creates an addon is responsible for what it offers, and whoever adds it to the app, for what they add. Subtitles have authors too: use your own or ones you have the right to share. The example uses the official Tears of Steel subtitles (Blender Foundation, CC BY 3.0).

01

The manifest.

The subtitles resource, for movie, series or both. Its idPrefixes must be empty or tt: subtitles are always requested with the IMDb id.

manifest.json
{
  "id": "org.example.open-subs",
  "version": "1.0.0",
  "name": "Open Subtitles (example)",
  "resources": ["subtitles"],
  "types": ["movie", "series"],
  "idPrefixes": ["tt"],
  "catalogs": []
}
AndroidAndroid TVWindowsWeb version
02

The request.

WhatAddress the app requests
A movie/subtitles/movie/tt2285752.json
An episode/subtitles/series/tt1234567:1:2.json
With the file/subtitles/movie/tt2285752/filename=tears_of_steel_720p.mov&videoSize=372178639.json

When it knows the name and size of the video being watched, the app adds them: they help you return the subtitle that best fits that file. If you don't need them, ignore them.

03

The response.

subtitles/movie/tt2285752.json
{
  "subtitles": [
    { "id": "tos-eng", "lang": "eng",
      "url": "https://download.blender.org/demo/movies/ToS/subtitles/TOS-en.srt" },
    { "id": "tos-spa", "lang": "spa",
      "url": "https://download.blender.org/demo/movies/ToS/subtitles/TOS-es.srt" }
  ]
}

From each subtitle, url and lang are used (id isn't, but include it: other apps require it). The catalog guide's example addon already replies with this.

A link addon can also provide subtitles inside each link ("subtitles": [...] in the stream): those appear first.

04

Languages and files.

langShows as
spa, es, esp, spnSpanish
lat, es-419, es-mx, spl, eaLatin American
eng, fre/fra, ger/deu, ita, por… or en, fr, de…Its name (3- or 2-letter codes)
an unknown oneAs is
empty“No language”
  • Formats: SRT, VTT, ASS and SSA, based on the address's extension (without one, it's treated as SRT). Also inside a .gz or a .zip (the first subtitle inside).
  • Size: up to 16 MB.
  • Encoding: UTF-8 (with or without BOM); otherwise, Windows-1252 or Latin-1. UTF-8 is best.
  • How many: no repeated addresses, up to 8 per language and 40 in total, with the language chosen in Settings first.
  • In the web version, the file is downloaded by the browser: serve it over https with CORS.
05

Seeing it in the app.

Add it in Settings → Content → Addons (like any addon) and play the movie. In the player, the Subtitles button shows the languages and how many there are of each.

The player with Tears of Steel paused and the “Subtitles” menu: Spanish, English, French, German, Italian and Portuguese, one of each, plus delay and height
The six official Tears of Steel subtitles from the example addon (with OpenSubtitles turned off). Below, delay and height.

The app already comes with OpenSubtitles in Settings → Content → Addons; each user can turn it off. Its subtitles and yours appear together.

06

Common errors.

  • You're never asked: your idPrefixes aren't tt (or aren't empty), or the type is neither movie nor series.
  • Garbled characters: the file isn't in UTF-8.
  • It shows its code instead of the name: the lang isn't a known 2- or 3-letter code.
  • Out of sync: the subtitle is for another version of the video. Use filename and videoSize to return the one that fits; meanwhile, “Delay” in the player.