Updated index.html and README
This commit is contained in:
114
README.md
114
README.md
@@ -1,30 +1,62 @@
|
||||
# streamlink-server
|
||||
# Streamlink Server
|
||||
|
||||
Run your m3u and mpd streams through streamlink with authentication
|
||||
A powerful streaming proxy server that handles various stream types through Streamlink with authentication support.
|
||||
|
||||
## Purpose
|
||||
## Overview
|
||||
|
||||
Convert unstable or incompatible video streams into a format that media players can reliably play and record by processing them through streamlink.
|
||||
This server provides a secure way to proxy and convert video streams using Streamlink. It supports various streaming protocols and includes features for custom headers, proxy support, and authentication.
|
||||
|
||||
## Key Features
|
||||
|
||||
- Stream conversion using Streamlink
|
||||
- Authentication protection for all endpoints
|
||||
- Support for custom HTTP headers
|
||||
- Proxy server support
|
||||
- Channel configuration via JSON
|
||||
- Docker and Docker Compose support
|
||||
- RESTful API endpoints
|
||||
- Real-time stream monitoring and recovery
|
||||
- Support for MPEG-TS output format
|
||||
|
||||
## Requirements
|
||||
|
||||
- Python 3.11 or newer
|
||||
- FFmpeg
|
||||
- streamlink
|
||||
- Python packages (install via `pip`):
|
||||
- FastAPI
|
||||
- uvicorn
|
||||
- python-dotenv
|
||||
- python-multipart
|
||||
- Streamlink 6.5.0 or newer
|
||||
- Additional Python packages (installed via requirements.txt):
|
||||
- FastAPI 0.109.0+
|
||||
- uvicorn 0.27.0+
|
||||
- python-multipart 0.0.9+
|
||||
- python-dotenv 1.0.0
|
||||
- typing-extensions 4.9.0+
|
||||
|
||||
## Installation
|
||||
|
||||
### Standard Installation
|
||||
|
||||
```bash
|
||||
git clone https://github.com/purplescorpion1/streamlink-server.git
|
||||
git clone https://git.fiorinis.com/Home/streamlink-server.git
|
||||
cd streamlink-server
|
||||
pip install -r src/requirements.txt
|
||||
```
|
||||
|
||||
### Docker Installation
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Hugging Face Spaces Deployment
|
||||
|
||||
The project includes a specialized Dockerfile (`Dockerfile_HF`) optimized for deployment on Hugging Face Spaces. Once you have created the Space, you can create a Dockerfile and past the contents of `Dockerfile_HF` into it.
|
||||
|
||||
This version is specifically configured to run as a Space on huggingface.co, providing:
|
||||
|
||||
- Optimized container size
|
||||
- Pre-configured environment for Spaces
|
||||
- Automatic HTTPS handling
|
||||
- Integration with Hugging Face's monitoring
|
||||
|
||||
## Configuration
|
||||
|
||||
1. Create a `.env` file in the project root:
|
||||
@@ -34,7 +66,7 @@ AUTH_USERNAME=your_username
|
||||
AUTH_PASSWORD=your_password
|
||||
```
|
||||
|
||||
2. Configure your channels in `data/channels.json`:
|
||||
2. Configure your channels in `data/channels.json`. Example:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -42,45 +74,55 @@ AUTH_PASSWORD=your_password
|
||||
{
|
||||
"id": "1",
|
||||
"name": "Example Channel",
|
||||
"url": "https://example.com/stream.m3u8"
|
||||
"url": "https://example.com/stream",
|
||||
"origin": "https://example.com",
|
||||
"referer": "https://example.com/player",
|
||||
"agent": "Mozilla/5.0...",
|
||||
"proxy": "http://proxy:8080"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
## API Endpoints
|
||||
|
||||
1. Start the server:
|
||||
### Stream Endpoints
|
||||
|
||||
```bash
|
||||
python src/stream_link_server.py
|
||||
```
|
||||
- `GET /stream/{channel_id}` - Stream a channel by ID
|
||||
- `GET /stream/url` - Stream from a custom URL with query parameters
|
||||
|
||||
The server will start on port 6090 by default.
|
||||
### Utility Endpoints
|
||||
|
||||
2. Access your streams:
|
||||
- `GET /utils/channels` - List all available channels
|
||||
- `POST /utils/generate_url` - Generate encoded streaming URLs
|
||||
|
||||
- List all channels:
|
||||
`http://localhost:6090/channels?username=xxx&password=xxx`
|
||||
- Stream specific channel:
|
||||
`http://localhost:6090/{channel_id}?username=xxx&password=xxx`
|
||||
### Authentication
|
||||
|
||||
## Docker Support
|
||||
All endpoints require authentication via query parameters:
|
||||
|
||||
Run with Docker Compose:
|
||||
- `username`: Your configured username
|
||||
- `password`: Your configured password
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
## Docker Environment Variables
|
||||
|
||||
## Environment Variables
|
||||
- `AUTH_USERNAME`: Authentication username
|
||||
- `AUTH_PASSWORD`: Authentication password
|
||||
- `TZ`: Timezone (default: UTC)
|
||||
|
||||
- `AUTH_USERNAME`: Username for authentication
|
||||
- `AUTH_PASSWORD`: Password for authentication
|
||||
- `PORT`: Server port (default: 6090)
|
||||
## Stream URL Parameters
|
||||
|
||||
When using the `/stream/url` endpoint:
|
||||
|
||||
- `url`: The source stream URL (required)
|
||||
- `origin`: Custom Origin header
|
||||
- `referer`: Custom Referer header
|
||||
- `agent`: Custom User-Agent header
|
||||
- `proxy`: Proxy server URL
|
||||
|
||||
## Notes
|
||||
|
||||
- Make sure streamlink is properly installed and available in your system PATH
|
||||
- All streams require authentication with username/password
|
||||
- The server provides a clean HTTP interface for your media players
|
||||
- All streams are converted to MPEG-TS format for maximum compatibility
|
||||
- The server includes automatic stream recovery on failures
|
||||
- Default server port is 6090
|
||||
- All API endpoints require authentication
|
||||
- Docker setup includes optional VPN support via gluetun
|
||||
Reference in New Issue
Block a user