Install
openclaw skills install opensubtitlesRead-only OpenSubtitles skill to search and download subtitles via API, then extract scene context by timestamp to answer user questions regarding a show in...
openclaw skills install opensubtitlesUse this skill to fetch subtitle context around a timestamp. This is read‑only: no uploads or modifications.
Users should obtain an API key at: https://www.opensubtitles.com/consumers
Required env vars:
OPENSUBTITLES_API_KEYOPENSUBTITLES_USER_AGENT (e.g., OpenClaw 1.0)Optional (for downloads):
OPENSUBTITLES_USERNAMEOPENSUBTITLES_PASSWORDOPENSUBTITLES_TOKEN (if already logged in)OPENSUBTITLES_BASE_URL (hostname from login response, e.g., api.opensubtitles.com)Scripts live in {baseDir}/scripts/.
{baseDir}/scripts/opensubtitles-api.sh search --query "Show Name" --season 3 --episode 5 --languages en
Prefer IDs when available (imdb/tmdb). Use parent IDs for TV episodes. Follow redirects for search (script already uses -L).
{baseDir}/scripts/opensubtitles-api.sh login
Note: Login is rate limited (1/sec, 10/min, 30/hour). If you get 401, stop retrying.
Use base_url from the response as OPENSUBTITLES_BASE_URL for subsequent requests.
Before downloading, check the local subtitle cache (see below). Only call the download API if the file is not already cached.
OPENSUBTITLES_TOKEN=... {baseDir}/scripts/opensubtitles-api.sh download-link --file-id 123
After downloading an .srt file (default window: 10 minutes before timestamp):
On Windows, use findstr or PowerShell Select-String to replicate the awk logic (use the shell script as a guide). The agent should pick the best option available on that system.
{baseDir}/scripts/subtitle-context.sh ./subtitle.srt 00:12:34,500
Custom window:
{baseDir}/scripts/subtitle-context.sh ./subtitle.srt 00:12:34,500 --window-mins 5
Pair with trakt-readonly to identify current episode; when Trakt adds playback progress support, update the Trakt skill to supply a precise timestamp for context‑aware, spoiler‑safe responses.
Store downloaded subtitles under {baseDir}/storage/subtitles/ (create if missing). Use a stable filename like:
{baseDir}/storage/subtitles/<file_id>__<language>.srt
Check this cache before calling /download to avoid wasting limited daily downloads.
https://api.opensubtitles.com/api/v1 (or the base_url returned by login).remaining field) in the user response.--window-mins to get more or less context as needed.{baseDir}/storage/subtitles/ to avoid arbitrary file access.references/opensubtitles-api.md