yuki / README.md
mwask's picture
Upload 6 files
f5a8e04 verified
|
Raw
History Blame Contribute Delete
2.31 kB
metadata
title: YumeZone HLS Proxy
emoji: 🎬
colorFrom: purple
colorTo: blue
sdk: docker
pinned: false

YumeZone HLS Proxy

A fast, deployable HLS proxy server that rewrites M3U8 playlists and proxies video streams through your Hugging Face Space.

Features

  • Base64url encoded payload support
  • M3U8 playlist rewriting
  • CDN rule-based referer/origin spoofing
  • CORS enabled
  • Works with various anime/video streaming CDNs

Deployment

This Space uses Docker. The server starts automatically on port 3000.

Endpoints

  • GET /health β€” Health check
  • GET /proxy?url=<url>&ref=<referer> β€” Proxy request with optional referer
  • GET /p/<base64url> β€” Base64-encoded payload proxy

Test

Visit: /health to verify it's running

Example proxy:

/proxy?url=https%3A%2F%2Fexample.com%2Fvideo.m3u8&ref=https%3A%2F%2Fexample.com%2F
  • For custom domain:
    • route: Your worker route (e.g., example.com/api/proxy/*)
    • zone_id: Your domain's zone ID

4. Update WORKER_BASE in index.js

Replace {url here} with your worker's URL (e.g., https://yumezone.example.com or https://yourname.workers.dev)

5. Deploy

npm run deploy
# or
wrangler deploy

6. Test

# Health check
curl https://yourname.workers.dev/health

# Proxy a URL
curl "https://yourname.workers.dev/proxy?url=https://example.com/video.m3u8"

Features

  • Base64URL encoding: /p/<base64url> - secure, obfuscated requests
  • Legacy support: /proxy?url=...&ref=... - backward compatible
  • CDN Rules: Pre-configured headers for popular CDN hosts
  • M3U8 Rewriting: Auto-rewrites playlist URLs to go through proxy
  • Browser impersonation: Spoofs User-Agent and other headers
  • Range requests: Supports HTTP Range header for video segments
  • CORS enabled: Works with cross-origin requests

Environment

This is a Service Worker - no external dependencies required. Uses native Cloudflare Worker APIs.

File Structure

.
β”œβ”€β”€ index.js          # Main worker code
β”œβ”€β”€ package.json      # Project metadata
β”œβ”€β”€ wrangler.toml     # Cloudflare Worker config
β”œβ”€β”€ .gitignore        # Git ignore rules
└── README.md         # This file