Last active
February 18, 2025 23:54
-
-
Save ZachSaucier/ecb911278a999b1d4bb505cd5548bb4e to your computer and use it in GitHub Desktop.
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
const hrefs = [...document.querySelectorAll('.albumThumb a[href*="playlist.view?id="]')].map((e) => e.href); | |
let lastPlaylistId = -1; | |
hrefs.forEach((e) => { | |
const id = parseInt(new URL(e)?.searchParams?.get('id')); | |
if (id > lastPlaylistId) { | |
lastPlaylistId = id; | |
} | |
}); | |
for (let i = 1; i <= lastPlaylistId; i++) { | |
let index = i; | |
let error = false; | |
try { | |
await fetch(`http://192.168.0.16:4040/exportPlaylist.view?id=${index}`).then(e => error = e.status >= 400) | |
} catch(e) {} | |
if (!error) { | |
setTimeout(() => window.location = `exportPlaylist.view?id=${i}`, index * 100); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment