Last active
October 1, 2019 15:35
-
-
Save vfalconi/9adaa8a00ed174334a7ceca0923151a1 to your computer and use it in GitHub Desktop.
Open a playlist in Spotify's web player UI. Do the infinite scroll trigger until the entire playlist is visible. Run this in the DevTools console to get a CSV-friendly version of the playlist copied to your clipboard. Paste into a text editor. Save as CSV.
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
copy(Array.from(document.querySelectorAll('.tracklist-container:not(.PlaylistRecommendedTracks__list) .tracklist-row')).map(row => { | |
const artists = Array.from(row.querySelectorAll('.tracklist-row__artist-name-link')).map(artist => artist.innerHTML).join(', '); | |
const title = (row.querySelector('.tracklist-name') !== null ? row.querySelector('.tracklist-name').innerHTML : row.querySelector('.TrackListRow__artists').innerHTML); | |
const album = (row.querySelector('.tracklist-row__album-name-link') !== null ? row.querySelector('.tracklist-row__album-name-link').innerHTML : row.querySelector('.TrackListRow__album').innerHTML); | |
return `"${title}","${artists}","${album}"`; | |
}).join("\n")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment