This was written in Python as a backend for the TubeRepair tweak by bag.xml (et al).
Check it out via Github: tuberepair-py-invidious
Open TubeRepair's setting and change the custom URL to:
js is not available
(hold to copy)