Created
May 8, 2022 19:41
-
-
Save olie-chan/630ef119d7cf0b65f8f91b8f24551a40 to your computer and use it in GitHub Desktop.
Download all videos on a webpage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function download() { | |
Array.from(document.querySelectorAll('video')).forEach((video) => { | |
const { src } = video | |
const a = document.createElement('a') | |
a.href = src | |
a.download = true | |
document.body.prepend(a) | |
a.click() | |
a.remove() | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment