LyricsGenius
LyricsGenius copied to clipboard
[fix] fix for extra text at last line of lyrics
Most of the times the last line of lyrics has EmbedShare Url:CopyEmbed:Copy
as extra words.
Hi @gautamajay52, could you provide a couple of examples of lyrics returning those extra words? Thanks!
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.
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.
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?
I seem to be having this issue as well with songs such as "Say So" and "Kiss Me More" by Doja Cat.
@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 ?
@gautamajay52 Yup seems to work fine so far!
@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.
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("")
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("")