Bookmarklet: Download videos from websites

It’s pretty annoying sometimes that you cant download a video you’re watching from a website.

I’ve found a bookmarklet that will let you download streaming videos from some websites.
And no, sorry, it does not work with YouTube. But it does work on lots of other “tube sites” and other kind of websites.

Download videos from websites - Bookmarklet

To use it you just have to create a new bookmark for the JavaScript code.

So go into “Manage Bookmarks” or whatever it’s called in the web browser you’re using.

Create a new bookmark with this JavaScript code in the URL field:

javascript:(function(xs){for(var i=0;i<xs.length;++i){if(xs[i].currentSrc){var a=document.createElement('a');a.target='_blank';a.download='';a.href=xs[i].currentSrc;a.click();return;}}})(document.querySelectorAll('audio,video'));

Enter a name for the bookmark and save/create it.

Go to a website with videos you can stream.
Play a video on that website and while it’s playing, click on the bookmark you just created.

If it works, a new window/tab will open up and the only thing showing is the video you want to download.
You can now right click on the video that is playing in the new windows and choose to save it.

But as I did mention, it doesn’t work on some websites. But it’s still worth a try.

While we’re speaking about bookmarklets, take a look at this bookmarklet that will load and show all pictures in open directories.