Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mix is always fake and doesnt include more than one song #55

Open
Shiny1708 opened this issue Oct 26, 2023 · 8 comments
Open

Mix is always fake and doesnt include more than one song #55

Shiny1708 opened this issue Oct 26, 2023 · 8 comments

Comments

@Shiny1708
Copy link

I used the mix from #31 https://www.youtube.com/watch?v=zhl-Cs1-sG4&list=RDzhl-Cs1-sG4 to test the new mix feature as well as multiple from my own YouTube Music but i always get a fake playlist from the fallback as a result. This is the data for the link:
image

@twlite
Copy link
Owner

twlite commented Oct 26, 2023

@Shiny1708 this can happen for most of the mixes because youtube mixes are generated per user and it is not available to youtube-sr. It might work if you supply your youtube cookie:

getPlaylist(url, {
  requestOptions: { headers: { cookie: '...' } }
})

when youtube-sr cant find mix information, it returns a fake playlist with one track in it.

@Shiny1708
Copy link
Author

Shiny1708 commented Oct 26, 2023

I did some digging and from my understanding visting a private mix with a link just generates a mix based on the first video. Would it be possible to use the new generated mix? From what i can tell thats what lavaplayer does to get mixes

@twlite
Copy link
Owner

twlite commented Oct 26, 2023

image

Lavaplayer seems to be using singleColumn for the result while youtube-sr is using twoColumn

image

I will see what I can do

@Shiny1708
Copy link
Author

I think detecting mixes only with the regex /(RDC|O)LAK5uy_[a-zA-Z0-9-_]{33}/; doesnt detect all mixes. Mixes from yt music dont necessarily have the RD part at the start. Lavaplayer uses this for mix recognition: "https://music.youtube.com/watch?v=f9awN8BCUe8&list=PLXftWo8BlN2lx5iHhkp-3Yg5aRRbe6Qme". So mixes are catergorized by the fact that they have the watch part followed by the list part and that they use music,youtube instead of youtube.com.

@Shiny1708
Copy link
Author

The youtube music mixes are not consistent across clients so the bot would have a different queue than the user but i think the ability to access the youtube music autoqueue in itself is extremly useful since its very good in finding related songs

@twlite
Copy link
Owner

twlite commented Oct 29, 2023

The you link gave has playlist page too https://music.youtube.com/playlist?list=PLXftWo8BlN2lx5iHhkp-3Yg5aRRbe6Qme

image

Mixes usually dont have playlist page

The youtube music mixes are not consistent across clients

yeah I think so. I will try to wrap around innertube next time using this library https://github.com/LuanRT/YouTube.js

@Shiny1708
Copy link
Author

I just compared the mix and playlist result. From what i can tell the links to the videos are extracted from the thumbnail image links when loading playlists correct? The problem I'm facing when entering a mix url is that the tag where the queue would be located if the procedure is the same for mixes is just empty.
image
image

Why is this part not loaded for the yt music link?
The approach to get the link via thumbnail should work with mixes as well if we get that ytmusic-app tag populated
image

(I'm still new to webdev so I hope this makes some sense and im not completly missing the mark)

@Shiny1708
Copy link
Author

The you link gave has playlist page too https://music.youtube.com/playlist?list=PLXftWo8BlN2lx5iHhkp-3Yg5aRRbe6Qme

image

Mixes usually dont have playlist page

The youtube music mixes are not consistent across clients

yeah I think so. I will try to wrap around innertube next time using this library https://github.com/LuanRT/YouTube.js

You're right I didn't realize I started the mix from a playlist. Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants