Last active
March 25, 2018 04:04
-
-
Save Meshiest/f8abbb944294b69b42e5525f7a038291 to your computer and use it in GitHub Desktop.
Bruteforces all of a specific youtube extension as fast as possible
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>URL checker</title> | |
| </head> | |
| <body> | |
| <h3>Input String</h3> | |
| <form onsubmit="test(event)"> | |
| <input name="text" placeholder="JSXGagNzNLw"><br/> | |
| <input type="submit"> | |
| </form> | |
| <script> | |
| let $ = document.querySelector.bind(document); | |
| function perm(str, num) { | |
| let mask = num.toString(2).padStart(str.length, '0'); | |
| return Array.from(str).map((c, i) => | |
| mask[i] === '1' ? c.toUpperCase() : c.toLowerCase() | |
| ).join(''); | |
| } | |
| function test(event) { | |
| event.preventDefault(); | |
| let baseurl = event.target.text.value; | |
| Array.from({length: 2047}).forEach((_, i) => { | |
| let a = document.createElement('a'); | |
| a.href = `https://youtube.com/watch?v=${perm(baseurl, i)}/mqdefault.jpg`; | |
| a.target = '_blank'; | |
| let img = document.createElement('img'); | |
| img.src = `https://i.ytimg.com/vi/${perm(baseurl, i)}/mqdefault.jpg`; | |
| a.style.display = 'none'; | |
| img.onload = function(e) { | |
| if(img.width !== 120) { | |
| a.style.display = 'inherit'; | |
| } | |
| } | |
| a.appendChild(img); | |
| document.body.appendChild(a); | |
| }); | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment