andrewmcgivery / obsidian-soundscapes

A plugin for Obsidian.MD that adds a music/ambiance player to the status bar to play Lofi beats, nature sounds, ambiance, relaxing music, and more.
MIT License
46 stars 7 forks source link

[Feature Request] Ability to add already-existing YouTube playlists #41

Open Narifia opened 2 months ago

Narifia commented 2 months ago

First of all, thank you so, so much for the amazing plugin! Soundscapes is very well-integrated, blending seamlessly in with the rest of the UI in a way that isn't distracting—which has worked wonders for helping me reign in my focus and increase my productivity :3

I do have one gripe, though. It's nice that we can make our own playlists by linking to YouTube songs, but only being able to add tracks one by one is really inconvenient. It takes a big chunk of time away from me doing more productive tasks, which kind of negates all the benefits of Soundscapes for focus/productivity.

It would be fantastic if we had the option to link to an already-existing YouTube playlist. I already have a ton of my own YouTube playlists, and most have dozens of tracks (I even have one playlist with—get ready for it—402 tracks!!!). Suffice it to say, it's daunting to even think of adding each track into Soundscapes one by one x_x'

Anyway, good luck on all your future coding! I look forward to seeing how Soundscapes grows ^_^

Thanks for reading :3

paul2126 commented 1 month ago

I was also hopping for the same function but until then I manually added the music in the playlist.

var els = document.getElementsByClassName('yt-simple-endpoint style-scope ytd-playlist-video-renderer');
var dataList = [];
for (var i = 0; i < els.length; i++) {
    var el = els[i];
    var curId = el.href.split('?v=')[1].split('&list')[0];
    var videoData = {
        "name": el.title,
        "id": curId
    };
    dataList.push(videoData);
}
console.log(JSON.stringify(dataList, null, 2));

This javascript code will print the name and id in the format that we could right away put into the data.json