I think honestly the best solution really is to just use a stock PC and forget all of this crap. It's a shame there aren't any good open source setups using stock computers like Raspberry Pi that can act as a good Chromecast replacement (or if there are, I missed on it; I tried Kodi but while it is pretty cool it isn't really great for streaming services like YouTube in my opinion.) but on the other hand, it's not the end of the world.
Many modern TVs, if you can find one that isn't complete dogshit (good fucking luck), can do Miricast without connecting to the Internet or requiring an account. That's nice since it fills one role of Chromecast: the ability to easily cast your desktop.
But I'd like a full open source ecosystem implementing casting. Right now using Chromecast protocols from Firefox is a crapshoot and I just haven't bothered, but I don't think there's any reason why we can't just make our own. YouTube may be somewhat hostile, but at a certain point it's hard to stop a cast tool that just execs an official Google Chrome binary, you know? So there's always something that could be done.
That said, I keep a list of instructions for un-shittifying the Google Chromecast TV devices for myself, since I do have a few of them. Note that you already need to log in for this to really work, but I already do that, since I want to be logged into YouTube, for the time being (for Premium and age-restricted videos and subscriptions and etc.)
I'll just copy and paste them here:
## Replacing the Terrible Launcher
Google took a dump all over the TV launcher with ads. Here is a workaround:
1. Enable *Developer Mode* by tapping the TV OS Build Number in Settings -> About 7 times.
2. Enable USB debugging.
3. Prepare a device with `adb`. On NixOS, `nix shell nixpkgs#android-tools`.
4. Find the IP in About -> Status and use it to do `adb connect [IP]`.
5. Install an alternative launcher like ATV Launcher Pro.
6. Disable the default launcher entirely. `adb shell "pm disable-user --user 0 com.google.android.apps.tv.launcherx && pm disable-user --user 0 com.google.android.tungsten.setupwraith"`
### Button Mapper
Google also made their version of Android extra hostile to the launcher being replaced, so when you disable the launcher the Home and YouTube buttons will stop working. This can be fixed using a third party app called _Button Mapper_ available on Play Store.
1. Install _Button Mapper_ from Play Store.
2. Enable the Button Mapper Accessibility Service in Settings.
3. Add the Buttons
4. Map YouTube to open the YouTube app
5. Map Netflix to open the Jellyfin app
The app will warn about not working if the device sleeps, but this doesn't apply as these devices don't seem to "sleep" the way that Android phones and tablets do.
If your auth becomes stale you need to re-enable those app IDs and log back in. This will manifest as things simply not working, e.g. videos not playing. However, it only happened to me a couple of times. I think it requires session tokens to completely expire, which takes a while of inactivity.