diff --git a/.github/workflows/check_channels_deep.yml b/.github/workflows/check_channels_deep.yml index 75204d9..85db648 100644 --- a/.github/workflows/check_channels_deep.yml +++ b/.github/workflows/check_channels_deep.yml @@ -28,7 +28,7 @@ jobs: - name: Run the deep check (HTTP probes + ffprobe confirmation on dead channels) run: | - python3 check_channels.py --attempts 3 --timeout 12 --pause 5 --workers 40 --confirm-dead --json run.jsonl | tee check_summary.txt + python3 check_channels.py --attempts 3 --timeout 12 --pause 5 --workers 40 --confirm-dead --include-invalid --json run.jsonl | tee check_summary.txt - name: Append to history and prune entries older than 90 days run: | @@ -73,7 +73,7 @@ jobs: { echo "## Deep channel check - $(date -u +%Y-%m-%dT%H:%M:%SZ)" echo "" - echo "Channels that looked \`dead\` over HTTP were given a second opinion by \`ffprobe\`. A channel still reported \`dead\` here survived both checks and is safe to act on; one reported \`disputed\` looked dead over HTTP but ffprobe found a real stream behind it - needs a human look, not an automatic edit." + echo "Channels that looked \`dead\` over HTTP were given a second opinion by \`ffprobe\`. A channel still reported \`dead\` here survived both checks and is safe to act on; one reported \`disputed\` looked dead over HTTP but ffprobe found a real stream behind it - needs a human look, not an automatic edit. This run also re-checks every channel already flagged Invalid (\`--include-invalid\`) - one reported \`RECOVERED?\` answered like a live stream again and shows up on the dashboard's own 'Flagged Invalid, answering again' section, also pending a human look before anyone restores it." echo "" echo '```' cat check_summary.txt diff --git a/generate_dashboard.py b/generate_dashboard.py index 49c518d..1841bcd 100644 --- a/generate_dashboard.py +++ b/generate_dashboard.py @@ -12,10 +12,20 @@ The page shows: - a trend of the alive share across every run kept in the history - one row per list (country) with its current breakdown - every channel that is not currently `alive`, searchable and filterable by state + - any channel flagged Invalid in the lists that answered like a live stream again, + if the history has rows for those (see check_channels.py's --invalid/--include-invalid) "Currently" means: for each (list, channel), the most recent row in the history - older rows for the same channel are trend data, not part of today's snapshot. +A row's `marker` says whether it came from a working (`>`) or an Invalid (`x`) list +entry; older history written before that field existed has no `marker` and is always +treated as `>`, since only working channels were ever checked back then. Every count +above - the state breakdown, the trend, the by-list table, "needs attention" - is +built from `>` rows only, so turning on --include-invalid in a workflow never changes +what those numbers mean; the `x` rows only ever feed the separate "flagged Invalid" +section below them. + Usage: ./generate_dashboard.py # reads the default history path ./generate_dashboard.py --history path/to.jsonl --out path/to.html @@ -32,6 +42,15 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) DEFAULT_HISTORY = os.path.join(BASE_DIR, ".github", "checker-history", "history.jsonl") DEFAULT_OUT = os.path.join(BASE_DIR, "docs", "index.html") +# history written before check_channels.py recorded `marker` has none - it only ever +# checked working channels back then, so the absence of the field means `>` too +WORKING = ">" + + +def marker_of(row): + """Return `row`'s marker, treating pre-`marker` history as a working (`>`) row.""" + return row.get("marker", WORKING) + # rendering order and the CSS custom property carrying each state's color STATE_ORDER = ["alive", "flaky", "blocked", "unreachable", "disputed", "dead"] STATE_VAR = {s: f"var(--s-{s})" for s in STATE_ORDER} @@ -236,13 +255,43 @@ def build_problem_rows(current): return "".join(rows) -def render(history_path, generated_at): +def build_recovered_rows(recovered): + """Return one `
{total_channels} channels · {len(by_list)} lists · last swept {escape(last_checked)} · page built {escape(generated_at)}
+{total_channels} channels · {len(by_list)} lists{recovered_subline} · last swept {escape(last_checked)} · page built {escape(generated_at)}
Channels sitting on an [x] row that answered like a live stream when a workflow last ran check_channels.py with --invalid or --include-invalid. Not proof the source is back for good - a single good answer can be a flaky CDN having a moment, not a restored channel - so this is a shortlist to look at by hand, not something to auto-restore.
| List | Channel | State | URL | Last checked |
|---|---|---|---|---|
| none right now | ||||