Fixed country instance issue

This commit is contained in:
RemixDev 2021-08-04 21:36:06 +02:00
parent 53176663f0
commit 9d605df99d
No known key found for this signature in database
GPG key ID: B33962B465BDB51C
2 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@ from deezer.gw import GW
from deezer.api import API
from deezer.errors import DeezerError, WrongLicense, WrongGeolocation
__version__ = "1.1.1"
__version__ = "1.1.2"
class TrackFormats():
"""Number associtation for formats"""
@ -173,7 +173,7 @@ class Deezer:
if len(response.get('data', [])):
if 'errors' in response['data'][0]:
if response['data'][0]['errors'][0]['code'] == 2002:
raise WrongGeolocation(self.current_user.country)
raise WrongGeolocation(self.current_user['country'])
raise DeezerError(json.dumps(response))
if response['data'][0]['media']:
return response['data'][0]['media'][0]['sources'][0]['url']

View file

@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
setup(
name="deezer-py",
version="1.1.1",
version="1.1.2",
description="A wrapper for all Deezer's APIs",
long_description=README,
long_description_content_type="text/markdown",