"""Headless-browser playback verification for extracted streams. The basic health checker (backend/health.py) only validates m3u8 syntax. For embed/iframe streams it has nothing to check — the previous code blindly marked every embed `is_live=True`, which meant the stream list was full of news articles and aggregator landing pages that never actually played. This module loads each candidate stream URL in headless Chromium (via Playwright) and looks for *codec-independent* signals that the upstream serves a playable stream: - For m3u8: hls.js receives MANIFEST_PARSED + at least one FRAG_LOADED event. We don't wait for `