joalla / discogs_client

Continuation of the "Official Python Client for the Discogs API"
https://python3-discogs-client.readthedocs.io
Other
299 stars 49 forks source link

getting master by id raises json decode error #83

Closed inktrap closed 2 years ago

inktrap commented 2 years ago

I am trying to get the master of this id: https://www.discogs.com/master/392093-Childish-Gambino-Camp

discogs = discogs_client.Client(f"examplename/1.0")
discogs.master(392093)

but this raises json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

For other master's it seems to work at first:

>>> discogs.master("2482309")
<Master '2482309' 'Shroud'>

But if I access an attribute it fails anyways:

>>> discogs.master("2482309").main_release
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Can you replicate this or do you need more info?

inktrap commented 2 years ago

I guess this should return None if an attribute is not set or an item (artist, release, master) doesn't exist.

inktrap commented 2 years ago

Actually, this seemed like a rather strange issue, so i tested this again and now it somehow worked?

#!/usr/bin/env python
import discogs_client

discogs = discogs_client.Client(f"examplename/1.0")
m = discogs.master(392093)

And then I can do with m something like m.main_release.

So I guess I'll close this for now and re-open it if something like this pops up again.