Skip to content

Instantly share code, notes, and snippets.

@panzi
Created April 20, 2017 00:44
Show Gist options
  • Save panzi/f6544359a74a568e21045e3ef56a5dd9 to your computer and use it in GitHub Desktop.
Save panzi/f6544359a74a568e21045e3ef56a5dd9 to your computer and use it in GitHub Desktop.

Create a new bookmark in your bookmar toolbar, call it download and use this as the URL:

javascript:(function() { var els = document.querySelectorAll('audio, video'); var links = []; for (var i = 0; i < els.length; ++ i) { var el = els[i]; var l = document.createElement('a'); l.href = el.currentSrc; l.download = ''; l.style.visibility = 'hidden'; l.style.position = 'absolute'; l.style.bottom = '0'; l.style.right = '0'; document.body.appendChild(l); l.click(); links.push(l); } for (var i = 0; i < links.length; ++ i) { document.body.removeChild(links[i]); } })();void(0)

This doesn't work in all cases. Some webpages uses that special streaming video format or DRM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment