No description
- Python 62.4%
- HTML 14.6%
- CSS 11.3%
- JavaScript 7.7%
- Dockerfile 2.4%
- Other 1.6%
| .gitea/workflows | ||
| docs | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .env.sample | ||
| .gitignore | ||
| babel.cfg | ||
| channels.json | ||
| docker-compose.yml | ||
| Dockerfile | ||
| 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
Project Structure
live-generator/
├── run.py # Main entry point
├── requirements.txt # Python dependencies
├── README.md # This file
├── babel.cfg # Babel configuration
├── messages.pot # Translation template
├── Makefile # Build commands
├── pytest.ini # Pytest configuration
├── Dockerfile # Docker image
├── .dockerignore # Docker ignore rules
└── src/
├── __init__.py
├── app.py # Flask application
├── config/
│ ├── __init__.py
│ └── settings.py # Configuration and channels
├── extractors/
│ ├── __init__.py
│ ├── base.py # Base extractor class
│ ├── iblups.py # IBLUPS extractor (Panamericana)
│ └── dps.py # DPS extractor (Latina)
├── proxy/
│ ├── __init__.py
│ ├── manager.py # Channel manager
│ └── stream_manager.py # HLS stream proxy
├── templates/ # HTML templates
│ ├── index.html # Home page
│ └── web_player.html # Web player page
├── static/ # Static assets
│ └── css/
│ ├── style.css # Main stylesheet
│ └── web-player.css # Web player styles
└── translations/ # i18n translations
├── en/
│ └── LC_MESSAGES/
│ └── messages.mo
└── es/
└── LC_MESSAGES/
└── messages.mo
tests/
├── __init__.py
├── test_config.py # Configuration tests
├── test_extractors.py # Extractor unit tests
└── test_app.py # Integration tests
Installation
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
Usage
# Activate virtual environment
source venv/bin/activate
# Run the application
python run.py
The server will start at http://localhost:5000
Endpoints
| Endpoint | Description |
|---|---|
/ |
Web UI with channel information |
/list/list.m3u8 |
Complete M3U8 playlist |
/proxy/[channel]/playlist.m3u8 |
HLS proxy for VLC |
/proxy/[channel]/ts?src=URL |
Video segment proxy |
/web/[channel] |
HTML5 web player |
/api/status |
Channel status (JSON) |
/api/extract/[channel] |
Force hash extraction |
/api/refresh |
Refresh all channels |
Channels
Panamericana TV
- Type: IBLUPS
- Source: https://panamericana.pe/tvenvivo
- Extracts hash from: https://iblups.com/embed/panamericanape
Latina TV
- Type: DPS (DigitalProServer)
- Source: https://www.latina.pe/tvenvivo
- Extracts hash and tokens from rudo.video scripts
Features
- Dynamic Extraction: Hashes and tokens are extracted automatically from official sources
- Fallback Values: Pre-configured fallbacks if extraction fails
- HLS Proxy: Local proxy for CORS and region restrictions
- Web Player: Built-in HTML5 player using hls.js
- Caching: 2-minute cache to reduce requests
Troubleshooting
If a Channel Stops Working
If a channel shows "Pending" status or fails to play, the hash may have changed.
Quick Fix (2 minutes):
-
Open the channel's official website in your browser:
- Panamericana: https://panamericana.pe/tvenvivo
- Latina: https://www.latina.pe/tvenvivo
- TV Perú: https://www.irtpplay.gob.pe/tvperu/envivo
-
Open Developer Tools (F12) → Network tab
-
Reload the page and filter by:
rudo.videooriblups.com -
Copy the hash from the URL:
https://redirector.rudo.video/mix/register/777b4d4cc0984575a7d14f6ee57dbcaf7/... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This is the hash (40 characters) -
Update
src/config/settings.py:KNOWN_HASHES = { "tvperu": "NEW_HASH_HERE", # ... } -
Restart the application:
docker-compose restart live-stream-generator -
Force refresh via API:
curl http://localhost:5000/api/refresh
Check Logs
docker logs live-stream-generator
Look for errors or "404" 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
Notes
- This application is for personal and educational use only
- Ensure compliance with local copyright laws
- Stream URLs may change; fallbacks are provided for reliability