Commit Graph

4 Commits (325ad0352e8c87f738d5b43edd31a87051351a24)

Author SHA1 Message Date
Kálmán „KAMI” Szalai 72b7c7e076 Restore official geo-blocked RAI streams alongside the CloudFront mirror
Fixes #1179.

PR #1166 moved Rai 1, Rai 2, Rai 3, Rai Premium, Rai Storia and Rai
Scuola from the official mediapolis.rai.it relinker to a third-party
CloudFront mirror, because the relinker had become Italy-IP-gated and
was failing for everyone else (including the CI checker). That mirror
works for casual viewing, but as #1179 reports, it goes black during
broadcasts where RAI only holds domestic rights (e.g. EuroVolley) -
the official stream keeps working correctly for Italian-IP viewers
through exactly those broadcasts, because it's RAI's own domestic
feed, not a re-mirror of it.

Rather than trade one gap for the other, add the official mediapolis
URL back as a second, Ⓖ-marked entry for each of the six channels -
the same "CDN mirror as the general-access entry, official relinker
as the geo-gated alternative" split this file already uses for every
other Rai channel (Rai 4, Rai 5, Rai Movie, Rai Sport, etc., all still
on mediapolis.rai.it + Ⓖ). Viewers with an Italian IP get the more
correct source; everyone else keeps the mirror that already works for
them.

Also fixes a real gap in check_channels.py found while verifying this:
mediapolis.rai.it's relinker doesn't refuse an out-of-territory request
with an HTTP error - it answers 200 with a real MP4, but the file is
always the same "video_no_available.mp4" decoy regardless of which
channel was asked for. The checker had no way to tell that apart from
a working stream failing its playlist-header check, so every
mediapolis.rai.it entry (the pre-existing Rai 4/5/Movie/Sport ones
included) was scored `dead` instead of `blocked`, right down to the
newly-fixed pr_check.yml workflow that now hard-fails a PR over a
`dead`-scored touched channel. Added a check for this specific decoy
redirect target, classified as `blocked` like any other geo-refusal.

Regenerated playlist.m3u8 and playlists/playlist_italy.m3u8 via
make_playlist.py. pylint check_channels.py: 10.00/10.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Enus8N247jHM5r5Som5JuU
2026-09-06 21:09:12 +02:00
Kálmán „KAMI” Szalai b05f8ef87f Recognize raw audio/video streams, not just playlists, as alive
Some radio stations serve the live audio directly at the listed URL
(Content-Type: audio/mpeg, audio/aacp, etc.) rather than an HLS/DASH
manifest that points to one. probe() only checked for #EXTM3U/<MPD in
the response body, so every one of these was misclassified as dead
regardless of whether the station actually worked.

Found while verifying replacement URLs for Irish radio stations: curl
confirmed real audio bytes with correct audio/* Content-Type on all of
them, but check_channels.py reported every single one as dead. Now
checks the response's Content-Type first; a direct audio/video stream
counts as alive without needing playlist syntax. Verified this doesn't
regress playlist detection (existing HLS/DASH channels still classify
correctly).
2026-09-05 20:55:54 +02:00
Kálmán „KAMI” Szalai 017955ad9e Fix crash on IncompleteRead, which killed the first live run
The first scheduled run of #1157's workflows failed outright: a server
started a chunked HTTP response and then hung up mid-chunk, which
urllib surfaces as http.client.IncompleteRead - a subclass of
http.client.HTTPException, not of OSError/URLError/ValueError, so
probe()'s except clause let it propagate and took the whole run down
before it wrote anything to --json, including check_channels_fast.yml's
run.jsonl.

Catch http.client.HTTPException alongside the existing exceptions and
treat it as unreachable, same as any other broken connection. Verified
against the exact exception (mocked) and against the live lists.
2026-09-04 11:49:36 +02:00
Kálmán „KAMI” Szalai a86fb23e94 Add channel checker, scheduled health checks, and a status dashboard
Builds on the idea in #1145 (a checker that maps failures back to a channel
and list, and tells a geo-blocked channel from a dead one) with a few
additions:

check_channels.py
- Standard library only, same as #1145's version.
- Adds a `disputed` state: an optional --confirm-dead pass gives ffprobe a
  second opinion on anything that looks dead over HTTP, before it gets
  reported as dead. This is one-directional (can only pull a verdict out
  of `dead`, never push one into it) because ffprobe itself is not
  reliable enough to trust in the other direction - a known-good DASH
  channel needed longer than any sane per-channel budget to open while
  testing this, and a header check alone had already been fooled by an
  isolated media fragment sitting at a URL that looked like a live channel
  (a mistake made and caught while triaging #1149/#1151 - see the
  docstring for the details).
- Restructured to share one worker pool across every list in a run
  instead of a fresh pool per list, which stopped small lists from paying
  the same wall-clock floor as large ones; a full run across all lists
  dropped from not finishing in 15 minutes to about 10.
- --json writes one record per channel per run, for building a history.

generate_dashboard.py
- Turns that history into a single self-contained docs/index.html: current
  state breakdown, an alive-share trend across every run kept, a per-list
  breakdown, and a searchable/filterable table of everything that is not
  currently alive.

Two new scheduled workflows
- check_channels_fast.yml: every 6 hours, HTTP checks only.
- check_channels_deep.yml: every 2 days, with --confirm-dead (needs ffmpeg).
Both append to .github/checker-history/history.jsonl (pruned to 90 days),
then build and deploy the dashboard to GitHub Pages.
2026-09-04 10:21:37 +02:00