Update README.md to enhance documentation on HLS proxy usage and supported sites
This commit is contained in:
@@ -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
|
- URL validation with allowed domains
|
||||||
- HTML5 video player with hls.js
|
- HTML5 video player with hls.js
|
||||||
- Configurable via environment variables
|
- Configurable via environment variables
|
||||||
|
- Full metadata display (title, description, views, likes, tags, etc.)
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
cp .env.example .env
|
|
||||||
python app.py
|
python app.py
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -35,9 +35,68 @@ Visit http://localhost:5000 and enter a video URL.
|
|||||||
## Routes
|
## Routes
|
||||||
|
|
||||||
- `/` - Home page with video URL input
|
- `/` - Home page with video URL input
|
||||||
- `/player?url=VIDEO_URL` - Video player page
|
- `/player?url=VIDEO_URL` - Video player page with full metadata
|
||||||
- `/hls/<query>/index.m3u8` - HLS playlist proxy
|
- `/hls/<encoded_url>--index.m3u8` - HLS main playlist
|
||||||
- `/hls/<query>/<segment>.ts` - HLS segment proxy
|
- `/hls/<encoded_url>--<segment>.ts` - HLS segment
|
||||||
|
|
||||||
|
## Connecting External Player
|
||||||
|
|
||||||
|
### URL Format
|
||||||
|
|
||||||
|
The proxy uses this format: `/hls/<encoded_video_url>--<filename>`
|
||||||
|
|
||||||
|
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/<encoded_url>--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/<encoded_video_url>--index.m3u8
|
||||||
|
```
|
||||||
|
|
||||||
|
Where `<encoded_video_url>` 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
|
## Running with Gunicorn
|
||||||
|
|
||||||
@@ -51,6 +110,12 @@ gunicorn -w 4 -b 0.0.0.0:5000 app:app
|
|||||||
pytest tests/test_proxy.py -v
|
pytest tests/test_proxy.py -v
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Supported Sites
|
||||||
|
|
||||||
|
- PornHub (primary - HLS)
|
||||||
|
- YouTube (direct URL fallback, no HLS)
|
||||||
|
- Any site supported by yt-dlp
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
Reference in New Issue
Block a user