diff --git a/README.md b/README.md index 121e1b3..8c19506 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ A simple Flask proxy server that uses yt-dlp to fetch HLS streams and serves the - URL validation with allowed domains - HTML5 video player with hls.js - Configurable via environment variables +- Full metadata display (title, description, views, likes, tags, etc.) ## Quick Start ```bash pip install -r requirements.txt -cp .env.example .env python app.py ``` @@ -35,9 +35,68 @@ Visit http://localhost:5000 and enter a video URL. ## Routes - `/` - Home page with video URL input -- `/player?url=VIDEO_URL` - Video player page -- `/hls//index.m3u8` - HLS playlist proxy -- `/hls//.ts` - HLS segment proxy +- `/player?url=VIDEO_URL` - Video player page with full metadata +- `/hls/--index.m3u8` - HLS main playlist +- `/hls/--.ts` - HLS segment + +## Connecting External Player + +### URL Format + +The proxy uses this format: `/hls/--` + +Example for PornHub: +``` +/hls/https%3A%2F%2Frt.pornhub.com%2Fview_video.php%3Fviewkey%3D69c13273df690--index.m3u8 +``` + +### Using with yt-dlp (as browser substitute) + +```bash +# Get playlist URL via proxy +yt-dlp --hls-use-mpegts --no-download --print url \ + "http://localhost:5000/hls/https%3A%2F%2Frt.pornhub.com%2Fview_video.php%3Fviewkey%3D69c13273df690--index.m3u8" +``` + +### Using with VLC + +1. Open Network Stream (Ctrl+N) +2. Enter: `http://localhost:5000/hls/--index.m3u8` + +### Using with mpv + +```bash +mpv "http://localhost:5000/hls/https%3A%2F%2Frt.pornhub.com%2Fview_video.php%3Fviewkey%3D69c13273df690--index.m3u8" +``` + +### Using with any HLS-compatible player + +Most players accept the m3u8 URL directly: + +``` +http://localhost:5000/hls/--index.m3u8 +``` + +Where `` is the URL-encoded original video URL. + +Example - full URL: +``` +http://localhost:5000/hls/https%3A%2F%2Frt.pornhub.com%2Fview_video.php%3Fviewkey%3D69c13273df690--index.m3u8 +``` + +### Python example (using requests + hlsjs) + +```python +import requests + +video_url = "https://rt.pornhub.com/view_video.php?viewkey=69c13273df690" +from urllib.parse import quote +encoded = quote(video_url, safe="") +hls_url = f"http://localhost:5000/hls/{encoded}--index.m3u8" + +response = requests.get(hls_url) +print(response.text) # Contains rewritten segment URLs +``` ## Running with Gunicorn @@ -51,6 +110,12 @@ gunicorn -w 4 -b 0.0.0.0:5000 app:app pytest tests/test_proxy.py -v ``` +## Supported Sites + +- PornHub (primary - HLS) +- YouTube (direct URL fallback, no HLS) +- Any site supported by yt-dlp + ## License -MIT +MIT \ No newline at end of file