This script allows you to have a more private Youtube experience. It does two things. 1 replace Youtube embeds with one of Invidious. 2 replace all URLs pointing to a Youtube video to the Invidious counterpart.
It is different from simple redirect scripts in that this script prevents making any connection to youtube.com. This way there will be no exchange of cookies. For the video stream it still needs to make a connection to googlevideo.com. If you want to prevent all connections to Google servers then watch videos on invidio.us with DASH enabled, this way the video stream is proxied through Invidious.