No description
  • Python 63.7%
  • HTML 35.8%
  • Dockerfile 0.5%
Find a file
Midas van Oene 1dc8a997e7
All checks were successful
Build and Publish / build (push) Successful in 5m27s
fix(auth): auto re-login bij verlopen NPO-sessie
Een langlopend serve-proces logde maar één keer per serverleven in en
ververste de sessie nooit. Na verloop van tijd (de session-token verloopt)
viel stream-capture terug op de anonieme plus-paywall, waardoor de player
nooit een stream-link request deed → 30s timeouts en mislukte downloads die
alleen met een handmatige herstart op te lossen waren.

- auth: invalidate() (met min_age-guard tegen login-thrashing) +
  ensure_valid_session() proactieve check met double-checked locking, en
  _login() zet nu daadwerkelijk self._client.
- stream: paywall-detectie -> gerichte SessionExpiredError i.p.v. blinde
  timeout; robuustere wait (profile/player/paywall/unknown); profielselectie
  via accessible-name; debug-screenshot bij falen; cookies lazy via callable
  zodat een mid-run re-login verse cookies oppikt.
- web/pipeline: _run_prep logt opnieuw in bij SessionExpiredError; web-queue
  en CLI roepen ensure_valid_session() aan vóór stream-capture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 18:30:16 +02:00
.forgejo/workflows chore(deps): update python docker tag to v3.14 2026-04-10 11:16:06 +02:00
docs/superpowers fix films 2026-03-23 00:02:33 +01:00
src/npo_dl_ng fix(auth): auto re-login bij verlopen NPO-sessie 2026-06-28 18:30:16 +02:00
tests feat: add download_history table and record/get functions 2026-03-22 23:23:11 +01:00
.env.example chore: parametrize docker-compose paths via env vars 2026-03-22 20:33:27 +01:00
.gitignore first commit 2026-03-21 23:32:07 +01:00
.pre-commit-config.yaml ci: add pre-commit config with ruff hooks 2026-03-22 22:51:26 +01:00
CLAUDE.md first commit 2026-03-21 23:32:07 +01:00
docker-compose.yaml chore: parametrize docker-compose paths via env vars 2026-03-22 20:33:27 +01:00
Dockerfile chore(deps): update python docker tag to v3.14 2026-04-10 11:16:06 +02:00
pyproject.toml fix: remove spurious f-string prefix, suppress intentional import order in conftest 2026-03-22 21:03:08 +01:00
README.md first commit 2026-03-21 23:32:07 +01:00
renovate.json Add renovate.json 2026-04-03 20:42:41 +00:00
uv.lock docs: design spec voor #16 ETA + #18 download geschiedenis 2026-03-22 23:07:59 +01:00

npo-dl-ng

Python rewrite of npo-dl. Zelfde functionaliteit, kleinere Docker image (~300MB vs ~1.5GB), native pywidevine.

Vereisten

  • Python 3.11+
  • uv
  • Een Widevine device file (.wvd)
  • NPO Start account

Installatie

uv pip install -e ".[web,browser]"
playwright install chromium

Configuratie

Kopieer .env.example naar .env en vul in:

NPO_EMAIL=your@email.nl
NPO_PASSWORD=yourpassword
WVD_PATH=/pad/naar/cdm.wvd
OUTPUT_DIR=./videos           # standaard
MAX_CONCURRENT_DOWNLOADS=3    # standaard

Gebruik

# Info over een serie
npo-dl-ng info "https://npo.nl/start/serie/<slug>"

# Lijst alle afleveringen
npo-dl-ng series "https://npo.nl/start/serie/<slug>"

# Download één aflevering
npo-dl-ng download "https://npo.nl/start/serie/<slug>/afleveringen/<seizoen>/<slug>"

# Web UI op http://localhost:8000
npo-dl-ng serve
npo-dl-ng serve --port 9000

Docker

docker compose up

Zet in docker-compose.yaml de juiste paden voor je .env en .wvd.