Skip to content

feat(streaming): count Netflix, Crunchyroll, Prime Video and Disney+ - #60

Merged
joaquinmuzzi merged 1 commit into
mainfrom
feat/streaming-sites
Nov 23, 2026
Merged

joaquinmuzzi merged 1 commit into
mainfrom
feat/streaming-sites

Conversation

@joaquinmuzzi

Copy link
Copy Markdown
Owner

What

Task 2.7 of the plan: Netflix, Crunchyroll, Prime Video and Disney+ count in the target language without the immersion profile.

  • Settings → "Count streaming sites": one switch per site, off by default. Turning one on asks, from the click, for scripting and that site's pages only (extension/src/sites.js). Both are inside the optional scripting and <all_urls> the manifest already declares, so 0.2.0 shows no new install warning and the manifest only gains a web_accessible_resources entry.
  • The background script registers two scripts per site while it is on (scheduleStreaming): streaming-bridge.js (world MAIN, copies plain values from the player; no requests, no hooks, never writes to the page) and streaming-content.js (counts with the existing Watcher, delivery.js, overrides and ad handling).
  • extension/src/streaming.js: pure readers per site → { key, title, audioLanguage, subtitleLanguages, ad }. The audio track decides; subtitles never do. A player that cannot be read counts nothing (fails closed).
  • Crunchyroll's player is an iframe on static.crunchyroll.com; the frame tells the page whether its video plays (origin checked).
  • Time goes to a web item per episode (web:<hash> of https://www.netflix.com/watch/<id> …), named in the day's list. The popup now shows the title under the status (YouTube too). The popup's correction works per episode.
  • In the immersion profile, generic.js leaves a page counted by the streaming script alone (no double naming).
  • Prime Video and Disney+ are labelled "(experimental)" in the settings.
  • No stored shape changed (new key streamingSites; web items as before), so no STORAGE_VERSION bump.

Docs: docs/streaming.md (investigation per site, sources, verified vs inferred, hand-check steps), PRIVACY.md (new "Streaming sites" section), store listing (description, single purpose, justification rows, why per-site optional permissions), README, CHANGELOG, plan (2.7 ticked + note).

Why

The announcement (3.2) waits for this: many learners watch Netflix and Crunchyroll.

Testing

  • npm test (384 pass; new tests/streaming.test.js, tests/sites.test.js, a status test), npm run lint, npm run format:check, npm run lint:firefox (0 errors, the known Android warning).
  • Crunchyroll, real site, logged out (2026-11-23): the store holds content.media.byId[watch.id].audioLocale (ja-JP for the original, es-419 for the dub); the bridge's store lookup found it. The test data is that capture. Every episode was premium-only, so nothing played.
  • Counting, Chrome 157 via CDP: the extension loaded with Crunchyroll on; a page with the captured store shape served at the watch address (only in that test browser, since the real site shows a bot check to an automated browser) and a playing <video>: 11 s counted under "One Piece E1 - …" with Spanish as target, nothing more after switching to Japanese; with the video in a static.crunchyroll.com iframe, 33 s. Turning the site off unregistered its scripts.
  • Not checked: real playback on any of the four, ads on any of them, Netflix/Prime Video/Disney+ data from a real player (Netflix from LingoFlix's published probe; Prime Video and Disney+ from one open-source tool each), Firefox.

Please check by hand with your accounts (Chrome, unpacked)

For each of Netflix and Crunchyroll (and Prime Video / Disney+ if you have them):

  1. Dashboard → Settings → "Count streaming sites": turn the site on, allow the access.
  2. Play a title whose audio is in your target language for a minute: popup says "Counting " with the title under it, orange icon.
  3. Switch the audio to another language in the player: within seconds "Not , not counted".
  4. On an ad plan, during an ad: "Ad, not counted"; counting resumes after.
  5. Dashboard → today: the title is listed with about the minutes played and opens it.
  6. Turn the site off and reload: "No video here".

If a step fails, run the console snippet at the end of docs/streaming.md while it plays and paste the output.

Checklist

  • The title follows Conventional Commits (fix(tracker): ...), in English.
  • Tests cover the change, and npm test passes.
  • npm run lint and npm run format:check pass.
  • If the shape of the stored data changed: STORAGE_VERSION in extension/src/log.js is bumped and old data is migrated. (Not changed.)
  • Documentation is updated (README, CONTRIBUTING), if needed.
  • I have read and understood every line of the change, and I ran the checks above myself. (For the maintainer.)

🤖 Generated with Claude Code

AI assistance

Assisted-by: Claude Code:claude-opus-5-5

Each site is off until turned on in the dashboard settings, which asks for
scripting and that site's pages only (inside the optional <all_urls>, so no
new install warning). A page script copies what the player says; pure
readers turn it into the episode, its audio language and whether an ad
plays. The audio track decides; a player that cannot be read counts nothing.
The popup shows the title of what it counts. Investigation in
docs/streaming.md.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaquinmuzzi
joaquinmuzzi merged commit dda9ab6 into main Nov 23, 2026
4 checks passed
@joaquinmuzzi
joaquinmuzzi deleted the feat/streaming-sites branch November 23, 2026 15:05
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.

1 participant