Created
March 28, 2020 05:49
-
-
Save nqthqn/1cf0fb6393c578b34c85ec42654c7165 to your computer and use it in GitHub Desktop.
Spotify to YouTube Music
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
// Open dev tools on a spotify playlist and run this script | |
// You will get a list of links that will take you to searches for the songs | |
let tracks = [...document.querySelectorAll(".track-name-wrapper")] | |
.map(t => ({ | |
name: t.querySelector(".tracklist-name").innerText, | |
artist: t.querySelector(".TrackListRow__artists").innerText, | |
album: t.querySelector(".TrackListRow__album").innerText | |
})) | |
.map(({ name, artist, album }) => { | |
const q = encodeURIComponent(`${name} ${artist} ${album}`); | |
return `https://music.youtube.com/search?q=${q} (${name})`; | |
}) | |
.join("\n"); | |
console.log(tracks); |
from a bookmarklet you can do this, the document must be in focus
navigator.clipboard.writeText(`name\tartist\talbum\tyoutube\n`+tracksAsCsv)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a CSV for copying into google sheets
What if we had a bookmarklet "copy from spotify playlist" and "paste to youtube music playlist"?