Skip to content

Add ARD and ZDF crawler clients - #34

Merged
ChrisonSimtian merged 4 commits into
mainfrom
feat/ard-crawler-live-tests
Jul 26, 2026
Merged

Add ARD and ZDF crawler clients#34
ChrisonSimtian merged 4 commits into
mainfrom
feat/ard-crawler-live-tests

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Contributor

The first real crawler slice — proves search + fetch against the live ARD Mediathek API, with your shows as the acceptance cases.

What's here

  • Infrastructure/Crawling/Ard/ArdCatalogClient — resolves shows the way the site actually does it. ARD's search-system returns sparse refs that don't resolve, so it walks the A-Z catalog (letter widget id = base64("<Brand>.<letter>")) → filters by title → the editorial show page → the "Ganze Folgen" gridlist. Parameterised by catalog scope: ard and kika (KiKA runs on the same platform — DR-010 / KiKA scoping within the ARD client #10). Light transient retry.
  • tests/Live.Tests — real-network tests, [Trait("Category","Live")]:
    • ARD "Extra 3" — search finds it; fetch full episodes (asserts the extra 3 vom … full-episode with >20 min runtime).
    • KiKA "Biene Maja" — search finds it via the kika scope; fetch episodes.
    • Download[Skip] (long-running + storage; needs stream-resolve + ffmpeg — next slice), exactly as you asked.
    • Runs sequentially so they don't self-throttle the API.
  • Fallout: the CI Test target now filters out Category=Live (external APIs drift/rate-limit → not your bug), and a new TestLive target runs only them: ./build.cmd TestLive.

Verified

  • ./build.cmd Test62 deterministic tests green, live excluded (this is what CI runs).
  • ./build.cmd TestLive4 live pass + 1 skip against the real ARD/KiKA API.

Next

ZDF "Heute Show" (GraphQL + token + PTMD — the complex one), the download slice (stream-resolve → ffmpeg), and wiring the crawl Actions into the agents.

Note: repo is now rebase-merge only.

ChrisonSimtian and others added 2 commits July 26, 2026 16:05
First real crawler slice — proves search + fetch against the live ARD Mediathek API.

- Infrastructure/Crawling/Ard/ArdCatalogClient: resolves shows the way the site does
  (ARD's search-system returns sparse, non-resolving refs). Walks the A-Z catalog
  (letter widget id = base64("<Brand>.<letter>")) → filters by title → the editorial
  show page → the "Ganze Folgen" gridlist. Parameterised by catalog scope: `ard` and
  `kika` (KiKA runs on the same platform, DR-010/#10). Light transient retry.
- tests/Live.Tests: real-network tests tagged [Trait("Category","Live")]:
  - ARD "Extra 3": search finds it; fetch full episodes with sane metadata.
  - KiKA "Biene Maja": search finds it (kika scope); fetch episodes.
  - Download: [Skip] (long-running + storage; needs stream-resolve + ffmpeg — next).
  Runs sequentially (no self-throttling).
- Fallout: the CI Test target now filters out Category=Live (external APIs drift), and
  a new TestLive target runs only the live tests: ./build.cmd TestLive.

Default ./build.cmd Test = 62 deterministic tests green (live excluded); ./build.cmd
TestLive = 4 live pass + 1 skip.

Next: ZDF "Heute Show" (GraphQL + token + PTMD), the download slice, and wiring the
crawl Actions into the agents.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds the ZDF broadcaster (the third acceptance show) and a genuine download.

- Infrastructure/Crawling/Zdf/ZdfCatalogClient: search via the REST /search/documents
  endpoint (episodes come back directly), then resolve a stream episode-doc →
  ptmd-template ({playerId} expansion) → PTMD priorityList → best progressive MP4.
  Carries the static Api-Auth Bearer key (rotates; documented). Transient retry.
- tests/Live.Tests ZdfLiveTests [Live]:
  - "Heute Show": search finds episodes; resolve a progressive MP4;
  - Downloads_a_HeuteShow_episode — REAL download of the resolved MP4, bounded to ~5 MB
    (fast + small), verified by size + the MP4 'ftyp' signature, then cleaned up.

Full live suite (./build.cmd TestLive): 7 pass + 1 skip (the ARD download placeholder,
kept until ARD stream-resolve lands). CI Test run unchanged — live still excluded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ChrisonSimtian ChrisonSimtian changed the title feat(crawl): ARD catalog client + live tests (Extra 3, KiKA Biene Maja) feat(crawl): ARD + ZDF crawler clients + live tests (search, fetch, real download) Jul 26, 2026
@ChrisonSimtian

Copy link
Copy Markdown
Contributor Author

Added ZDF Heute Show + a real download. Full live suite now (./build.cmd TestLive): 7 pass + 1 skip.

Show Search Fetch Download
ZDF Heute Show ✅ real ~5 MB, MP4 ftyp verified
ARD Extra 3 ⏭️ skip (ARD stream-resolve next)
KiKA Biene Maja

CI Test unchanged: 62 deterministic tests, live excluded.

ChrisonSimtian and others added 2 commits July 26, 2026 16:32
Not just listing/streaming — actually fetch one real full episode per broadcaster
and return the complete normalized record.

- Infrastructure/Crawling/EpisodeDetail: shared normalized episode (title, show,
  broadcaster, air date, duration, synopsis, progressive-MP4 stream, webvtt subtitle).
- ArdCatalogClient.FetchEpisodeDetailAsync(ArdEpisode): item page → metadata +
  mcV6 streams[].media[] (best video/mp4 by resolution) + subtitles (webvtt).
  Covers ARD (Extra 3) and KiKA (Biene Maja).
- ZdfCatalogClient.FetchEpisodeDetailAsync(ZdfEpisode): episode doc → title/brand/
  editorialDate/duration/leadParagraph + resolved MP4.
- tests/Live.Tests/FullEpisodeFetchTests: fetch ONE full episode per show and assert
  the complete data — Extra 3 (NDR, >20 min, synopsis, stream, subtitle), Biene Maja
  (KiKA, >5 min, stream), Heute Show (ZDF, >20 min, synopsis, stream).

TestLive: 10 pass + 1 skip. CI Test unchanged (live excluded).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Un-skips the ARD download now that FetchEpisodeDetail yields the progressive MP4.

- tests/Live.Tests/Download.VerifyRawMp4Async: shared helper — downloads the stream
  RAW (a straight byte copy of the exact MP4 the Mediathek serves; no transcoding, no
  ffmpeg — any HLS remux is a later orchestration step), bounded to ~5 MB, verified by
  the MP4 'ftyp' box.
- ARD "Extra 3" download is now a real download (was [Skip]), via the resolved
  progressive MP4 from the episode detail.

TestLive: all live green (ARD + ZDF both do a real raw download). CI Test unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit 5745f19 into main Jul 26, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the feat/ard-crawler-live-tests branch July 26, 2026 07:55
@ChrisonSimtian ChrisonSimtian added the enhancement New feature or request label Aug 2, 2026
@ChrisonSimtian ChrisonSimtian changed the title feat(crawl): ARD + ZDF crawler clients + live tests (search, fetch, real download) Add ARD and ZDF crawler clients Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant