if you want to backup your top songs of {current_year}, here's a simple way of doing it :
- open your browser
- go to your top songs spotify playlist
- open the console
- copy the following code, paste it into the console and hit Enter
var songs = [];
document.querySelectorAll('div.tracklist-name').forEach((song) => {
songs.push(song.innerText);
});
var artists = [];
document.querySelectorAll('span.TrackListRow__artists.ellipsis-one-line').forEach((artist) => {
artists.push(artist.innerText);
});
var result = [];
for (var i = 0; i < artists.length; i++) {
result[i] = artists[i] + " - " + songs[i];
}
console.log(result.join('\n'));- enjoy :)
js with map because y not
var songs = [...document.querySelectorAll('div.tracklist-name')].map(elem => elem.innerText);
var artists = [...document.querySelectorAll('span.TrackListRow__artists.ellipsis-one-line')].map(elem => elem.innerText);
var result = artists.map( function (artist, index) {
return artist + " - " + songs[index]
});
console.log(result.join('\n'));