LyricsGenius icon indicating copy to clipboard operation
LyricsGenius copied to clipboard

Random Spotify Playlists being Generated

Open mattryanharris opened this issue 2 years ago • 4 comments

Haven't been able to figure out why but occasionally I'm getting weird data spitting out, it seems to be Spotify playlists are being generated instead of lyrics.

Example: 2015 2nd Quarter Rock Release Calendar LyricsSkip to: APRIL | MAY | JUNE APRIL

4/1

All Time Low - Future Hearts - 13/13

4/3

Halestorm - Into the Wild Life - 15/15

4/6

Turbowolf - Two Hands - 11/11 The Wombats - Glitterbug - 13/13 4/7

Brian Wilson - No Pier Pressure - 16/16 WATERS - What's Real - 11/11 The Mountain Goats - Beat the Champ - 13/13 Waxahatchee - Ivy Tripp - 13/13 Lord Huron - Strange Trails - 14/14 Josh Rouse - The Embers of Time - 10/10 Drenge - Undertow - 11/11 Doldrums - The Air Conditioned Nightmare - 10/10

4/10

Villagers - Darling Arithmetic - 10/10

4/12

White Shadows- Secret of Life - 10/10

4/13

Wire - Wire - 11/11

4/14

Calexico - Edge of the Sun - 12/12 Randy Bachman - Heavy Blues - 11/11 Art of Dying - Rise Up EP - 5/5 Local H - Hey, Killer - 11/11 Dance Gavin Dance - Instant Gratification - 11/11 Will Joseph Cook - You Jump I Run EP - 4/4 4/17

Gang of Youths - The Positions - 10/10

4/18

Foo Fighters - Songs From the Laundry Room EP - 4/4 Of Montreal - Snare Lustrous Doomings - 19/19

4/20

Turbo Fruits - No Control - 11/11

4/21

Tom DeLonge - To the Stars... Demos, Odds and Ends - 8/8 Speedy Ortiz - Foil Deer - 12/12 They Might Be Giants - Glean - 15/15 Alabama Shakes - Sound & Color - 12/12 Built to Spill - Untethered Moon - 10/10 10 Years - From Birth to Burial - 11/11 Alesana - Confessions - 11/11 Death - N. E. W - 10/10 Great Lake Swimmers - A Forest of Arms - 13/13 Miniboone - Bad Sports - 11/11 Apocalyptica - Shadowmaker - 12/12 4/22

WestKust - Last Forever - 9/9

4/27

The Brian Jonestown Massacre - Musique de film imaginé - 14/14

4/28

Mew + - (Plus Minus) - 10/10 Odessa - Odessa - 11/11 Paul De Jong - IF - 3/12 Turn to Crime - Actions - 7/7 Bell Witch - Four Phantoms - 4/4 Colin Stetson & Sarah Neufield - Never Were the Way She Was - 8/8 Monolord - Vænir - 6/6 Nai Harvest - Hairball - 9/10 Sam Cohen - Cool It - 10/10 The Barr Brothers - Alta Falls - 5/5

4/30

Girl Band - The Early Years - 5/5 MAY

5/1

Korpiklaani - Noita - 11/11

5/4

Mumford & Sons - Wilder Mind - 12/12 Best Coast - California Nights - 12/12 Django Django - Born Under Saturn - 13/13 Hop Along - Painted Shut - 10/10 METZ - II - 10/10 Jacco Gardner - Hypnophobia - 10/10 Landshapes - Heyoon - 11/11 Mac McCaughan - Non-Believers - 10/10 Torres - Sprinter - 9/9

5/5

My Morning Jacket - The Waterfall - 14/14 Rose Windows - Rose Windows - 9/9 Mikal Cronin - MCIII - 11/11 Kamelot - Haven - 13/13

5/8

The Early November - Imbue - 11/11

5/12

The Tallest Man on Earth - Dark Bird is Home - 10/10 Patrick Watson - Love Songs for Robots - 10/10 Crocodiles - Boys - 10/10 David Duchovny - Hell or Highwater - 12/12 Duff McKagan - How To Be A Man EP - 3/3 Icky Blossoms - Mask - 9/9 Pfarmers - Gunnera - 7/7 The Holydrug Couple - Moonlust - 12/12 Surfer Blood - 1000 Palms - 11/11 CHAPPO - Future Former Self - 10/10 Blanck Mass - Dumb Flesh - 8/8

5/18

Shilpa Ray - Last Year's Savage - 11/11 Kopecky - Drug for the Modern Age - 12/12

5/19

Brandon Flowers - The Desired Effect - 10/10 Faith No More - Sol Invictus - 10/10 Ceremony - The L-Shaped Man - 11/11 The Story So Far - The Story So Far - 10/10 Whitesnake - The Purple Album - 15/15 Paul Weller - Saturns Pattern - 9/9 The Helio Sequence - The Helio Sequence - 10/10 Du Blonde - Welcome Back to Milk - 12/12 Holly Miranda - Holly Miranda - 11/11 The Milk Carton Kids - Monterey - 11/11 Coal Chamber - Rivals - 14/14 Silverstein - I Am Alive In Everything I Touch - 12/12

5/25

The Vaccines - English Graffiti - 14/14

5/26

Unknown Mortal Orchestra - Multi-Love - 9/9 Robert Pollard - Faulty Superheroes - 12/12 Lifehouse - Out of the Wasteland - 18/18 Anti-Flag - American Spring - 14/14 Jarrod Alonge - Beating a Dead Horse - 15/15

5/29

Algiers - Algiers - 11/11 SOAK - Before We Forgot How to Dream - 14/14 JUNE

6/1

Slaves - Are You Satisfied? - 22/22

6/2

Girlpool - Before the World was Big - 10/10 Barenaked Ladies - Silverball - 13/13 Zella Day - Kicker - 12/12 The Darkness - Last of Our Kind - 10/10 Daughn Gibson - Carnation - 11/11 Born Cages - I'm Glad I'm Not Me - 12/12 Indigo Girls - One Lost Day - 13/13 Dawes - All Your Favorite Bands - 9/9

6/4

The I.L.Y.'s - I've always been good at true love - 9/9

6/5

Four Year Strong - Self-Titled -11/11 COIN - COIN - 10/10 FFS - FFS - 16/16

6/8

Muse - Drones - 12/12 Tove Styrke - Kiddo - 12/12

6/9

Sun Kil Moon - Universal Themes - 8/8 Jenny Hval - Apocalypse, Girl - 10/10 Of Monsters and Men - Beneath The Skin - 15/15 Sharon Van Etten - I Don't Want to Let You Down EP - 5/5 Young Guns - Ones and Zeros - 10/11 No Joy - More Faithful - 11/11 Ash - Kablammo! - 12/12

6/12

Gengahr - A Dream Outside - 11/11

6/15

Yukon Blonde - On Blonde - 10/10

6/16

Nate Reuss - Grand Romantic - 12/12 Nick Diamonds - City of Quartz - 12/13 James Taylor - Before This World - 10/10 Heartless Bastards - Restless Ones - 1/10 KEN mode - Success - 9/9 Mates of State - You're Going to Make It EP - 5/5 Third Eye Blind - Dopamine - 13/13 MewithoutYou - Pale Horses - 11/11 Beautiful Bodies - Battles - 12/12 High on Fire - Luminiferous - 9/9 Sorority Noise - Joy, Departed - 10/10 Alpine - Yuck - 10/10 Our Last Night - Younger Dreams - 11/11 Alvarez Kings - Fear to Feel EP - 4/4

6/22

Everything Everything - Get To Heaven - 17/17

6/23

Breaking Benjamin- Dark Before Dawn - 12/12 Wolf Alice - My Love Is Cool - 13/13 Citizen - Everybody Is Going To Heaven - 10/10 Desaparecidos - Payola - 14/14 Bully - Feels Like - 11/11 Lindemann - Skills In Pills - 11/11

6/26

Thy Art is Murder - Holy War - 11/11 Saint Raymond - Young Blood - 17/17

6/29

August Burns Red - Found In Far Away Places - 12/12 Neil Young + Promise of the Real - The Monsanto Years - 9/9 Slightly Stoopid - Meanwhile...Back at the Lab - 14/14 Wilson - Right to Rise - 12/12

6/30

X Ambassadors - VHS - 22/22 Being As An Ocean - Being As An Ocean (Self-Titled) - 10/10 Jaill - Brain Cream - 13/13 Lady Bones - Dying - 10/10 Matt Pond PA - The State of Gold - 13/133Embed

mattryanharris avatar May 02 '22 20:05 mattryanharris

Those Spotify playlists are actual song pages on Genius which happen to be the top result when genius.search_song (assuming that's the method you're using) searches for the song. Currently, this situation is not handled by the method (a PR would be welcome), so you could do the search manually and pick out the song yourself. Here's an example from the docs:

lyrics = []
songs = genius.search_songs('Begin Again Andy Shauf')
for song in songs['hits']:
    url = song['result']['url']
    song_lyrics = genius.lyrics(song_url=url)
    # id = song['result']['id']
    # song_lyrics = genius.lyrics(id)
    lyrics.append(song_lyrics)

allerter avatar May 03 '22 05:05 allerter

@allerter I currently have some fun regex looking for this specific case. Do you think it'd be worth implementing that regex, I'd be happy to provide a PR.

mattryanharris avatar May 03 '22 19:05 mattryanharris

Yes, I think it'd be worth looking into. We've had instances before where Spotify playlists came up and had the users confused.

allerter avatar May 04 '22 05:05 allerter

Those Spotify playlists are actual song pages on Genius which happen to be the top result when genius.search_song (assuming that's the method you're using) searches for the song. Currently, this situation is not handled by the method (a PR would be welcome), so you could do the search manually and pick out the song yourself. Here's an example from the docs:

lyrics = []
songs = genius.search_songs('Begin Again Andy Shauf')
for song in songs['hits']:
    url = song['result']['url']
    song_lyrics = genius.lyrics(song_url=url)
    # id = song['result']['id']
    # song_lyrics = genius.lyrics(id)
    lyrics.append(song_lyrics)

This helped me.

I'm still solving it, but I was also getting bogus lyrics selected for well-known songs that had proper lyrics, eg https://genius.com/Destinys-child-independent-women-part-1-lyrics

I've found at least 2 ways to address this:

  1. manually using the above method just fixed some (eg the link I gave). I'm honestly not sure why this would fix it, I'm guessing it has to do with some difference in implementation details.
  2. The API really seems to struggle with non-alphabetic characters, eg + [ ( , . " etc. A lot of songs/artists with those in it get parsed weirdly, & so return incorrect results. I've had some luck just removing them.
  3. Still exploring this one, but most URLs follow the pattern {artist}-{title}-lyrics. When you get a bad result, it's associated with a URL usually that's clearly not the correct one. So this might be a way to help verify or even find the correct URL from several options using the code above.

Hope this helps!

davidnmora avatar Nov 14 '22 23:11 davidnmora