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

get songInfo from youtube API #443

Merged
merged 7 commits into from
Oct 24, 2021

Conversation

Araxeus
Copy link
Collaborator

@Araxeus Araxeus commented Oct 23, 2021

Fix #334 , Fix #343 , Fix #427

Gets songInfo from api.getPlayerResponse() when the video element sends a loadeddata event

This eliminates the bug when the player received an XHR of the next song and it got cached in songInfo


small fixes:

  • url?.split("&")[0] aims to remove playlist info etc.. from songInfo.url
  • suffixesToRemove (from title & artist) now ignore case

@mesmerx
Copy link
Contributor

mesmerx commented Oct 23, 2021

this pr is a cleaner way of getting info
just to known, this pr fixes the need for a if src in getImage? because sometimes src is empty as currently implementattion, and in terminal a error are triggered
https://github.com/th-ch/youtube-music/pull/439/files#diff-183c64bf410feea83315a0ab22d83706800c59e7e028b8babf9b30d5cad3d21fR26
the line that fixes that error in the old way

@Araxeus
Copy link
Collaborator Author

Araxeus commented Oct 24, 2021

this pr is a cleaner way of getting info
just to known, this pr fixes the need for a if src in getImage? because sometimes src is empty as currently implementattion, and in terminal a error are triggered
https://github.com/th-ch/youtube-music/pull/439/files#diff-183c64bf410feea83315a0ab22d83706800c59e7e028b8babf9b30d5cad3d21fR26
the line that fixes that error in the old way

Indeed this way we always have a valid src
Also since we are using here the official youtube api - we always get the right artist name, no more need for scraping artistName from playbar.
(That fix was part of #228 ):

SongInfoProvider was parsing artist name based on video request , not on song - resulting in buggy artist names.
changed it scrape artist name from playbar (native artist name)

Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the contribution!

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