How the Stream Provider module is structured
mainThe Stream Provider is a modular system designed for separation of concerns. Its architecture is divided into several functional layers:
- Configuration (
config/): Manages timeouts and stream name prefixes (viaSTREAM_NAME_MAP). - Utilities (
utils/): Handles URL validation, torrent sorting (by resolution/size), and stream filtering by size. - Caching (
caching/): A dual-layer system using SQLite and in-memory storage. It includescache-manager.jsfor retrieval/storage,background-refresh.jsfor async updates, anddeduplication.jsto prevent concurrent duplicate requests. - Debrid Providers (
debrid/): Contains implementation logic for services like RealDebrid, AllDebrid, Premiumize, DebridLink, TorBox, OffCloud, Debrider.app, and Personal Cloud. - Formatters (
formatters/): Converts raw data into Stremio-compatible stream objects.stream-formatter.jsis the standard, whiledebrider-formatter.jshandles NZB routing and personal cloud files. - Resolvers (
resolvers/): Theurl-resolver.jsmodule handles the logic of turning identifiers into streaming URLs for all supported debrid services. - Alternative Services (
alternative-services/): Integrations for Easynews, Usenet/Newznab, Home Media Servers, and HTTP streaming scrapers (e.g., 4KHDHub, HDHub4u).