A lightweight, easy-to-use Node.js package for fetching movie and TV show subtitles from the WHVX Subs API. Supports multiple subtitle formats and languages, with IMDb and TMDb integration.
More Info At: https://subs.whvx.net
- Fetch subtitles for movies and TV shows using IMDb or TMDb IDs.
- Supports both CommonJS and ES Module.
- Easy integration with your Node.js projects.
Install the package using npm:
npm install whvx-subs
You can use this package in both CommonJS and ES Module environments.
const whvxSubs = require('whvx-subs');
async function fetchSubtitles() {
try {
const subtitles = await whvxSubs.searchSubtitles('tt1234567', 1, 1);
console.log(subtitles);
} catch (error) {
console.error('Error fetching subtitles:', error);
}
}
fetchSubtitles();
import { searchSubtitles } from 'whvx-subs';
async function fetchSubtitles() {
try {
const subtitles = await searchSubtitles('tt1234567', 1, 1);
console.log(subtitles);
} catch (error) {
console.error('Error fetching subtitles:', error);
}
}
fetchSubtitles();
searchSubtitles(id: string, season?: number, episode?: number): Promise<SubtitleResponse>
Fetches subtitles based on the provided ID. The season and episode parameters are optional and should be used for TV shows.
- id: The IMDb or TMDb ID for the movie or TV show.
- season (optional): The season number (required for TV shows).
- episode (optional): The episode number (required for TV shows).
const subtitles = await searchSubtitles('tt1234567');