blizzardapi2 0.1.4__tar.gz → 0.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/PKG-INFO +1 -1
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/api.py +5 -2
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/pyproject.toml +1 -1
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/LICENSE +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/README.md +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/__init__.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/battlenet/__init__.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/battlenet/battlenet_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/battlenet/battlenet_oauth_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/blizzard_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/diablo3/__init__.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/diablo3/diablo3_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/diablo3/diablo3_community_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/diablo3/diablo3_game_data_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/hearthstone/__init__.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/hearthstone/hearthstone_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/hearthstone/hearthstone_game_data_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/starcraft2/__init__.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/starcraft2/starcraft2_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/starcraft2/starcraft2_community_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/starcraft2/starcraft2_game_data_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/wow/__init__.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/wow/wow_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/wow/wow_game_data_api.py +0 -0
- {blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/wow/wow_profile_api.py +0 -0
|
@@ -37,7 +37,7 @@ class Api:
|
|
|
37
37
|
|
|
38
38
|
def _is_token_expired(self) -> bool:
|
|
39
39
|
"""Check if the token has expired."""
|
|
40
|
-
return time() >= self.
|
|
40
|
+
return time() >= self._token_expiration
|
|
41
41
|
|
|
42
42
|
def _get_client_token(self, region: str) -> Dict[str, Any]:
|
|
43
43
|
"""Fetch an access token based on client id and client secret credentials.
|
|
@@ -55,9 +55,11 @@ class Api:
|
|
|
55
55
|
auth=(self._client_id, self._client_secret),
|
|
56
56
|
)
|
|
57
57
|
|
|
58
|
-
json_response = self.
|
|
58
|
+
json_response = self._response_handler(response)
|
|
59
59
|
self._access_token = json_response["access_token"]
|
|
60
60
|
self._token_expiration = time() + json_response["expires_in"] - 300
|
|
61
|
+
|
|
62
|
+
return json_response
|
|
61
63
|
|
|
62
64
|
def _ensure_valid_token (self, region: str) -> None:
|
|
63
65
|
"""Ensure that the token is valid."""
|
|
@@ -66,6 +68,7 @@ class Api:
|
|
|
66
68
|
|
|
67
69
|
def _response_handler(self, response: requests.Response) -> Dict[str, Any]:
|
|
68
70
|
"""Handle the response."""
|
|
71
|
+
response.raise_for_status()
|
|
69
72
|
return response.json()
|
|
70
73
|
|
|
71
74
|
def _request_handler(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/hearthstone/hearthstone_game_data_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/starcraft2/starcraft2_community_api.py
RENAMED
|
File without changes
|
{blizzardapi2-0.1.4 → blizzardapi2-0.1.6}/blizzardapi2/starcraft2/starcraft2_game_data_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|