Closed mrpandastic closed 4 years ago
This is definitely a bug. I don't have an easy workaround at the moment. Essentially you're ending up with the first result you'd get when searching Genius.com, because you don't have the option to browse through multiple options like you do on the website.
There isn't a way to link the Spotify and Genius IDs, you'll have to search by name like you're doing.
The two songs you mentioned that weren't returning the right lyrics are found without any issues when I search for them. As for linking the linking Spotify and Genius IDs, there is no direct way to search by Spotify ID, but you could link the two by accessing the media
key in the song information like this:
song = genius.search_song('Chandelier', artist='Sia')
for m in song.media:
if m['provider'] == 'spotify':
uri = m['native_uri'] # we could also use m['url']
spotify_id = uri[uri.rfind(':') + 1:]
break
else:
spotify_id = None
print('No Spotify ID found.')
Hi John,
I tried the code you gave Chris regarding song-artist pairs and it doesn't seem to return the correct result:
2nd and 3rd pair returns the correct lyrics but I don't understand why the first pair is getting "The One - Prodigy & The Alchemist" instead of "Rocket Man" by Elton John? If I search for a different song like "El Perdón" by Nicky Jam it results not even into a song lyrics but something completely different.
Do you know how I can avoid this bug? Or some kind of workaround that I can use?
I'm currently using the latest version
lyricsgenius 1.6.0
Oh and another question: I have a list of songs with a Spotify ID. Do you think it's possible to directly link these id's to Genius' song id's? Or do I have to run my loop with
search_song(title, artist)
? Like this:Thank you again for your great help! Really appreciate it! :)