Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var songs = [];
- for (let entry of document.getElementsByClassName('tracklist')[0].children) {
- let p = [];
- for (item of entry.getElementsByClassName('ellipsis-one-line'))
- p.push(item.innerText);
- if (!p[0]) continue;
- let [song, artist, album] = p;
- let artists = artist.split(", ");
- song = song.replace(/-\s+(.+)/g, "($1)").replace(/\[(.+)]/g, "($1)");
- console.log({song, artists, album});
- let fulltitle = artists[0] + " - " + song;
- // Handle featured artists
- let featured = artists.slice(1);
- // Remove the ones already mentioned in the title
- featured = featured.filter(x => !song.includes(x));
- if (featured.length > 0)
- fulltitle += " (feat. " + featured.join(", ") + ")";
- songs.push(fulltitle);
- }
- var songlist = songs.join("\n");
- console.log(songlist);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement