Skip to content

Instantly share code, notes, and snippets.

@moqmar
Created January 15, 2019 22:34
Show Gist options
  • Save moqmar/2be1d8294d94d0a474217fc02e69e0d6 to your computer and use it in GitHub Desktop.
Save moqmar/2be1d8294d94d0a474217fc02e69e0d6 to your computer and use it in GitHub Desktop.
// 1. Go to https://open.spotify.com/collection/tracks
// 2. Scroll to the very bottom so everything is loaded
// 3. Press F12 and paste the following code (obviously only if you understand what it does)
// 4. Press Ctrl+A and copy everything to a .csv file
document.documentElement.innerHTML = "<pre>Title\tArtist\tAlbum\n"
+ [...document.querySelectorAll(".tracklist .tracklist-row")]
.map(x => {
const e = x.querySelector(".TrackListRow__explicit-label");
if (e) e.parentElement.removeChild(e);
return x.querySelector(".tracklist-name").textContent + "\t" +
x.querySelector(".second-line").textContent.replace(/•/, "\t")
})
.join("\n")
+ "</pre>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment