Commit Graph
20 Commits
Author SHA1 Message Date
MichaelandClaude Opus 5 5b9eb74a84 feat(epg): source XMLTV de repli quand le panneau ne rend rien d'actuel
Le guide du fournisseur est figé sur beaucoup de revendeurs : sur le compte de
test, get_simple_data_table répond correctement mais le dernier programme
français date de deux jours, et le xmltv.php du panneau ne couvre aucune chaîne
française. Aucun correctif côté appel Xtream ne pouvait donc remplir la grille.

Nouveau service XmltvEpgService : téléchargement de dumps XMLTV publics,
décompression gzip détectée sur le nombre magique, parsing en flux via
XmlEventReader — un dump national fait 46 Mo décompressés, en charger l'arbre
DOM coûterait plusieurs centaines de mégaoctets dans le conteneur. Mesuré à
environ 1 s pour 973 chaînes. Index rafraîchi toutes les 6 h, programmes
terminés depuis plus de 6 h écartés à l'indexation.

L'appel sortant reste un dernier recours. L'ordre est inchangé —
get_simple_data_table, puis get_short_epg — et le dump n'est consulté que si
le panneau ne rend aucun programme couvrant l'instant présent : compter les
entrées ne suffisait pas, un guide périmé en renvoie des centaines. La source
se configure par EPG_XMLTV_URLS ; vider la variable supprime tout appel
sortant. La réponse porte un en-tête X-Epg-Source pour savoir qui a répondu.

Les identifiants sont rapprochés après normalisation : le dump écrit
France.2.fr là où le panneau annonce France2.fr. Repli sur le nom affiché de
la chaîne, et table stream_id vers identifiant EPG mise en cache 6 h.

Le client passe désormais par /api/epg au lieu d'appeler player_api.php en
direct. Il dupliquait le choix de l'action, la conversion des fuseaux et le
décodage base64 ; le backend le fait une fois, met en cache pour tous les
utilisateurs, et sait basculer sur le repli — bascule impossible depuis le
navigateur.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 10:48:10 +02:00
MichaelandClaude Fable 5 9595afcc99 fix(streaming): stop streams dying mid-playback
- reaper no longer kills exited sessions immediately: a finished VOD
  transcode was reaped (segments deleted) while still being watched
- reuse completed VOD/recording sessions instead of re-transcoding
- live input: add -rw_timeout 30s and -reconnect_at_eof so a stalled
  upstream triggers reconnect instead of wedging ffmpeg forever
- reaper watchdog restarts live sessions whose playlist stopped updating
- waitForPlaylist fails fast on clean ffmpeg exit without output
- direct .ts proxy: close http.Client on stream end/error (socket leak)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 14:34:31 +02:00
MichaelandClaude Fable 5 60d3f42901 feat: security hardening, streaming overhaul, design polish, tests
Security:
- Replace unsalted SHA-256 password hashing with bcrypt (lazy rehash on login)
- Add authenticated /api/xtream-api gateway: Xtream credentials are injected
  server-side and never sent to the frontend; /api/playlists no longer
  returns passwords
- Redact credentials from all logs (login body, proxy/FFmpeg/scheduler URLs)
- Add auth to recordings, EPG, season-passes and streaming routes
  (HttpOnly session cookie for hls.js; loopback bypass for local FFmpeg)
- Lock player postMessage to same-origin in both directions
- Vendor and pin hls.js 1.6.7 / mpegts.js 1.7.3 (drop CDN @latest)
- Fix rate limiter (client IP was never resolved), add login rate limit,
  restrict CORS, add CSP Report-Only, block private-IP SSRF targets,
  fix path traversal in recording log retrieval, chmod 777 -> 770
- Remove dead HiveService (seeded admin/admin into IndexedDB with SHA-256)
- Fix authMiddleware not populating 'user' context (getPlaylist ignored the
  logged-in user; admin purge always returned 403)

Streaming:
- New FfmpegSessionManager: process registry, idle reaper (4 min live /
  15 min VOD), orphan cleanup at startup, clean SIGTERM shutdown,
  fast-fail with stderr instead of 30 s timeout
- Quality selection (source/high/medium/low) for live and VOD; source mode
  streams with -c:v copy (zero transcoding); selector wired into the player
- Concurrent recordings (MAX_CONCURRENT_RECORDINGS, default 2); conflicts
  retry on the next tick instead of silently failing
- Lower live latency (HLS window 20 -> 10 segments, liveSync 10 -> 3)
- Fix recording log lookup (.mp4 vs .mkv mismatch)

Design:
- Replace hardcoded colors with AppColors tokens (12 files)
- web/theme.css syncs HTML players with the Flutter palette
- DPAD/keyboard navigation (arrow-key focus, player shortcuts)
- Tooltips on player icon buttons, Semantics on content cards
- Remove 7 dead widgets broken since the Stitch merge

Quality:
- bin/test/: 21 unit tests (bcrypt, redaction, traversal, SSRF, recording
  conflicts) plus a quality-selector widget test
- GitHub Actions CI (analyze + test + build web)
- Archive stale status docs into docs/archive/

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 10:07:18 +02:00
Michael c61984d041 feat: implement RecordingScheduler to manage scheduled recordings and automated season passes 2026-04-02 19:12:21 +02:00
Michael 1b4321d84a feat: implement SimpleRecorder service for FFmpeg-based stream recording and scheduling 2026-04-02 07:22:24 +02:00
Michael 6a4a642611 feat: implement IPTV player screen with iframe-based stream support and recordings tab widget 2026-04-01 20:19:40 +02:00
Michael fa6ae90d8d feat: add mobile-optimized IPTV player with HLS and MpegTS support 2026-03-29 10:19:36 +02:00
GitHub Copilot 2c4572191d feat(recording): implement simplified recording system with API endpoints and UI integration 2026-03-26 11:00:40 +01:00
Michael 9f3c29f6dd feat: implement Xtream API service for managing live channels, VOD, and series with caching and dynamic backend URL handling. 2026-03-10 14:57:44 +01:00
Michael 50a6998c09 feat: add EPG TV guide, season passes (auto-recording) and unified recordings/EPG tab with 3 sub-tabs 2026-03-09 08:21:48 +01:00
Michael 4762b4edf8 feat(recordings): switch output format from mp4 to mkv for better IPTV stream compatibility 2026-03-08 23:56:43 +01:00
Michael 4c2e3ce600 feat: add stop recording button and POST /api/recordings/stop/<id> endpoint to kill FFmpeg process 2026-03-08 23:53:32 +01:00
Michael 424019d01a fix(scheduler): wrap _startRecording in single try/catch to prevent server crash, fix localhost port 8080→8089 2026-03-08 23:38:57 +01:00
Michael c04acc2fab debug(scheduler): add verbose logging every 10s and force UTC datetime comparisons 2026-03-08 23:11:22 +01:00
Michael 60bb10fe4d fix(recordings): correct stream_url to use real live stream, resolve to absolute URL for FFmpeg, use copy mode, speed up scheduler to 10s 2026-03-08 22:43:42 +01:00
Michael f217622e4a fix(recording): create log file before ffmpeg starts to capture boot exceptions and force absolute path 2026-03-08 20:50:38 +01:00
Michael 966311f560 feat(recording): add ffmpeg logs writing and viewing in UI 2026-03-08 19:26:54 +01:00
Michael 2180572b92 feat: implement live tv recording system 2026-03-08 08:40:55 +01:00
Michael 6a71f58a36 feat: add new UI tabs for movies and series, including mobile-specific versions with search and pagination. 2025-12-08 20:43:41 +01:00
Michael d1fbfe0f1e feat: Add initial server implementation with API routing, security middleware, and a file cleanup service. 2025-12-07 22:49:29 +01:00