Spaces:
Sleeping
Sleeping
github-actions[bot]
chore: deploy bundle to hf-space (3c775742d8ddca3e24edc4b8396e1aec32441803)
aa037d2 |
Download README.md from StreamHubAPI/v1: direct link, hf CLI and curl.
- Browser
- Download file 2.26 kB
-
https://huggingface.co/spaces/StreamHubAPI/v1/resolve/main/README.md
- Command line
-
hf download hf://spaces/StreamHubAPI/v1/README.md
-
curl -L -o README.md https://huggingface.co/spaces/StreamHubAPI/v1/resolve/main/README.md
2.26 kB
| 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 | |
| ``` | |