brentvollebregt / spotify-lyrics-viewer

View the lyrics of the current playing Spotify song in your browser
https://spotify-lyrics-viewer.nitratine.net/
45 stars 8 forks source link

Brackets problem #6

Closed FiftyFour7250 closed 1 year ago

FiftyFour7250 commented 3 years ago

Hey. Thank you for dark theme, and pinned player. I found a bug where the lyrics for many songs are not displayed.

Seems like for all songs with brackets in the title, and most often it is "(feat. |ArtistName|)" and "(with |ArtistName|)" - incorrect lyrics are shown. Usually there are not even songs, but a Spotify playlist [For example this is for Eminem - Leaving Heaven (feat. Skylar Grey) ] It's funny, but it happens that the track is correct, but it shows the translation into a random language, not original. [For example this is for Kid Cudi - The Adventures of Moon Man & Slim Shady (with Eminem) ]

A few more examples (although you can easily find them by yourself): https://open.spotify.com/track/3PFaFVWq5wucLu6s4baj9D?si=utxymX1TRbCbWAio694ETQ --- Playlist https://open.spotify.com/track/0u2P5u6lvoDfwTYjAADbn4?si=v2yTpmGXQAqMIPw8Smb2HQ --- Playlist https://open.spotify.com/track/5e7ldn9Kwo8Aw9Z8ql9cDj?si=u1vIYoYJSoKBr8k-gEIuVA --- Translation https://open.spotify.com/track/7CcoUAtUcYhUfBsmtn0ajO?si=1eFjAHx1RZqm-sdmBAeguQ --- Translation

I've checked about 20 songs with brackets, and for none correct lyrics all of them. I hope you can fix it)

FiftyFour7250 commented 3 years ago

Correction. If no ArtistName in brackets, just words - it's works fine.

Examples: https://open.spotify.com/track/5ZOLcd8JCxHjrCQDp394IV?si=-mxkkE78Q8ikaE-N5okOMQ https://open.spotify.com/track/2K9aNlFNoh2UVY7K7iPMnS?si=LcV7PliERie2Qk1xW3n1-w https://open.spotify.com/track/20E9gUmSgH8SBCMevHItbk?si=MuLDYFkwSd-Y4bd2oDp0gQ https://open.spotify.com/track/4f80SteKqaB6M2JytEUrwT?si=45XbqivBRYepnlW70f-zPg https://open.spotify.com/track/6d3I7THB2bONUkxOo1DvmZ?si=XLZkQZ34QqSF1g7kLpVjPA

So problem is only in cases like (with...) and (feat. ....)

brentvollebregt commented 3 years ago

Cheers for the example, I have written up a regular expression to try and filter these out:

"title".replace(/\((feat\.|ft\.|with).+\)/, "").trim()

The results:

Input Output Expected?
Girl (feat. KAYTRANADA) Girl ✔️
All Eyez On Me (ft. Big Syke) All Eyez On Me ✔️
lovely (with Khalid) lovely ✔️
Walk On Water (feat. Beyoncé) Walk On Water ✔️
Tragic Endings (feat. Skylar Grey) Tragic Endings ✔️
Pursuit Of Happiness (Nightmare) Pursuit Of Happiness (Nightmare) ✔️
The Wolves (Act I and II) The Wolves (Act I and II) ✔️
Aghori (Dunkler Tag) Aghori (Dunkler Tag) ✔️

I'll put this in soon.

brentvollebregt commented 3 years ago

Let me know if this has worked - should be available in about 5mins

FiftyFour7250 commented 3 years ago

Seems like it fixed a lot, but not all. I checked different songs with "(feat. XXX )", and everything is fine, but with "(with XXX)" - something shows correctly, something does not. Few examples:

https://open.spotify.com/track/0u2P5u6lvoDfwTYjAADbn4?si=e0122c047fa241a3 - Song from my first message. It used to show a playlist, but now it shows an Arabic translation.

https://open.spotify.com/track/4g32MdRoqwGKQd3NXIRhpU?si=JiAKStdISY6EuPG0xoXmWQ - It's fine. https://open.spotify.com/track/09FfQO3PqHO4HIJL511Ksi?si=XN6XaW4NSBiQm5eTsCf_DA - Song from the same album, with the same artist, even the song name differs only in one word, but already Turkish translation

https://open.spotify.com/track/5CFJRZRq6sdKKtRwNPWbYv?si=c981f36d5bf94886 - Playlist

https://open.spotify.com/track/5AebNkVaY2zcdNFCqPBIV7?si=c31cb050d482455b - Playlist

https://open.spotify.com/track/7uPZooWh5ttHRokNHnAJyD?si=lr4rRoK7S_u1JqeXEWquWw - It's fine

https://open.spotify.com/track/38iBrrbbXyWaSPkmuDNgjZ?si=TLRqSSePQoODiIKVdCVlKw - Russian translate

¯\(ツ)

FiftyFour7250 commented 3 years ago

I GET IT!

FiftyFour7250 commented 3 years ago

Songs whose lyrics are displayed incorrectly have a different artist on genius. Look.

Correct lyrics: e r

Wrong lyrics: e w

https://genius.com/artists/Eminem-and-jessie-reyez

Correct lyrics: p

Wrong Lyrics: 43

https://genius.com/artists/Logic-and-dwn2earth

Get it?

brentvollebregt commented 3 years ago

Pretty much for each song that has more than one artist, I just search with the first artist's name. For example the song "Nice Guy (with Jessie Reyez)" you listed above, it searches for "Eminem Nice Guy".

There is no way to exactly match the lyrics, I am just searching for them based on the songs title and main artist. If you can recommend a better way to search, then I can check it out. At the moment, I'm doing this:

  1. Get the title and main artist
  2. Remove the feat. ft. etc from the title
  3. Search Genius for "{artist} {title}"
FiftyFour7250 commented 3 years ago

Hm... Try this:

  1. Get the title and both artists
  2. Remove the feat. ft. etc from the title
  3. Search Genius for "{artist1 & artist2} {title}"

I checked through genius search and it worked for every songs. This gave the first correct result, both for songs with a combined artists page, and for different ones. The only one songs this didn't work is Nice Guy, where the first Turkish translation is issued.

https://open.spotify.com/track/0u2P5u6lvoDfwTYjAADbn4?si=FcVNQMFhTv2JlDx964ijDg (Combined page) Search: "Billie Eilish & Khalid lovely"

https://open.spotify.com/track/5e7ldn9Kwo8Aw9Z8ql9cDj?si=rkh7EhX2Sr6n2vQpweNhoQ (Different pages) Search: "2Pac & Big Syke All Eyez On Me"

https://open.spotify.com/track/5CFJRZRq6sdKKtRwNPWbYv?si=_ngJq6jjRlSHeJlv5noB_g (Combined page) Search: "Kid Cudi & Skepta & Pop Smoke Show Out"

https://open.spotify.com/track/5CpsIb7SMFHjmAG8RvIWfq?si=YhBp7-u7SnyQ5Ue8qr_wBw (Different pages) Search: "Eminem & Skylar Grey Leaving Heaven"

Also, as an option, maybe you should block playlists, and translations? Or for songs with multiple artists, you should add a selection of lyrics with different options...

brentvollebregt commented 3 years ago

I like your idea and see your examples, however, I have a few examples that break from this change:

  1. spotify:track:1KLmiSyLPgqc13H4gTBdoU a. Closer to Comfort Dreamhouse => https://genius.com/Dreamhouse-closer-to-comfort-lyrics b. Closer to Comfort Dreamhouse & Andy Cizek & Makari => No matches c. Dreamhouse & Andy Cizek & Makari Closer to Comfort => No matches d. Issue: No longer has a match
  2. spotify:track:0UOtF2ojhKGYEjvZ28ZA6d a. Scars That I'm Hiding From Ashes to New => https://genius.com/From-ashes-to-new-scars-that-im-hiding-lyrics b. Scars That I'm Hiding From Ashes to New & In Flames => https://genius.com/Gerald-haywood-2018-haywoodindahood-listening-log-annotated c. From Ashes to New & In Flames Scars That I'm Hiding => https://genius.com/Gerald-haywood-2018-haywoodindahood-listening-log-annotated d. Issue: Bad match
  3. spotify:track:5faXyg4iS36jNS7btOUqPU a. Madness Silverstein => https://genius.com/Silverstein-madness-lyrics b. Madness Silverstein & Princess Nokia => https://genius.com/Genius-march-2020-singles-release-calendar-annotated c. Silverstein & Princess Nokia Madness => https://genius.com/Genius-march-2020-singles-release-calendar-annotated d. Issue: Bad match
  4. spotify:track:0tyR7Bu9P086aWBFZ4QJoo a. Monsters All Time Low => https://genius.com/All-time-low-monsters-lyrics b. Monsters All Time Low & blackbear => https://genius.com/Isabelle-hammonds-my-favorite-songs-annotated c. All Time Low & blackbear Monsters => https://genius.com/Spotify-new-music-friday-4-3-20-annotated d. Issue: Bad match

I use https://api.genius.com/search?q= to search for songs. Conveniently (/s), the GENIUS API does not always return the same results as the search on their site.

For example, here is the data from 2b: ```json { "meta": { "status": 200 }, "response": { "hits": [ { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 1, "api_path": "/songs/3406355", "full_title": "2018 haywoodindahood Listening Log by Gerald Haywood", "header_image_thumbnail_url": "https://images.genius.com/c7442dfc16522281e7aa05bcca8fb812.200x165x1.png", "header_image_url": "https://images.genius.com/c7442dfc16522281e7aa05bcca8fb812.200x165x1.png", "id": 3406355, "lyrics_owner_id": 3541884, "lyrics_state": "complete", "path": "/Gerald-haywood-2018-haywoodindahood-listening-log-annotated", "pyongs_count": 2, "song_art_image_thumbnail_url": "https://images.genius.com/c7442dfc16522281e7aa05bcca8fb812.200x165x1.png", "song_art_image_url": "https://images.genius.com/c7442dfc16522281e7aa05bcca8fb812.200x165x1.png", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 0, "hot": false, "pageviews": 21962 }, "title": "2018 haywoodindahood Listening Log", "title_with_featured": "2018 haywoodindahood Listening Log", "url": "https://genius.com/Gerald-haywood-2018-haywoodindahood-listening-log-annotated", "primary_artist": { "api_path": "/artists/1065349", "header_image_url": "https://images.genius.com/4184eb1c743b380255c43780ed6ef9f7.398x398x1.jpg", "id": 1065349, "image_url": "https://images.genius.com/4184eb1c743b380255c43780ed6ef9f7.398x398x1.jpg", "is_meme_verified": false, "is_verified": false, "name": "Gerald Haywood", "url": "https://genius.com/artists/Gerald-haywood", "iq": 96969 } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 0, "api_path": "/songs/3169975", "full_title": "SCP-3470 by The SCP Foundation", "header_image_thumbnail_url": "https://images.genius.com/4d9825d4709d8a610cd82ce10ec8e550.300x300x1.jpg", "header_image_url": "https://images.genius.com/4d9825d4709d8a610cd82ce10ec8e550.512x512x1.jpg", "id": 3169975, "lyrics_owner_id": 1462612, "lyrics_state": "complete", "path": "/The-scp-foundation-scp-3470-annotated", "pyongs_count": null, "song_art_image_thumbnail_url": "https://images.genius.com/4d9825d4709d8a610cd82ce10ec8e550.300x300x1.jpg", "song_art_image_url": "https://images.genius.com/4d9825d4709d8a610cd82ce10ec8e550.512x512x1.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 0, "hot": false }, "title": "SCP-3470", "title_with_featured": "SCP-3470", "url": "https://genius.com/The-scp-foundation-scp-3470-annotated", "primary_artist": { "api_path": "/artists/149880", "header_image_url": "https://images.genius.com/4d9825d4709d8a610cd82ce10ec8e550.512x512x1.jpg", "id": 149880, "image_url": "https://images.genius.com/4d9825d4709d8a610cd82ce10ec8e550.512x512x1.jpg", "is_meme_verified": false, "is_verified": false, "name": "The SCP Foundation", "url": "https://genius.com/artists/The-scp-foundation" } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 2, "api_path": "/songs/581048", "full_title": "Angela's Ashes by Frank McCourt", "header_image_thumbnail_url": "https://images.rapgenius.com/c109cf5e587280c708c1475398f4436c.300x441x1.jpg", "header_image_url": "https://images.rapgenius.com/c109cf5e587280c708c1475398f4436c.514x755x1.jpg", "id": 581048, "lyrics_owner_id": 1209637, "lyrics_state": "complete", "path": "/Frank-mccourt-angelas-ashes-annotated", "pyongs_count": 3, "song_art_image_thumbnail_url": "https://images.rapgenius.com/c109cf5e587280c708c1475398f4436c.300x441x1.jpg", "song_art_image_url": "https://images.rapgenius.com/c109cf5e587280c708c1475398f4436c.514x755x1.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 2, "hot": false, "pageviews": 16821 }, "title": "Angela’s Ashes", "title_with_featured": "Angela's Ashes", "url": "https://genius.com/Frank-mccourt-angelas-ashes-annotated", "primary_artist": { "api_path": "/artists/265110", "header_image_url": "https://assets.genius.com/images/default_avatar_300.png?1617376358", "id": 265110, "image_url": "https://assets.genius.com/images/default_avatar_300.png?1617376358", "is_meme_verified": false, "is_verified": false, "name": "Frank McCourt", "url": "https://genius.com/artists/Frank-mccourt" } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 183, "api_path": "/songs/599402", "full_title": "Forum Cypher by Rap Genius Users (Ft. CKoo, Deadbby ♥, Génio, GOLD, Halfadelic, Mike M, Nebuchadnzr, Open Mike Eagle, Sho, Slickk, ​The Waters, VideoKilledTheStereochrome & WC-DRS)", "header_image_thumbnail_url": "https://images.rapgenius.com/7f86a64be9fceff8b1573e36b7bbb6a9.300x174x1.jpg", "header_image_url": "https://images.rapgenius.com/7f86a64be9fceff8b1573e36b7bbb6a9.650x378x1.jpg", "id": 599402, "lyrics_owner_id": 1077840, "lyrics_state": "complete", "path": "/Rap-genius-users-forum-cypher-lyrics", "pyongs_count": 48, "song_art_image_thumbnail_url": "https://images.rapgenius.com/7f86a64be9fceff8b1573e36b7bbb6a9.300x174x1.jpg", "song_art_image_url": "https://images.rapgenius.com/7f86a64be9fceff8b1573e36b7bbb6a9.650x378x1.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 5, "hot": false, "pageviews": 8680 }, "title": "Forum Cypher", "title_with_featured": "Forum Cypher (Ft. CKoo, Deadbby ♥, Génio, GOLD, Halfadelic, Mike M, Nebuchadnzr, Open Mike Eagle, Sho, Slickk, ​The Waters, VideoKilledTheStereochrome & WC-DRS)", "url": "https://genius.com/Rap-genius-users-forum-cypher-lyrics", "primary_artist": { "api_path": "/artists/162781", "header_image_url": "https://images.genius.com/882430e5576a18e89250517e295baae5.1000x1000x1.png", "id": 162781, "image_url": "https://images.genius.com/882430e5576a18e89250517e295baae5.1000x1000x1.png", "is_meme_verified": false, "is_verified": false, "name": "Rap Genius Users", "url": "https://genius.com/artists/Rap-genius-users" } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 0, "api_path": "/songs/4201801", "full_title": "In 21 Days by Kalisha Buckhanon", "header_image_thumbnail_url": "https://images.genius.com/eacfc3a7dedef2fd9a5556c0b0ae2a58.300x300x1.jpg", "header_image_url": "https://images.genius.com/eacfc3a7dedef2fd9a5556c0b0ae2a58.800x800x1.jpg", "id": 4201801, "lyrics_owner_id": 3528500, "lyrics_state": "complete", "path": "/Kalisha-buckhanon-in-21-days-annotated", "pyongs_count": null, "song_art_image_thumbnail_url": "https://images.genius.com/eacfc3a7dedef2fd9a5556c0b0ae2a58.300x300x1.jpg", "song_art_image_url": "https://images.genius.com/eacfc3a7dedef2fd9a5556c0b0ae2a58.800x800x1.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 0, "hot": false }, "title": "In 21 Days", "title_with_featured": "In 21 Days", "url": "https://genius.com/Kalisha-buckhanon-in-21-days-annotated", "primary_artist": { "api_path": "/artists/1685704", "header_image_url": "https://assets.genius.com/images/default_avatar_300.png?1617376358", "id": 1685704, "image_url": "https://assets.genius.com/images/default_avatar_300.png?1617376358", "is_meme_verified": false, "is_verified": false, "name": "Kalisha Buckhanon", "url": "https://genius.com/artists/Kalisha-buckhanon" } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 1, "api_path": "/songs/3089983", "full_title": "Country Way by Upchurch", "header_image_thumbnail_url": "https://images.genius.com/9a14594566f227fe45abedf17c94f113.300x300x1.jpg", "header_image_url": "https://images.genius.com/9a14594566f227fe45abedf17c94f113.1000x1000x1.jpg", "id": 3089983, "lyrics_owner_id": 3546776, "lyrics_state": "complete", "path": "/Upchurch-country-way-lyrics", "pyongs_count": null, "song_art_image_thumbnail_url": "https://images.genius.com/9a14594566f227fe45abedf17c94f113.300x300x1.jpg", "song_art_image_url": "https://images.genius.com/9a14594566f227fe45abedf17c94f113.1000x1000x1.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 0, "hot": false, "pageviews": 6490 }, "title": "Country Way", "title_with_featured": "Country Way", "url": "https://genius.com/Upchurch-country-way-lyrics", "primary_artist": { "api_path": "/artists/1049535", "header_image_url": "https://images.genius.com/5f0daa30a2b4ce046b804383ba29d419.1000x157x1.jpg", "id": 1049535, "image_url": "https://images.genius.com/c4ae1eea8d7bdbde7a05192b5f918dc5.467x467x1.png", "is_meme_verified": false, "is_verified": false, "name": "Upchurch", "url": "https://genius.com/artists/Upchurch" } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 104, "api_path": "/songs/2478447", "full_title": "Episode VII: The Force Awakens by Star Wars", "header_image_thumbnail_url": "https://images.genius.com/86486882d5ea1bf81a3adfc0ec996dee.300x150x1.jpg", "header_image_url": "https://images.genius.com/86486882d5ea1bf81a3adfc0ec996dee.1000x500x1.jpg", "id": 2478447, "lyrics_owner_id": 269182, "lyrics_state": "complete", "path": "/Star-wars-episode-vii-the-force-awakens-annotated", "pyongs_count": 6, "song_art_image_thumbnail_url": "https://images.rapgenius.com/e21874076bdeaf60f9ca6777bf0707cb.300x169x1.jpg", "song_art_image_url": "https://images.rapgenius.com/e21874076bdeaf60f9ca6777bf0707cb.1000x563x1.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 2, "hot": false, "pageviews": 14700 }, "title": "Episode VII: The Force Awakens", "title_with_featured": "Episode VII: The Force Awakens", "url": "https://genius.com/Star-wars-episode-vii-the-force-awakens-annotated", "primary_artist": { "api_path": "/artists/251256", "header_image_url": "https://images.genius.com/84c8b406571f1cc5fc037b969ad8433e.1000x606x1.jpg", "id": 251256, "image_url": "https://images.genius.com/e65ab523b3646e3b4c26554ae4e7dcc3.300x300x1.jpg", "is_meme_verified": false, "is_verified": false, "name": "Star Wars", "url": "https://genius.com/artists/Star-wars" } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 1, "api_path": "/songs/462323", "full_title": "Names of People (Chapter 1) by Marcel Proust", "header_image_thumbnail_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "header_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "id": 462323, "lyrics_owner_id": 184747, "lyrics_state": "complete", "path": "/Marcel-proust-names-of-people-chapter-1-lyrics", "pyongs_count": null, "song_art_image_thumbnail_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "song_art_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 0, "hot": false, "pageviews": 11910 }, "title": "Names of People (Chapter 1)", "title_with_featured": "Names of People (Chapter 1)", "url": "https://genius.com/Marcel-proust-names-of-people-chapter-1-lyrics", "primary_artist": { "api_path": "/artists/57252", "header_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "id": 57252, "image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "is_meme_verified": false, "is_verified": false, "name": "Marcel Proust", "url": "https://genius.com/artists/Marcel-proust" } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 1, "api_path": "/songs/467863", "full_title": "M. de Charlus during the war(Chap. 2) by Marcel Proust", "header_image_thumbnail_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "header_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "id": 467863, "lyrics_owner_id": 184747, "lyrics_state": "complete", "path": "/Marcel-proust-m-de-charlus-during-the-warchap-2-lyrics", "pyongs_count": null, "song_art_image_thumbnail_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "song_art_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 0, "hot": false }, "title": "M. de Charlus during the war(Chap. 2)", "title_with_featured": "M. de Charlus during the war(Chap. 2)", "url": "https://genius.com/Marcel-proust-m-de-charlus-during-the-warchap-2-lyrics", "primary_artist": { "api_path": "/artists/57252", "header_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "id": 57252, "image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "is_meme_verified": false, "is_verified": false, "name": "Marcel Proust", "url": "https://genius.com/artists/Marcel-proust" } } }, { "highlights": [], "index": "song", "type": "song", "result": { "annotation_count": 1, "api_path": "/songs/462325", "full_title": "A visit from Albertine (Chapter 2) by Marcel Proust", "header_image_thumbnail_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "header_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "id": 462325, "lyrics_owner_id": 184747, "lyrics_state": "complete", "path": "/Marcel-proust-a-visit-from-albertine-chapter-2-lyrics", "pyongs_count": null, "song_art_image_thumbnail_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "song_art_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "song_art_primary_color": null, "song_art_secondary_color": null, "song_art_text_color": null, "stats": { "unreviewed_annotations": 0, "hot": false, "pageviews": 6019 }, "title": "A visit from Albertine (Chapter 2)", "title_with_featured": "A visit from Albertine (Chapter 2)", "url": "https://genius.com/Marcel-proust-a-visit-from-albertine-chapter-2-lyrics", "primary_artist": { "api_path": "/artists/57252", "header_image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "id": 57252, "image_url": "https://s3.amazonaws.com/rapgenius/1374036251_Marcel_Proust_1900-2.jpg", "is_meme_verified": false, "is_verified": false, "name": "Marcel Proust", "url": "https://genius.com/artists/Marcel-proust" } } } ] } } ```
FiftyFour7250 commented 3 years ago

Is it possible to give the user a choice of each of the options? If the result in each of them of course is different. And by default, output one, I don't know, may be one that is more popular, or the option that has most successful results?

3

Devinpennings commented 3 years ago

What about using the primary_artist key as double check?

e.g. in pseudocode

query  "{artist} {title}"
If (hits.any(hit => hit.primary_artist.name === artist)
  return hit

query "{artist} & {title}
If (hits.any(hit => hit.primary_artist.name === artist)
  return hit

query "any other format"
...

I am not too sure about the results, but it could be a better fallback solution?

brentvollebregt commented 3 years ago

Hopefully a85ec2e5fe32ee4a5bcf44b6494019f6d4015519 does something for this issue.

Pretty much the flow now is:

  1. Search for ${artists[0]} ${title}
  2. If there is a hit and the first artist is in the name of the primary artist returned in the first hit, return this hit
  3. Search for ${artists.join(" & ")} ${title}
  4. If there is a hit and one of the artists names are in the name of the primary artist returned in the first hit, return this hit
  5. Return the first hit from step 1
brentvollebregt commented 1 year ago

Closing due to inactivity