I can only really think of a way to do this with some kind of browser that's easily hackable, can inject scripts, and can write data to a local file.
Anyone know of any browsers that can do this?
Or a simple userscript with tampermonkey: https://chromewebstore.google.com/detail/tampermonkey/dhdgff...
Example: https://greasyfork.org/en/scripts/11057-block-youtube-users