Wyzie Subs
Using the Wyzie NPM Package#
The Wyzie Subs NPM package is the best way to use Wyzie Subs if your project is in JavaScript or TypeScript. Wyzie Lib (the NPM package) is fast, simple, and reliable, as well as having an onboard VTT parser for parsing subtitles into VTT format. Additionally, it has no dependencies, making it lightweight and reliable. Read the code
Installation#
npm install wyzie-lib
Usage#
import { type SubtitleData, searchSubtitles, parseToVTT } from "wyzie-lib";
// Fetches all subtitles for the media with the TMDB ID 286217
const data: SubtitleData[] = await searchSubtitles({ tmdb_id: 286217, format: "srt" });
console.log(data[0].id); // Prints the ID of the first subtitle object
Parameters#
For more information (or if you are stuck), please visit the Wyzie Subs homepage. If you have any questions, start there.
Parameter | Name | Description |
---|---|---|
tmdb_id | TmdbId | The TMDB ID of the movie or TV show. (tmdb_id or imdb_id is required) |
imdb_id | ImdbId | The IMDB ID of the movie or TV show. (imdb_id or tmdb_id is required) |
format | format | The file format of the subtitles returned. (srt, txt, sub, ssa, ass) |
season | season | Desired season of subtitles (this requires the episode parameter as well) |
episode | episode | The episode of the given season. |
language | language | The ISO 3166-2 code of the provided subtitles. |
encoding | encoding | The character encoding of the file. |
hi | isHearingImpaired | A boolean indicating if the subtitles are hearing impaired. |
Types#
- SearchSubtitlesParams: All valid parameters recognized by the API.
- QueryParams: All parameters (optional and required) available for the wyzie-subs API.
- SubtitleData: All returned values from the API with their respective types.
Our types are very simple and well-documented. Check out the types.ts file here.