class, password, language=None, **kwargs)[source]

Plugin to get video subtitles from OpenSubtitles


  • python-opensubtitles (pip install -e 'git+')
  • webvtt (pip install webvtt-py), optional, to convert srt subtitles into vtt format ready for web streaming
  • requests (pip install requests)
__init__(username, password, language=None, **kwargs)[source]
  • username (str) – Your OpenSubtitles username
  • password (str) – Your OpenSubtitles password
  • language (str or list[str]) – Preferred language name, ISO639 code or OpenSubtitles language ID to be used for the subtitles. Also supports an (ordered) list of preferred languages
download(link, media_resource=None, path=None, convert_to_vtt=False)[source]

Downloads a subtitle link (.srt/.vtt file or gzip/zip OpenSubtitles archive link) to the specified directory

  • link (str) – Local subtitles file or OpenSubtitles gzip download link
  • path (str) – Path where the subtitle file will be downloaded (default: temporary file under /tmp)
  • media_resource (str) – Name of the media resource. If set and if it’s a media local file then the subtitles will be saved in the same folder
  • convert_to_vtt (bool) – If set to True, then the downloaded subtitles will be converted to VTT format (default: no conversion)



    "filename": "/path/to/subtitle/"
get_subtitles(resource, language=None)[source]

Get the subtitles data for a video resource

  • resource (str) – Media file, torrent or URL to the media resource
  • language (str) – Language name or code (default: configured preferred language). Choose ‘all’ for all the languages

Get the VTT content given an SRT file. Will return the original content if the file is already in VTT format.