Laev.OpenSubtitles (laev v0.1.40)

Copy Markdown View Source

OpenSubtitles.com REST API client — search subtitles in any language and fetch the actual .srt text.

Search needs only an API key; downloading needs a logged-in token (username + password), and counts against your daily download quota. Config comes from OPENSUBTITLES_API_KEY, OPENSUBTITLES_USERNAME, OPENSUBTITLES_PASSWORD.

Summary

Functions

Download a subtitle file's .srt text by its file_id.

Search subtitles. opts may include :query, :tmdb_id, :season_number, :episode_number, :languages (comma string like "en,es"). Returns {:ok, [%{file_id, language, release, downloads}]} best-first.

Convert SRT text to WebVTT (browsers' <track> needs VTT, not SRT).

Functions

can_download?()

configured?()

download_srt(file_id)

Download a subtitle file's .srt text by its file_id.

search(opts)

Search subtitles. opts may include :query, :tmdb_id, :season_number, :episode_number, :languages (comma string like "en,es"). Returns {:ok, [%{file_id, language, release, downloads}]} best-first.

srt_to_vtt(srt)

Convert SRT text to WebVTT (browsers' <track> needs VTT, not SRT).