No description
  • Python 60.4%
  • HTML 16.6%
  • CSS 10.3%
  • JavaScript 9.7%
  • Dockerfile 1.8%
  • Other 1.2%
Find a file
Astounds 0395d1289b
All checks were successful
release / test (push) Successful in 5m5s
release / release-default (push) Successful in 17m44s
multiples fixes
2026-06-14 13:28:48 -05:00
.gitea/workflows update workflow 2026-05-19 22:38:15 -05:00
docs fix: correct inconsistent Spanish translations, regenerate from scratch 2026-06-02 20:26:34 -05:00
src multiples fixes 2026-06-14 13:28:48 -05:00
tests feat: proxy all channel types through local proxy for Jellyfin compatibility 2026-06-06 22:14:09 -05:00
.dockerignore initial commit 2026-03-15 11:49:00 -05:00
.env.sample fix: docker-compose.yml - add channels.json volume 2026-03-15 21:23:42 -05:00
.gitignore multiples fixes 2026-06-14 13:28:48 -05:00
babel.cfg feat: add admin panel with enhanced security and 2026-03-15 20:55:10 -05:00
channels.json multiples fixes 2026-06-14 13:28:48 -05:00
docker-compose.yml fix: docker-compose.yml - add channels.json volume 2026-03-15 21:23:42 -05:00
Dockerfile Revert base64, and add gunicorn 2026-05-20 00:10:57 -05:00
LICENSE Add License 2026-06-01 20:57:16 -05:00
Makefile initial commit 2026-03-15 11:49:00 -05:00
pytest.ini fix: correct inconsistent Spanish translations, regenerate from scratch 2026-06-02 20:26:34 -05:00
README.md update README.md 2026-06-01 21:23:14 -05:00
requirements-dev.txt ci: add test job with requirements-dev.txt 2026-03-15 14:47:29 -05:00
requirements.txt multiples fixes 2026-06-14 13:28:48 -05:00
run.py multiples fixes 2026-06-14 13:28:48 -05:00

Live Stream Generator

HLS M3U8 playlist generator for legal TV channels.

License: AGPLv3 JavaScript

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:


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

Latina TV

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

TV Perú

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 @license headers
  • 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

  1. Force re-extraction via API:

    curl http://localhost:5000/api/extract/panamericana
    
  2. Check status:

    curl http://localhost:5000/api/status | python3 -m json.tool
    
  3. Reset circuit breakers:

    curl -X POST http://localhost:5000/api/circuit-breaker/reset
    
  4. 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

  1. Open VLC Media Player
  2. Media > Open Network Stream
  3. Enter: http://localhost:5000/proxy/panamericana/playlist.m3u8
  4. 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