discogs / discogs_client

DEPRECATED - Official Python Client for the Discogs API
http://www.discogs.com/developers
Other
479 stars 132 forks source link

Production Credits #81

Closed oscarsidebo closed 7 years ago

oscarsidebo commented 7 years ago

I'm trying to pull the production credits that is available on Discogs via the API.

Below is code used...

Using this code: ds = dc.Client('my_user_agent/1.0', user_token='TGjmBpvRysxrrrvnorTshtEFFQcNsqfXNBPIIhVd') release = ds.release('8976417') track = release.tracklist[0] print(track.credits[0])

Output is: <Artist 1280700 'Darren Dodd'>

In this case Darren Dodd was playing Drums on the track but I'm not able to pull that information.

Does anyone know if it's possible?

shaolo1 commented 7 years ago

You may need to look at the data member to get what you are looking for

            for track in release.tracklist:
                credits_ = track.data['credits']
                for credit_index, credit in enumerate(credits_):
                    role = credit[0]
                    artist = credit[1]
oscarsidebo commented 7 years ago

That works, thank you