--- title: Streaming Provider API emoji: 🎬 colorFrom: blue colorTo: purple sdk: docker pinned: false --- # StreamHub API — Node.js Implementation Streaming provider aggregator with embedded proxy. Aggregates 8 providers, returns playable HLS/MP4 URLs via SSE, proxies streams through embedded middleman with M3U8 rewriting. ## Endpoints | Route | Description | |---|---| | `GET /movie?id={tmdb_id}` | SSE stream of provider results for movie | | `GET /tv?id={tmdb_id}&season={s}&episode={e}` | SSE stream of provider results for TV episode | | `GET /api?url={target}&{sourceParam}=1` | Embedded proxy — M3U8 rewriting, streaming byte pipe | | `GET /api?providers=1` | List active providers | | `GET /` | API info | ### SSE Events (`/movie`, `/tv`) ``` data: {"type":"meta","meta":{...}} data: {"type":"source","source":{"source":"vidlink","label":"VidLink","url":"/api?url=...&vl=1"}} data: {"type":"done","total":8} ``` ### Proxy (`/api`) Every stream URL is wrapped through the embedded proxy with a source-specific parameter: ``` /api?url=https%3A%2F%2Fcdn.example.com%2Fstream.m3u8&vr=1&proxyHeaders=%7B%22Referer%22%3A%22...%22%7D ``` The proxy: - Detects M3U8 → rewrites all segment/key URIs through itself - Pipes binary streams directly (Readable.fromWeb → pipe) with Range header support - Follows up to 5 redirects, forces HTTPS - Injects CDN-specific headers from provider config ## Providers | Key | Label | Source | |---|---|---| | `videasy` | Videasy | api.videasy.to + enc-dec.app decryption | | `vidfast` | VidFast | vidfast.pro + enc-dec.app encrypt/decrypt | | `vidlink` | VidLink | enc-dec.app → vidlink.pro API | | `hexa` | Hexa | hexa.su + enc-dec.app decryption | | `lordflix` | LordFlix | snowhouse.lordflix.club + enc-dec.app | | `vaplayer` | VA Player | streamdata.vaplayer.ru API | | `rivestream` | RiveStream | rivestream.app + CF worker | | `vidrock` | VidRock | AES-CBC encode → vidrock.ru API | ## Run ```bash node server.js ``` Port: `7860` (configurable via `PORT` env). ## Deploy ### HuggingFace Spaces Create Space with Docker SDK. `SPACE_ID` env auto-detected — adjusts timeouts and concurrency. ### Docker ```bash docker build -t streamhub-api . docker run -p 7860:7860 streamhub-api ```