YT Shorts URL Grabber + Auto Reload

 // Here You can type your custom JavaScript...// Array to store unique URLs

var urls = []; // Function to check for URL changes function checkForUrlChange() { var newUrl = window.location.href; // Check if the URL has changed and is not a duplicate if (urls.length < 700 && newUrl !== urls[urls.length - 1] && !urls.includes(newUrl)) { // Add the new URL to the array urls.push(newUrl); } // If 10 unique URLs have been collected, save them to a text file if (urls.length === 700) { saveUrlsToFile(); } } // Function to save URLs to a text file and reload the page function saveUrlsToFile() { // Create a Blob with the URLs var blob = new Blob([urls.join('\n')], {type: 'text/plain'}); var url = URL.createObjectURL(blob); // Create a link element to download the text file var a = document.createElement('a'); a.href = url; a.download = 'urls.txt'; document.body.appendChild(a); // Click the link to initiate download a.click(); // Remove the link element document.body.removeChild(a); // Clear the URLs array urls = []; // Reload the page after a short delay setTimeout(function() { window.location.reload(); }, 1000); // Adjust the delay time as needed } // Set up an interval to check for URL changes every second (adjust as needed) setInterval(checkForUrlChange, 100); // Function to simulate pressing the down arrow key function pressDownArrow() { var event = new KeyboardEvent('keydown', { key: 'ArrowDown', code: 'ArrowDown', keyCode: 40, which: 40, bubbles: true }); // Dispatch the event to the document document.dispatchEvent(event); } // Function to simulate pressing the up arrow key function pressUpArrow() { var event = new KeyboardEvent('keydown', { key: 'ArrowUp', code: 'ArrowUp', keyCode: 38, which: 38, bubbles: true }); // Dispatch the event to the document document.dispatchEvent(event); } // Function to run the loop function runLoop(iterations) { for (let i = 0; i < iterations; i++) { if (i % 14 < 12) { setTimeout(pressDownArrow, i * 500); } else { setTimeout(pressUpArrow, i * 500); } } } // Run the loop runLoop(15000); // Running for 24 iterations (12 down, 2 up, 12 down)

Comments