Last active
July 22, 2020 14:44
-
-
Save take-cheeze/c91582e8add94fed46ca2eae75fa6c02 to your computer and use it in GitHub Desktop.
This file contains 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
document.querySelectorAll('#contents_list a').forEach((v) => { | |
fetch(v). | |
then((response) => response.text()). | |
then((txt) => { | |
const parser = new DOMParser(); | |
const src = parser.parseFromString(txt, 'text/html'); | |
const mp4_url = src.querySelector('video source').src; | |
const elem = document.createElement('a'); | |
elem.download = ''; | |
elem.href = mp4_url; | |
document.body.appendChild(elem); | |
elem.click(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment