diff options
author | HombreLaser <sebastian-440@live.com> | 2022-06-14 17:55:01 -0500 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2022-06-14 17:55:01 -0500 |
commit | 71a2a3fd8b13f6c3e942df5e68bb56e5aad50c2f (patch) | |
tree | cc355be57fdbc0ef7a384c3334018c2cd308e599 /src/ampache | |
parent | 13c803dedb9634479a7e46574f360bd3517eef50 (diff) |
Añadido lector de config
Diffstat (limited to 'src/ampache')
-rw-r--r-- | src/ampache/ampache.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ampache/ampache.py b/src/ampache/ampache.py index e74029d..b58ba36 100644 --- a/src/ampache/ampache.py +++ b/src/ampache/ampache.py @@ -3,7 +3,6 @@ The main file. The AmpacheClient class allows us to make requests to the API. """ from datetime import datetime -from sys import version from ampache import models, exceptions import requests @@ -61,7 +60,7 @@ class AmpacheClient: def request(self, params, headers): """ - All in one function to pass JSON requests to the API. + All in one function to pass requests to the API. """ response = requests.get(self._host + self._endpoint, params=params, headers=headers) @@ -71,9 +70,9 @@ class AmpacheClient: if headers['Content-type'] == 'application/json': response = response.json() - if 'error' in response: - self.raise_by_status(models.Error(int(response['error']['errorCode']), - response['error']['errorMessage'])) + if 'error' in response: + self.raise_by_status(models.Error(int(response['error']['errorCode']), + response['error']['errorMessage'])) return response @@ -160,7 +159,7 @@ class AmpacheClient: } data = self.request(params, headers) - with open(destination, 'wb') as song: + with open(destination, 'wb') as song: song.write(data.content) def renew_token(self): |