Restyled by autopep8
This commit is contained in:
parent
04165151d7
commit
20501cdd58
|
@ -54,7 +54,8 @@ class ApiClient(Closeable):
|
||||||
if self.__client_token_str is None:
|
if self.__client_token_str is None:
|
||||||
resp = self.__client_token()
|
resp = self.__client_token()
|
||||||
self.__client_token_str = resp.granted_token.token
|
self.__client_token_str = resp.granted_token.token
|
||||||
self.logger.debug("Updated client token: {}".format(self.__client_token_str))
|
self.logger.debug("Updated client token: {}".format(
|
||||||
|
self.__client_token_str))
|
||||||
|
|
||||||
request = requests.PreparedRequest()
|
request = requests.PreparedRequest()
|
||||||
request.method = method
|
request.method = method
|
||||||
|
@ -194,11 +195,11 @@ class ApiClient(Closeable):
|
||||||
)
|
)
|
||||||
|
|
||||||
resp = requests.post("https://clienttoken.spotify.com/v1/clienttoken",
|
resp = requests.post("https://clienttoken.spotify.com/v1/clienttoken",
|
||||||
proto_req.SerializeToString(),
|
proto_req.SerializeToString(),
|
||||||
headers={
|
headers={
|
||||||
"Accept": "application/x-protobuf",
|
"Accept": "application/x-protobuf",
|
||||||
"Content-Encoding": "",
|
"Content-Encoding": "",
|
||||||
})
|
})
|
||||||
|
|
||||||
ApiClient.StatusCodeException.check_status(resp)
|
ApiClient.StatusCodeException.check_status(resp)
|
||||||
|
|
||||||
|
@ -235,7 +236,8 @@ class ApResolver:
|
||||||
service_type))
|
service_type))
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
if response.status_code == 502:
|
if response.status_code == 502:
|
||||||
raise RuntimeError(f"ApResolve request failed with the following return value: {response.content}. Servers might be down!")
|
raise RuntimeError(
|
||||||
|
f"ApResolve request failed with the following return value: {response.content}. Servers might be down!")
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue