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

Search artist with include_features=True does not work #216

Open
mg98 opened this issue Jul 7, 2021 · 1 comment
Open

Search artist with include_features=True does not work #216

mg98 opened this issue Jul 7, 2021 · 1 comment

Comments

@mg98
Copy link

mg98 commented Jul 7, 2021

Whenever I pass the argument include_features=True to genius.search_artist, I get this error messages:

KeyError: 'featured_artists'
    result = artist.add_song(song, verbose=False,
  File "/usr/local/lib/python3.9/site-packages/lyricsgenius/types/artist.py", line 79, in add_song
    or (include_features and any(new_song._body['featured_artists']))):
KeyError: 'featured_artists'

I haven't worked with this lib before (love it so far!), but maybe this is due to a recent change on genius' side?

Version info

  • Package version: 3.0.1
  • OS: macOS
@JaySCarter
Copy link

I'm 100% the wrong person to develop a real solution but maybe the key that is producing the error ('featured_artists') should change to 'title_with_featured'. Below is a sample response from the API docs (https://docs.genius.com/#/authentication-h1) using the Try It button on the GET /artists/:id/songs section with this API call: artists/2/songs

{
annotation_count: 46,
api_path: "/songs/80548",
full_title: "3 Kings by Rick Ross (Ft. Dr. Dre & JAY-Z)",
header_image_thumbnail_url: "https://images.genius.com/52547754f795d4ff94def40716ed3a2e.300x300x1.jpg",
header_image_url: "https://images.genius.com/52547754f795d4ff94def40716ed3a2e.1000x1000x1.jpg",
id: 80548,
lyrics_owner_id: 11524,
lyrics_state: "complete",
path: "/Rick-ross-3-kings-lyrics",
pyongs_count: 21,
song_art_image_thumbnail_url: "https://images.genius.com/eab4da932239dc10cc5f63e1d22e77f9.300x300x1.jpg",
song_art_image_url: "https://images.genius.com/eab4da932239dc10cc5f63e1d22e77f9.1000x1000x1.jpg",
+stats: {...},
title: "3 Kings",
title_with_featured: "3 Kings (Ft. Dr. Dre & JAY-Z)",
url: "https://genius.com/Rick-ross-3-kings-lyrics",
song_art_primary_color: "#f4b411",
song_art_secondary_color: "#edd772",
song_art_text_color: "#000",
+primary_artist: {...}
}
],
next_page: 2

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

No branches or pull requests

2 participants