From 700f63da903d3b02b4dfb0e040687cbccab1ba14 Mon Sep 17 00:00:00 2001 From: Vitor Simoes Date: Tue, 13 Oct 2026 23:01:38 +0100 Subject: [PATCH] Add Enigma2/OpenWebif M3U support: program mapping and zap-before-streaming - Parse #EXTVLCOPT:program=N from M3U playlists (both full and streaming parsers, per channel, strict mode) and store it on playlist items - Transcode multi-program MPEG-TS streams by mapping only the selected program's first video and audio stream (DVB teletext/subtitles in the program otherwise make FFmpeg fail to produce HLS) - Optional per-source "zap before streaming" with configurable delay: POST /api/openwebif/zap takes sourceId + streamId, requires an enabled, zap-enabled M3U source containing that channel, derives the receiver from the configured source URL (never from the client), validates the Enigma2 service reference, uses a timeout without redirects and does not echo the receiver response - Live TV: Stop button, and stop playback when leaving the page - Tests for ordinary and program-tagged playlists and the zap endpoint Co-Authored-By: Claude Opus 5.5 --- public/index.html | 14 ++- public/js/components/ChannelList.js | 5 + public/js/components/SourceManager.js | 27 +++++- public/js/components/VideoPlayer.js | 50 +++++++++- public/js/pages/LivePage.js | 2 + public/js/pages/WatchPage.js | 3 + server/db/sqlite.js | 7 ++ server/index.js | 1 + server/routes/openwebif.js | 70 ++++++++++++++ server/routes/sources.js | 8 +- server/routes/transcode.js | 7 +- server/services/m3uParser.js | 18 ++++ server/services/m3uXtreamAdapter.js | 2 + server/services/syncService.js | 8 +- server/services/transcodeSession.js | 11 ++- test/m3u-parser.test.js | 70 ++++++++++++++ test/openwebif-zap.test.js | 131 ++++++++++++++++++++++++++ 17 files changed, 415 insertions(+), 19 deletions(-) create mode 100644 server/routes/openwebif.js create mode 100644 test/m3u-parser.test.js create mode 100644 test/openwebif-zap.test.js diff --git a/public/index.html b/public/index.html index 4f05822..540d0ba 100644 --- a/public/index.html +++ b/public/index.html @@ -200,6 +200,12 @@ + +