-
Notifications
You must be signed in to change notification settings - Fork 166
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
Add option to get metadata of desired track #257
Comments
You can get the producers of a song if you get the song info from their WebAPI: genius = lyricsgenius.PublicAPI()
song = genius.song(1)["song"]
for artist in song["producer_artists"]:
print(artist["name"], sep=", ") There is a chance this might raise a HTTP 403 error which is referenced in #220 |
Thank you! Im trying to test this way ASAP |
Hey @allerter, Just wanted to drop a quick note to say thanks for showing me a way to tackle my idea. I gave it a try, and it worked like a charm! By the way, I have a small question. It seems that when I set max_songs=10, the code crashes. It only works smoothly if I keep the value at 2 or below. Here's the code snippet I'm referring to:
If you have any tips or insights on how to overcome this issue, I'd really appreciate your help. |
That is likely because of the timeout errors. You could try increasing the sleep time between each request: genius = lyricsgenius.PublicAPI(sleep_time=2) This way, the client waits 2 seconds between each request to the API. |
Hey @allerter, exciting news! I've fixed my code and now it's returning the exact data I need. I can easily grab the names of the production team members. But here's the deal: I'm now facing a challenge where I want to fetch the producer's Instagram link. Do you reckon it's possible to get it solely using this API? Or should I turn to other tools like the 'scrapy' library? My thought is to search for the producer's page on the Genius website and scrape it smoothly. Your thoughts on this would be highly appreciated! |
Actually, the WebAPI already provides their Twitter and Instagram username. Try this: genius = lyricsgenius.PublicAPI(sleep_time=2)
artist = genius.artist(264329)["artist"]
print(artist["instagram_name"]) |
Thank you, @allerter! It's really worked well on me! I will keep updating my code, because I feel I need to find first how to retrieve Genius Artist ID. In order to appreciate your time, does it possible to ask you where can I read more about work with WEB API? |
The WebAPI is the API users use when browsing through the Genius's website. It has no documentation and isn't meant to be used by the developers. Genius has their own official Developer API, but it's very limited, so we resort to their unofficial WebAPI to get the info we want. You can explore the WebAPI by looking at the dictionary objects returned by the methods we use. We also have a reference docs that we've tried to implement all the WebAPI endpoints in. |
Firstly, I would like to extend my appreciation for the exceptional tool you have developed!
Could I ask you please to add a method that will return also who produced a track? (I highlighted area with blue color)
If it will be able to implement with return of producer names and their link_pages on Genius.com, I will be kindly appreciated!
Thank you for your attention to this matter and for creating such an impressive tool.
The text was updated successfully, but these errors were encountered: