Last active
May 28, 2023 12:55
-
-
Save danielxdad/0953570980f44ba768cbc332cfbad822 to your computer and use it in GitHub Desktop.
Give me the movies link to download with wget
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
(() => { | |
setTimeout(() => { | |
const text = '#!/bin/env bash\n' + Array.from( | |
document.getElementsByTagName('a') | |
).filter( | |
z => z.href.match(/(.avi$)|(.mpg$)|(.mkv$)|(.mp4$)|(.mp3$)|(.srt$)|(.sub$)/) | |
).map( | |
z => `wget -vc --tries=0 --read-timeout=10 "${z.href}"` | |
).join('\n') + '\n' | |
const type = "text/plain"; | |
const blob = new Blob([text], { type }) | |
const data = [new ClipboardItem({ [type]: blob })] | |
navigator.clipboard.write(data).then( | |
() => alert('Links copied to clipboard successfully') | |
).catch( | |
e => { console.log(e); alert('Ops, error copying to clipboard: ' + e.message) } | |
) | |
}, 2000) | |
console.log( | |
'%cFocus the document right now!', | |
"color: white; font-size: 1.5rem; background-color: transparent; padding: 2px" | |
) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment