If you control the client (e.g. you can use librewolf), then you could do something like this greasemonkey script to rewrite youtube iframes into a locally hosted video file with the same name as the youtube video id:
The event listener might have an annoying perf impact, and if the sites with the embed don't use javascript to build the page, you might be able to leave it off.
https://gist.github.com/ndriscoll/2f1c98a125c0d4a4f6f993e077...
The event listener might have an annoying perf impact, and if the sites with the embed don't use javascript to build the page, you might be able to leave it off.