The best thing I can think of is my raspi with libreelec. Youtube and Twitch work but its still young. Lots of work to put in for privacy and freedom. Its far better than my newer appletv (legacy) and since my old appletv (1st gen) was declared obsolete by apple, it could not play anything anymore.
Honestly, I would definitely start using SBCs (raspi, bananapi, rock64) and learn to make plugins since they have an awesome api already completely done so you barely need to program. Its far better than running custom janky roms on proprietary shit hardware and probably the same amount of work.