No description
- Python 60.4%
- HTML 16.6%
- CSS 10.3%
- JavaScript 9.7%
- Dockerfile 1.8%
- Other 1.2%
| .gitea/workflows | ||
| docs | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .env.sample | ||
| .gitignore | ||
| babel.cfg | ||
| channels.json | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| Makefile | ||
| pytest.ini | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| run.py | ||
Live Stream Generator
HLS M3U8 playlist generator for legal TV channels.
Quick Start
1. Clone and configure:
git clone <repository>
cd live-generator
cp .env.sample .env
2. Edit .env and set your passwords:
ADMIN_PASSWORD=your_secure_password
SECRET_KEY=your_secret_key
3. Run with Docker:
docker-compose up -d
4. Access:
- Web UI: http://localhost:5000
- Admin Panel: http://localhost:5000/admin
- Playlist: http://localhost:5000/list/list.m3u8
- JS Licenses: http://localhost:5000/librejs
Project Structure
live-generator/
├── run.py # Main entry point
├── LICENSE # GNU AGPLv3
├── requirements.txt # Python dependencies
├── requirements-dev.txt # Dev dependencies (pytest)
├── Makefile # Build commands
├── babel.cfg # Babel/i18n configuration
├── pytest.ini # Pytest configuration
├── Dockerfile # Docker image
├── docker-compose.yml # Docker Compose setup
├── channels.json # Dynamic channel definitions
├── .env.sample # Environment template
└── src/
├── app.py # Flask application & routes
├── config/
│ └── settings.py # Headers, timeouts, retry config
├── extractors/
│ ├── base.py # Abstract base extractor
│ ├── iblups.py # IBLUPS extractor (TV Perú, etc.)
│ ├── dps.py # DPS/Rudo.Video extractor (Latina, RPP)
│ └── dailymotion.py # Dailymotion extractor (Panamericana)
├── proxy/
│ ├── manager.py # Channel/extractor lifecycle
│ └── stream_manager.py # HLS proxy with circuit breaker
├── storage/
│ └── channel_storage.py # Dynamic channel CRUD
├── admin/
│ └── routes.py # Admin panel backend
├── templates/
│ ├── index.html # Home page
│ ├── web_player.html # HLS.js video player
│ ├── librejs.html # JS license table (LibreJS)
│ └── admin/
│ ├── login.html # Admin login
│ └── dashboard.html # Admin dashboard
├── static/
│ ├── css/
│ │ ├── style.css # Main stylesheet
│ │ ├── admin.css # Admin panel styles
│ │ └── web-player.css
│ └── js/
│ └── admin.js # Admin panel JS (LibreJS compliant)
└── translations/
├── en/LC_MESSAGES/
└── es/LC_MESSAGES/
tests/
├── test_config.py
├── test_extractors.py
└── test_app.py
Installation
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# (Optional) Install dev dependencies
pip install -r requirements-dev.txt
Usage
# Production (gunicorn)
python run.py
# Development (Flask debug mode)
FLASK_DEBUG=1 python run.py
The server will start at http://localhost:5000
Endpoints
| Endpoint | Description |
|---|---|
/ |
Web UI with channel information |
/librejs |
JavaScript licenses (LibreJS compliance) |
/list/list.m3u8 |
Complete M3U8 playlist |
/proxy/[channel]/playlist.m3u8 |
HLS proxy for VLC |
/proxy/[channel]/var.m3u8?src=URL |
Variant playlist proxy |
/proxy/[channel]/seg.ts?src=URL |
Video segment proxy |
/web/[channel] |
HTML5 web player (hls.js) |
/admin |
Admin panel (login required) |
/api/status |
Channel status (JSON) |
/api/extract/[channel] |
Force stream extraction |
/api/refresh |
Refresh all channels |
/api/circuit-breaker/status |
Circuit breaker state |
/api/circuit-breaker/reset |
Reset circuit breaker |
Channels
Panamericana TV
- Type: Dailymotion
- Source: https://panamericana.pe/tvenvivo
- Video ID:
xa50i1c
Latina TV
- Type: DPS (Rudo.Video)
- Source: https://www.latina.pe/vivo
Latina Noticias
- Type: DPS (Rudo.Video)
Latina Clásicos
- Type: DPS (Rudo.Video, stream hash:
plus226)
Latina Podcast
- Type: DPS (Rudo.Video, stream hash:
plus226)
RPP TV
- Type: DPS (SSAI/Google DAI)
- Source: https://rpp.pe/tv-vivo
TV Perú
- Type: IBLUPS
- Source: https://www.tvperu.gob.pe/
TV Perú Internacional
- Type: IBLUPS
Radio Nacional
- Type: IBLUPS
Canal IPe
- Type: IBLUPS
Exitosa Noticias
- Type: Direct (M3U8)
Features
- Multi-extractor: IBLUPS, DPS (Rudo.Video), Dailymotion, Direct M3U8
- Dynamic Extraction: Tokens and hashes extracted automatically
- Fallback Values: Pre-configured fallbacks if extraction fails
- HLS Proxy: Rewrites segments/variants through local proxy (bypasses CORS)
- Circuit Breaker: Automatic failure detection and recovery per stream
- Admin Panel: CRUD channels, trash with auto-expiry, test endpoint
- Web Player: Built-in HTML5 player using hls.js
- i18n: English and Spanish translations
- LibreJS Compliant: All JavaScript files declare
@licenseheaders - Docker Support: Ready-to-deploy with docker-compose
- Dynamic Config: Channels stored in
channels.json, no code changes needed
Admin Panel
The admin panel allows managing channels at runtime without code changes:
- Add/edit/delete channels
- Toggle channels on/off
- Test channel extraction
- Trash with 3-minute auto-delete
- Built-in channels are protected from deletion
# Set admin password (required for production)
export ADMIN_PASSWORD=your_secure_password
Troubleshooting
If a Channel Stops Working
-
Force re-extraction via API:
curl http://localhost:5000/api/extract/panamericana -
Check status:
curl http://localhost:5000/api/status | python3 -m json.tool -
Reset circuit breakers:
curl -X POST http://localhost:5000/api/circuit-breaker/reset -
Restart the application:
docker-compose restart live-stream-generator
Check Logs
docker logs live-stream-generator
Look for [WARN], [ERROR], or status codes on stream URLs.
VLC Usage
- Open VLC Media Player
- Media > Open Network Stream
- Enter:
http://localhost:5000/proxy/panamericana/playlist.m3u8 - Click Play
API Examples
# Get channel status
curl http://localhost:5000/api/status
# Force extraction for a channel
curl http://localhost:5000/api/extract/panamericana
# Refresh all channels
curl http://localhost:5000/api/refresh
License
Copyright (C) 2026 Astounds
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Full license text in LICENSE.
LibreJS
All JavaScript in this application is free/libre software. See the /librejs page for a complete list of scripts and their licenses. Enable LibreJS in your browser to verify.
Source Code
- Repository: https://git.fridu.us/heckyel/live-stream-generator
- License: GNU AGPLv3