Walkyst / lavaplayer-fork

Apache License 2.0
173 stars 68 forks source link

Can't find YouTube playlists that are albums #91

Closed SmileyFace799 closed 1 year ago

SmileyFace799 commented 1 year ago

Given that the original repository is no longer maintained, I shall try my luck here. This is an issue I had with the original repository, and it still seems to persist with this fork.

For some reason, YouTube playlists of albums just don't seem to work. I have the following code:

public void queue(String identifier, String guildId) {
    playerManager.loadItem(identifier, new AudioLoadResultHandler() {
        @Override
        public void trackLoaded(AudioTrack track) {
            queues.get(guildId).queue(track);
        }

        @Override
        public void playlistLoaded(AudioPlaylist playlist) {
            for (AudioTrack track : playlist.getTracks()) {
                queues.get(guildId).queue(track);
            }
        }

        @Override
        public void noMatches() {
            System.out.println("Couldn't find song");
        }

        @Override
        public void loadFailed(FriendlyException e) {
            System.out.println(e.getMessage());
        }
    });

This works fine for regular playlists made by users, but for album playlists it can't seem to find a match. I have tried the following albums, and none of them worked:

I also tried the following user-made playlists, and all of them worked:

By looking at the IDs of these playlists & albums, the thing that stands out is how user playlists start with PL..., while albums start with OLAK5uy_.... I tried changing the first part of the album ID to PL instead, although then it goes to loadFailed, saying the playlist does not exist.

Any possible fixes for this would be greatly appreciated

Walkyst commented 1 year ago

All links you provided here works fine for me

SmileyFace799 commented 1 year ago

Ok so I found out why it didn't work for me.

In the readme I read "The identifier is a piece of text that should identify the track for some source. For example if it is a YouTube video ID...", and from this I wrongfully assumed that the identifier had to be the video/playlist ID. It never occurred to me that I could provide the full link for some reason, and playing album playlists does indeed work when I provide the full link.

in conlusion, it does in fact work, I just had a brain fart :P