Skip to content

Filter non-watch YouTube Takeout activity - #494

Merged
karlicoss merged 1 commit into
karlicoss:masterfrom
AndrewSB:agent/fix-youtube-takeout-filtering
Jul 22, 2026
Merged

Filter non-watch YouTube Takeout activity#494
karlicoss merged 1 commit into
karlicoss:masterfrom
AndrewSB:agent/fix-youtube-takeout-filtering

Conversation

@AndrewSB

Copy link
Copy Markdown
Contributor

What changed

  • recognize standard YouTube watch URLs across bare, www, and mobile hosts
  • recognize YouTube Shorts as watch-history entries
  • retain deleted/private watch records whose v parameter is present but blank
  • require the Takeout activity title to explicitly identify a watch, so shares, reactions, advertiser visits, subscriptions, and account events are not emitted as Watched

Root cause

The Takeout normalizer treated nearly every activity attributed to YouTube as watch history, then validated it with a literal ://www.youtube.com/watch?v= substring. Current Takeout data includes Shorts and non-watch YouTube activities, so valid Shorts raised RuntimeError while unrelated activity was either raised as an error or silently counted as a watch.

Impact

Consumers get a cleaner watch-history stream, including Shorts, without losing deleted/private-video placeholders.

Checks

  • uv run --group testing --with google-takeout-parser pytest -o addopts='' -q src/my/tests/youtube.py — 2 passed
  • uv run --group testing ruff check src/my/youtube/takeout.py src/my/tests/youtube.py — passed
  • uv run --group testing ruff format --check src/my/youtube/takeout.py src/my/tests/youtube.py — passed

Full private Takeout audit using the parser fix from purarue/google_takeout_parser#95:

  • 350,849 parsed events; 0 parser errors
  • before: 72,286 watches; 15 YouTube RuntimeErrors
  • after: 72,278 watches; 0 YouTube errors
  • one valid Short recovered
  • 14 erroring non-watch activities skipped
  • 9 additional non-watch interactions no longer silently counted as watches
  • all 7,142 deleted/private-video placeholders retained

The aggregate proof report contains no personal event content. SHA-256: 74f560123787827dcb96e10bda2d1508d17656d85bbe47bbbf77c96583f47048.

@AndrewSB
AndrewSB marked this pull request as ready for review July 18, 2026 21:35
@AndrewSB

Copy link
Copy Markdown
Contributor Author

hey @karlicoss! this was done by AI, but I've validated the change after it's successfully parsed the youtube section of my takeout

happy to make any edits you'd like

@karlicoss

karlicoss commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Hey, thank you! Looks good :)

@karlicoss
karlicoss merged commit 9440e86 into karlicoss:master Jul 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants