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

[fix] fix for extra text at last line of lyrics #215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[fix] fix for extra text at last line of lyrics #215

wants to merge 1 commit into from

Conversation

gautamajay52
Copy link

Most of the times the last line of lyrics has EmbedShare Url:CopyEmbed:Copy as extra words.

@johnwmillr
Copy link
Owner

Hi @gautamajay52, could you provide a couple of examples of lyrics returning those extra words? Thanks!

@gautamajay52
Copy link
Author

Hi @gautamajay52, could you provide a couple of examples of lyrics returning those extra words? Thanks!

I am not getting in all songs. I am integrating this with Spotify to get the current playing lyrics.

Here is HTMl that I used to get when that text appear for me while testing.

But on requesting again sometimes it doesn't appear. So it is random, but I have noticed it with a lot of songs.

@gautamajay52
Copy link
Author

gautamajay52 commented Jun 29, 2021

Hi @gautamajay52, could you provide a couple of examples of lyrics returning those extra words? Thanks!

Here is another HTML
I just got again while testing.

Sir you can find the name of song in this html.

edit: html of same song when I don't get that extra text.

@gautamajay52
Copy link
Author

Hi @gautamajay52, could you provide a couple of examples of lyrics returning those extra words? Thanks!

Sir ! Are you able to reproduce the error?
Do I have to provide any other details?

@jam0ra
Copy link

jam0ra commented Jul 22, 2021

I seem to be having this issue as well with songs such as "Say So" and "Kiss Me More" by Doja Cat.

@gautamajay52
Copy link
Author

@johnwmillr I seem to be having this issue as well with songs such as "Say So" and "Kiss Me More" by Doja Cat.

Hey, Have you tried this fix ?

@jam0ra
Copy link

jam0ra commented Jul 22, 2021

@gautamajay52 Yup seems to work fine so far!

@gautamajay52
Copy link
Author

@gautamajay52 Yup seems to work fine so far!

Actually, I was getting in almost all songs after doing multiple requests on the same song.
Thanks for your review.

@iiKurt
Copy link

iiKurt commented Mar 30, 2022

There also appears to be extra header text prepended to the first line, too. When getting the div on line 137, this is what is outputted. Line one has the extra text "Mood Lyrics" in an h2 element.

Changing the pull request to this would fix both the original and this issue:

else:
    rem = div.find("div", class_=re.compile("Lyrics__Footer"))
    if rem:
        rem.replace_with("")
        
    header = div.find("h2", class_=re.compile("TextLabel"))
    if header:
        header.replace_with("")

@Acervans
Copy link

Acervans commented Jan 21, 2023

There also appears to be extra header text prepended to the first line, too. When getting the div on line 137, this is what is outputted. Line one has the extra text "Mood Lyrics" in an h2 element.

Changing the pull request to this would fix both the original and this issue:

else:
    rem = div.find("div", class_=re.compile("Lyrics__Footer"))
    if rem:
        rem.replace_with("")
        
    header = div.find("h2", class_=re.compile("TextLabel"))
    if header:
        header.replace_with("")

Some songs with translated lyrics also have some extra text at the beginning. I solved it with:

else:
    rem = div.find("div", class_=re.compile("Lyrics__Footer"))
    if rem:
        rem.replace_with("")

    header = div.find("h2", class_=re.compile("TextLabel"))
    if header:
        header.replace_with("")

    controls = div.find("div", class_=re.compile("LyricsControls"))
    if controls:
        controls.replace_with("")

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

Successfully merging this pull request may close these issues.

None yet

6 participants