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

feature: lyrics support #166

Open
ludg1e opened this issue Nov 6, 2023 · 3 comments
Open

feature: lyrics support #166

ludg1e opened this issue Nov 6, 2023 · 3 comments
Labels
enhancement New feature or request pinned An issue that cannot be closed automatically by Stale

Comments

@ludg1e
Copy link

ludg1e commented Nov 6, 2023

Hello, I really love this project and use it a lot as a reliable alternative to yt-music.

Is there any plan to add lyrics support? (even if isn't synced)
Maybe you could fetch the lyrics with web scraping from Genius or Musixmatch based on the song name (though this may lead to errors sometimes)

Thank you and have a nice day!

@ludg1e
Copy link
Author

ludg1e commented Nov 6, 2023

Usually on Genius.com all lyrics pages follow the same scheme: https://genius.com/artist-name-song-name-lyrics
Then we could select the second child of the div with id "lyrics-root" (seems to follow the same pattern always)
First child of "lyrics-root" is lyrics header with song title and contributors, while second child is the full lyrics separated with <br> tags

For musixmatch.com it seems to follow this scheme: https://musixmatch.com/lyrics/artist-name/song-name
Though the artist name (or ID) could be slightly different than the original on other platforms (e.g JVKE on musixmatch is JVKE-4)
Lyrics are inside an span on the div with class "mxm-lyrics"

@ludg1e
Copy link
Author

ludg1e commented Nov 6, 2023

I understand that web scraping is a very rudimentary way of doing things as well it can lead to multiple issues (rate-limited scraping from the website in case of lots of users)
I'm just giving an idea of how it could be possible to implement this, though it may not be the best way

@Bellisario
Copy link
Owner

Hello, I really love this project and use it a lot as a reliable alternative to yt-music.

Hello, glad you love the project!

Is there any plan to add lyrics support?

Of course, I had already an idea about adding lyrics, but I always stopped because I want to keep Musicale a client-side only application.
Scraping content from other sites is blocked by CORS and the only solution is to use a server. In this case, I would like to create a new API endpoint hosted on Deno Deploy which can be used by Musicale to fetch lyrics.

I already experimented with this library, which offers built-in scraping from Musixmatch.
Synced music instead it's practically impossible without getting a paid developer API key directly from Musixmatch...


Another solution, which I would prefer, is to have an API endpoint accessible from Piped (used on Musicale), which already scrapes the content from YouTube Music. I'm going to open a feature request and will see... in case of a negative feedback, I will implement myself the API...

@Bellisario Bellisario added enhancement New feature or request pinned An issue that cannot be closed automatically by Stale labels Nov 13, 2023
@Bellisario Bellisario pinned this issue Nov 13, 2023
@Bellisario Bellisario changed the title Lyrics support feature: Lyrics support Nov 13, 2023
@ludg1e ludg1e changed the title feature: Lyrics support feature: lyrics support Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned An issue that cannot be closed automatically by Stale
Projects
None yet
Development

No branches or pull requests

2 participants