Created
May 20, 2020 07:53
-
-
Save musatov/22f2dcce76e266a18737be16bd7a1807 to your computer and use it in GitHub Desktop.
Run script on the apple music playlist page console and get list of songs and artists as a string. Resulted string can be used to import the collection to other services like yandex music (https://yandex.ru/support/music/library/import.html)
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
const elements = Array.from(document.querySelectorAll('.song-name-wrapper')); | |
const playlist = elements.map(element => { | |
const nameElement = element.querySelector('.typography-label'); | |
const artistElement = element.querySelector('.typography-caption > a'); | |
const name = nameElement.innerText; | |
const artist = artistElement.innerHTML; | |
return `${name} ${artist}`; | |
}); | |
const playListAsString = playlist.join('\r\n'); | |
console.log(playListAsString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment