🌈 ESP32-S3 Rainbow: ZX Spectrum Emulator Board! Get it on Crowd Supply →
View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi

In the before times, when I solved a problem like this, I’d open-source the code. Now I’m not sure there’s much point. There’s a prompt at the end so you can scratch your own itch.

I was at a loose end the other day and thought to myself, I wouldn’t mind rewatching a series I watched a while back on Prime.

The problem with this seemingly simple task is that Prime has stored the fact that I’ve watched every episode. Even worse, it’s stored the point where I stopped watching each episode - which is invariably at the start of the closing titles.

I wanted to start from the beginning, but it insisted on starting where I’d ā€œleft offā€.

The obvious fix is to reset the watch status on the series. Should be simple…

There’s no UI to do this in the Prime app. You have to do it on the web. And when you do, you end up using something aggressively user-unfriendly. Whoever was asked to develop it was evidently told ā€œmake this as difficult to use as possible - we want people to give upā€.

You can see your watch history. It’s an infinitely scrolling list of all the episodes you’ve watched. There are no filters and no bulk actions. You have to delete each season one day at a time, and every viewing is a separate row. It’s designed to frustrate and annoy you.

Prime Video's Watch History page: one long list grouped by day, with a separate delete link for every season you watched that day

Of course, nowadays we don’t need to put up with this kind of nonsense. I opened the page in Chrome and set Claude to work driving it. Then I thought: this won’t be the last time I do this. Claude, write me a script. Then came the follow-up thought: screw it, write me a nice app to manage my watch history, with all the bells and whistles.

A short time later, we have this thing of beauty!

Prime Watch: an overview of the whole history, with shows grouped by when you watched them and a Prime Video / Netflix switch in the sidebar

And of course we also support dark mode out of the box.

This is the point where, in the before times, I’d push it up to GitHub. But why would I? You can build it yourself, with a UI that suits you. Here’s a quick brief for Claude (other coding agents are available).

Build me a [macOS Windows Linux] app for browsing and bulk-deleting my Prime Video and Netflix watch history.

Auth: Embed a web view. If a request comes back signed out, show the web view in a sheet or dialog and load {base}/settings/watch-history (Prime redirects to sign-in if needed). Close it once it lands back there. Never touch the password.

API: Run fetch calls as JavaScript inside the web view so they’re same-origin and carry the session cookies. Base URL is https://www.primevideo.com/region/eu (make the region a setting).

  • Read: GET {base}/api/getWatchHistorySettingsPage?widgetArgs={"nextToken":…}. The watch-history widget has a nextToken for paging and titles: a list of day groups, each with the titles watched that day. Each title has a gti, titleType (season/movie/episode), imageSrc, an actions.REMOVE block (titleIds, token) and children for the individual episodes, each with its own REMOVE action.
  • Delete: POST {base}/api/activityHistoryTitleUpdate with form body action=REMOVE&titleIds=…&token=… and header x-requested-with: XMLHttpRequest. It returns isSuccess: true.

Storage and sync: Keep the history as JSON in the app’s data folder, keyed by day + gti. Incremental sync pages newest-first and stops at the newest day already stored, then replaces those days wholesale. Also add a full re-sync.

Grouping: Prime lists seasons, not series (ā€œREACHER (TV) - SEASON 01ā€, ā€œThe Expanse - Season 3ā€). Strip the season suffixes and tags and normalise case and punctuation so the seasons group into one show.

UI: Whatever you like - or just leave it to Claude!

Gotcha: Prime sometimes reports success on deletes for old entries and then keeps them. After deleting, re-read history in the background back to the oldest deleted day and restore anything that’s still there.

I know some people will be thinking, come on man, you’ve done the hard part of building the app, just give it to us. But really, that’s not the hard part anymore. In fact, none of this was particularly difficult.

What would be difficult is supporting an open-source project that does this. It’s built on Prime’s undocumented API, so it will break. If I open-sourced it, I’d be signing up for a steady stream of ā€œit’s stopped workingā€ issues. There would also be the usual bunch of feature requests for things I don’t need. Open-source projects can quickly become a thankless task.

You’ll note from the screenshot that I also added Netflix - why not, when it’s so easy to add new features?

Netflix: Same approach, on https://www.netflix.com/settings/viewed/<profile>. Netflix lists one row per episode or movie.

  • Read: POST /api/aui/pathEvaluator/web/^2.0.0?method=call&callPath=["aui","viewingActivity",<page>,<size>] with form body param={"guid":"<profile>"}. Page 0 always has 20 rows. The reply includes vhSize, the total row count.
  • Delete: the HideTitleViewing GraphQL mutation, posted to /graphql as a persisted query (by id only; the query text is rejected) with {videoId, hideAllEpisodes, profileGuid}. hideAllEpisodes: true removes a whole series in one go. Read the query id from the page’s scripts, as it changes when Netflix ships a new build.

And you’ve also got the BBC:

ok, we also have the bbc being rubbish - https://www.bbc.co.uk/iplayer/continue-watching

So there you go. Everything you need to build your own is above.

Of course, it does make you wonder: if building things is this easy now, why do these services have such terrible UIs for managing your watch history?

Related Posts

BBC iPlayer - updated sample code - Hey there, just a quick update to let you know I've whipped up a new demo using the RSS feeds from the iPlayer site. It locates URLs and takes advantage of the webview to play the movies out, pretty neat huh? Just a reminder, you'll need the iPhone SDK and tool chain to get this project up and running, and remember, it's a rough around the edges, so use with caution. Be sure to check out the original blog post for more insight. Just a heads up, don't expect to see this app on the iTunes store anytime soon, the BBC might not be too thrilled about it...
Getting BBC iPlayer working on the iPad - Just got an iPad from the US, thinking it'd be perfect for BBC iPlayer. To my dismay, the website needed flash to play anything! Weirdly, iPhones can run it, so I'm trying to trick the iPad iPlayer website into thinking my iPad is an iPhone. It involves setting a User-Agent and using some simple code to change 'embed' tags to HTML5 video tags. Works pretty fine so far, even with full screen video and device rotation. Just needs some tidying up. Although I believe BBC will eventually update their code for the iPad, we're allowed some hacks in the meantime.
Failing to solve Manic Miner with RL - I was never any good at Manic Miner, so I asked Claude Code to build something that could finish it for me on my ZX Spectrum emulator. We started with reinforcement learning, and failed. What actually worked was search - first on the emulator, and then on a model of the game Claude built from the disassembly.
Busy busy - Just landed back home after a couple US trips. It's time to roll up the sleeves and get busy now - have to update instructions for our 1.4 version, which isn't too different from 1.3 but with a few changes. Also, got to start working on 1.5. Let's do this!
Sorry for the long silence... - Haven't been around for a while, folks! Been keeping busy with a startup and working on a server-side project for www.vollow.me. Time to dust off those old Java and database abilities! Soon, I'll be getting my hands on building the app to go with the website. Keep your eyes peeled for some insightful iPhone-related posts coming your way!

Related Videos

Streaming Video From an SD Card on the ESP32. - In this video, we successfully navigated the convoluted process of setting up movie file playback from an ESP32 with an SD card. There were a few bumps along the way, such as confusing USB data pins and the intricacies of various video container formats, but our quirky PCBWay board came through. Discussed an ingenious method of creating a simple custom video container format with ffmpeg that can be effortlessly parsed by the ESP32. And yes, even though the tiny TV guys use AVI files, we pushed boundaries and learned a thing or two about list chunks, sub formats, and hex dumps. The result? We achieved smooth audio playback and video frame skipping for an optimal balance. Check out the streaming version on WiFi for more fun!
M5Stack CORE2 - Can't remember why I got this, but it looks nice! - Hey guys! So today, I'm testing out this really cool app. It's pretty interesting - I think it could be really handy if you're into tech stuff. Let's dive in and see what it can do!
Forget the Arduino Serial Plotter - try this instead! - Hey everyone! So, you're probably familiar with the Arduino serial plotter, right? It's useful for basic stuff, but I wanted something better, more cross-platform, and runs right in the browser. Enter the web serial plotter, using the web serial API! It's super flexible with zoom, export options, and light/dark mode. You can even pan through history or switch to absolute time. Plus, it's all secure and runs locally. It's open source, and I'd love your contributions or bug reports on GitHub. It's still a work in progress, but I think you'll find it pretty handy!
Is it time to change my batteries? Amazon thinks so! - Got a heads up from Amazon that one of my device batteries was low. Gotta give it to the battery, it lasted quite longer than I anticipated. So, I peeked into the device usage history, which was a trove of data Amazon has kindly stored. In fact, I wrote a web scraper to download all this data. Sadly, records only go back to two weeks. Nevertheless, I plotted the data and surprisingly the pattern revealed that battery level gets affected by temperature change. Cool, isn't it? Finally managed to change the battery. Also, I might just plug in a rechargeable one next time so as to not be a part of the 'throw-away battery' culture. All in all, quite an interesting discovery, courtesy of my Amazon device battery.
Can You Spot the Problem? - Buckle up folks, this video is a thrilling one! There's everything from unboxing my new ESP32 TV boards that arrived from PCB Way to discovering some hidden issues. We're talking about some pesky problems, surprises, and even a potential catastrophic error that could've led to a disaster. The main dish is the high-speed SD card access over USB - ultimately achieving a whooping transfer rate! But, the journey is a roller-coaster ride, from the project completely failing initially, to some smart hacks and triumphant moments. All the peripherals worked well, from the display to the sound amplifier and even the infrared receiver. Despite the ups and downs, there's a lot to learn and that's what makes this video exciting! Can't wait to share the improvements I have in mind for turning the prototype into the ultimate all-in-one device. But first, let's address the elephant in the room - an ill-placed diode that's a ticking bomb, because you know, safety first!
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening


Published

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts