Instructions:
- Go to your Playlists page.
- Make sure all of the playlists you want to share are at least "Unlisted" if not "Public". You can change this by clicking the three dots on one of the playlists -> "Edit playlist" -> "Privacy" drop down. Unfortunately you have to do this by hand for each playlist.
- Scroll to the bottom of the Playlists page (making sure that all your playlists have loaded).
- Press F12 to open your console.
- Paste this JavaScript into your console.
const playlists = [];
document.querySelectorAll("ytmusic-two-row-item-renderer").forEach(playlist => {
const title = playlist.querySelector(".details > .title-group").innerText;
const url = playlist.querySelector("a").href;
if(title !== "New playlist" && title !== "Your Likes")
playlists.push({title, url});
});
- (optional) To sort it, enter this:
playlists.sort((a,b) => (a.title > b.title) ? 1 : ((b.title > a.title) ? -1 : 0));
- Do what you'd like with the array of objects. I provide a few options below.
If you want the output in JSON form, just stringify it:
JSON.stringify(tracklistObj, null, '\t');
If you want a plain text version:
let myString = "";
playlists.forEach(list => myString += `${list.title} - ${list.url}\n`);
myString;
If you want to have the output be an HTML list:
let myHTML = "<ul>";
playlists.forEach(list => myHTML += `<li><a href="${list.url}" target="_blank">${list.title}</a></li>` );
myHTML += "</ul>";
Note: Shared YouTube Music playlists do not show uploaded songs to other users besides the one who made the playlist. There's nothing that you can do about this to my knowledge.