mirror of
https://gitlab.com/vyla-entertainment/documentation.git
synced 2026-11-16 07:27:21 -05:00
2.7 KiB
2.7 KiB
Vyla SDK (@vyla-entertainment/sdk)
The official Node.js scraping and resolver library for movies, television series, embed configurations, subtitles, downloads, and manga.
Overview
@vyla-entertainment/sdk is the core media resolver engine for Vyla. It runs in Node.js (ES Modules) to query 65+ streaming scrapers, expose dedicated vs. aggregator source lists, provide pre-configured embed player URL templates, extract subtitles, find media downloads, and browse manga archives.
Installation
npm install @vyla-entertainment/sdk
Requirements:
- Node.js v20+ (ES Modules)
- Optional: TMDB API key for title metadata
Capabilities
- Streaming: Resolve direct MP4, MKV, DASH (
.mpd), and adaptive HLS (.m3u8) links withgetStream(),getSources(), andprobeSource(). - Source Categorization: Separate single-host providers (
DEDICATED_SOURCES) from multi-provider scrapers (AGGREGATOR_SOURCES) viaconfig.js. - Embed Configuration: Pre-mapped movie and TV embed URL templates with
ads: falsetagging inembed_config.js(EMBEDS/EMBED_MAP). - Subtitles: Fetch
.vttand.srtsubtitle tracks withgetSubtitles(). - Downloads: Find direct
.mp4download links usinggetDownloads(). - Manga: Search titles, list chapters, and fetch page images with
searchManga(),getManga(), andgetMangaChapter().
Quick Example
import VylaSDK from '@vyla-entertainment/sdk';
import EMBEDS from '@vyla-entertainment/sdk/src/embed_config.js';
const sdk = new VylaSDK({
tmdbApiKey: process.env.TMDB_API_KEY
});
const sources = sdk.getSources(true);
const dedicated = sources.filter(s => s.dedicated);
console.log(`Active sources: ${sources.length} (${dedicated.length} dedicated)`);
try {
const stream = await sdk.getStream('vidlink', 155);
console.log(stream.url, stream.allUrls);
} catch (err) {
console.error(err.message);
}
const adFreeEmbeds = EMBEDS.filter(e => e.ads === false);
console.log(`Ad-free embeds: ${adFreeEmbeds.length}`);
const subtitles = await sdk.getSubtitles(155);
console.log(`Subtitles found: ${subtitles.length}`);
Documentation Sections
- Quickstart — Step-by-step tutorial for movies, TV episodes, embeds, and error handling.
- API Reference — Complete methods, config exports, return shapes, and TypeScript types.
- Manga Module — Manga search, chapter indexes, and page loading.
- Contributing Scrapers — How to write and register new source and embed scrapers.