Notes
Notes - notes.io |
For whatever reason you can't share all the songs you've liked in YT music. A workaround is to add them all to a playlist and share that, but it's super tedious and ridiculous. This process automates that.
1. Create a new playlist, which will contain your liked songs
2. Open up your [likes list](https://music.youtube.com/playlist?list=LM)
1. Scroll all the way to the bottom of the list to ensure that all songs are loaded
3. Open the chrome Dev Console, and either [create a snippet](https://developer.chrome.com/docs/devtools/javascript/snippets/) or run the code below directly
```javascript
// Define the sleep method and relevant paths.
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
sleep_time = 600;
playlist_selection_path = "#playlists > ytmusic-playlist-add-to-option-renderer:nth-child(1) > button";
count = 0;
(async () => {
// Capture the list of liked songs.
liked_songs = document.querySelector("#contents").children.item(0).children.item(0).children;
// Loop over each item in the liked songs list.
for (let song of liked_songs) {
try {
// Click the three-dot menu and give it a moment to appear.
three_dot_menu = song.children.item(4).children.item(1);
three_dot_menu.click();
await sleep(sleep_time);
// Click "add to playlist" and give it a moment to process.
add_to_playlist = Array.from(document.querySelectorAll('a[id=navigation-endpoint]'))
.find(element => element.innerText === 'Add to playlist');
add_to_playlist.click();
await sleep(sleep_time);
// Select the first playlist and give it a moment to process.
document.querySelector(playlist_selection_path).click();
await sleep(sleep_time);
} catch (e) {
console.log(song.outerText);
}
// Debug; only process the first n songs.
// count += 1;
// if (count === 3) {
// break;
// }
}
})()
```
Note that I have the sleep time fairly conservative to help ensure that no songs are missed, but reducing the time will make the process complete faster. In addition, moving to another workspace or backgrounding the chrome tab may result in failure, so it's be to leave it in the foreground until completion. Failed songs will be printed in the dev console.
OP that this is based on: [https://www.reddit.com/r/YoutubeMusic/comments/fby5d3/anyone_looking_to_share_a_liked_songs_playlist/](https://www.reddit.com/r/YoutubeMusic/comments/fby5d3/anyone_looking_to_share_a_liked_songs_playlist/)
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team