check_channels.py's exit code reflects every dead channel across the
whole list file it was pointed at, not just the ones a PR added or
changed. Since pr_check.yml ran the checker directly and let its exit
code decide the job's pass/fail, any PR touching a list that already
had pre-existing dead entries (which is most of them - dozens of
already-known-broken channels exist across these lists) got a red X
for something it never caused, even though the workflow's own summary
step already computed the right "touched vs already broken" split.
Fixes this by:
- letting the check step run to completion regardless of its exit
code (the checker's own verdict on the whole file isn't this job's
call to make)
- moving pass/fail into the summarize step, which already has the
touched/others split: the job now fails only when a channel this PR
itself added or changed comes back `dead`
- deliberately not failing on `blocked`/`unreachable`/`flaky` for
touched channels either - these have real false-positive rates from
the runner's own network (geo-blocks, a datacenter IP some providers
reject, one slow probe), which is exactly why the *Channel check
(deep)* workflow exists to give `dead`-looking channels a second
opinion before anyone acts on them
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Enus8N247jHM5r5Som5JuU
Replaces iptv-checker (npm + ffmpeg) with check_channels.py:
- Checks every channel in a list a PR touches, existing and new, not just
the added/changed rows - a PR editing italy.md now surfaces already-dead
channels in italy.md too, not only the one line it changed.
- Uses check_channels.py's dead/blocked/unreachable/flaky states instead
of a binary online/failed, so the summary no longer needs the "some of
these failures are geo-blocks, use your judgment" disclaimer without
telling reviewers which failures those are - blocked channels are now
named as such.
- Summary separates what the PR actually added/changed from what was
already broken in the same file, so a reviewer isn't left guessing
whether a failure is theirs to fix.
- No ffprobe pass here (kept fast for a PR gate) - anything this flags as
dead gets a second opinion from the scheduled Channel check (deep)
workflow before anyone acts on it.
Verified end to end against a simulated PR diff.
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.
Stores the failed-channel snapshot as a workflow artifact (90-day
retention) and downloads the previous run's artifact for comparison,
instead of committing a state file back to the repo.
Weekly trend workflow: runs the full iptv-checker weekly, keeps a
snapshot of failed URLs in .github/checker-history/failed.txt, and
reports newly-broken vs newly-recovered channels since the last run
in the job summary.
PR check workflow: on any PR touching lists/*.md, extracts only the
added/changed stream links from the diff and checks just those (not
the whole 2000+ channel playlist), reporting online/failed results
directly in the PR's Checks summary.
The config's files list still referenced the README's placeholder
filenames (playlist1.m3u, playlist2.m3u), which don't exist in this
repo, so the linter was silently checking nothing. Point it at the
real playlist.m3u8, drop the noisy full-file cat dump, and surface
its output in the job summary like the iptv-checker step.
Add a job summary listing the failed channels and upload the full
online.m3u/failed.m3u results as a build artifact, instead of running
the checker and discarding its output.
* Improve make_playlist.py code quality and fix bugs
- Fix group name bug: replace underscores with spaces before title()
so filenames like north_korea.md produce "North Korea" not "North_Korea"
- Fix resource leaks: use context managers for all file handles including
EPG list and per-country playlist files
- Remove os.chdir() global side effect: use absolute paths derived from
the script location instead
- Avoid calling to_m3u_line() twice per channel by caching the result
- Fix redundant trailing colon in filename[:-3:] slice
- Consistent use of write() for headers instead of mixing print/write
- Strip blank lines from EPG URL list when reading
* Skip commit and push when playlist has no changes
Prevents the workflow from failing with exit code 1 when the generated
playlist is identical to the previous run and there is nothing to commit.
* Use current branch instead of hardcoded master for push
Replace hardcoded origin/master reference with @{u} (upstream of current
branch) for the diff check, and use HEAD for the push target so the
workflow works correctly on any branch.
---------
Co-authored-by: Kálmán „KAMI” Szalai <kami911gmail.com>