Fetch Subtitles

Season Packs#

A season pack costs one search per episode, plus 1 per episode with zip=1. Any server key works, free keys included; browser-safe keys are refused.

GET /search/season finds the best subtitle for every aired episode of a season in one call. You get a JSON row with a download link for each episode, or with zip=1 one zip of the files.

The API: GET /search/season#

curl "https://sub.wyzie.io/search/season?id=tt0903747&season=1&language=en&key=YOUR_KEY"
curl -o season1.zip "https://sub.wyzie.io/search/season?id=1396&season=1&zip=1&to=vtt&sdh=strip&key=YOUR_KEY"
ParameterExampleDescription
keyYOUR_KEYAny valid API key, free or Pro. Browser-safe keys are refused.
idtt0903747, 1396TMDB or IMDb id of the show.
season1Season number. 0 holds the specials.
languageenOne language. Default: en.
episodes1-5, 1,3,8Optional. Only these episodes, as numbers and ranges.
zip11: one zip of the files instead of JSON.
format, hi, source, origin, encoding, machineformat=srtOptional. As on /search, for each episode.
to, sdh, shift...to=vtt&sdh=stripWith zip=1: download options, applied to each file.

Episodes that have not aired yet, or have no air date, are left out and cost nothing. A call takes at most 50 episodes: for a longer season, send episodes=1-50 and then the rest.

Response#

{
  "id": "1396",
  "tmdbId": 1396,
  "imdbId": null,
  "season": 1,
  "language": "en",
  "episodes": 7,
  "found": 5,
  "pending": [4],
  "cost": 6,
  "refunded": 1,
  "results": [
    {
      "episode": 1,
      "name": "Pilot",
      "airDate": "2008-01-20",
      "ok": true,
      "subtitle": {
        "id": "1955204396",
        "url": "https://sub.wyzie.io/c/.../id/1955204396?format=srt&tok=...",
        "format": "srt",
        "language": "en",
        "source": "charlie",
        "release": "Breaking.Bad.S01E01.720p.BluRay.x264-DEMAND",
        "rank": { "score": 96, "reasons": [] }
      }
    },
    {
      "episode": 2,
      "name": "Cat's in the Bag...",
      "airDate": "2008-01-27",
      "ok": true,
      "subtitle": null
    },
    {
      "episode": 4,
      "name": "Cancer Man",
      "airDate": "2008-02-17",
      "ok": false,
      "status": "pending"
    }
  ]
}

Each row has the episode name, its airDate and subtitle, the best result with its url and rank. Downloading that url later costs 1 request, as usual. subtitle: null means no subtitle was found. ok: false with a status code means the search failed on our side, and its cost was given back.

Pending Episodes#

The call answers within about 60 seconds. An episode that is not done by then is listed in pending, its row has status: "pending", and its cost is given back. Its search keeps running, so ask again with episodes= set to those numbers and they come back quickly.

Zip Files#

With zip=1 the answer is one zip, such as tt0903747.S01.en.zip, holding S01E01.en.srt and so on. X-Season-Episodes counts the episodes searched and X-Season-Found the files. When some episodes are pending, X-Season-Pending lists them and the zip holds a pending.txt. If no episode had a file and none is pending, the answer is a 404.

With wyzie-lib#

searchSeason returns the JSON pack, or with zip: true the zip bytes and the episode counts. It never retries, since the pack is charged up front. Ask again for the pending episodes.

import { searchSeason } from 'wyzie-lib';
 
const pack = await searchSeason({ id: 'tt0903747', season: 1, language: 'en' });
for (const row of pack.results)
  if (row.ok && row.subtitle) console.log(row.episode, row.subtitle.url);
if (pack.pending.length)
  await searchSeason({ id: 'tt0903747', season: 1, episodes: pack.pending });
 
// One zip, every file as VTT with hearing-impaired text removed
const { zip, filename, found } = await searchSeason({
  id: 1396,
  season: 1,
  zip: true,
  options: { to: 'vtt', sdh: 'strip' },
});

Cost#

Each episode costs what its /search would (1, or 1 per named source), plus 1 with zip=1. The whole amount is charged up front, and the unused part comes back in one refund: 1 for each episode with no file in the zip, the search of each episode that failed on our side, and the full share of each pending episode. An episode with no subtitles found keeps its search charge, as on /search. cost and X-Wyzie-Cost show what was kept.

Errors
StatusMeaning
400No id or season, or more than 50 episodes (use episodes=).
401No key.
402The Pro balance is exhausted (same body as /search).
403An invalid key, a key on hold, or a browser-safe key.
404TMDB has no such season, or no episode had a subtitle in this language.
429Over 10 season packs a minute for this account. Nothing is charged.
503Billing is unavailable. Nothing runs; retry shortly.