diff --git a/steampy/client.py b/steampy/client.py index ece1057..7f024a3 100644 --- a/steampy/client.py +++ b/steampy/client.py @@ -9,7 +9,7 @@ from steampy import guard from steampy.confirmation import ConfirmationExecutor -from steampy.exceptions import SevenDaysHoldException, ApiException +from steampy.exceptions import SevenDaysHoldException, ApiException, TooManyRequests from steampy.login import LoginExecutor, InvalidCredentials from steampy.market import SteamMarket from steampy.models import Asset, TradeOfferState, SteamUrl, GameOptions @@ -163,7 +163,11 @@ def get_partner_inventory( url = '/'.join((SteamUrl.COMMUNITY_URL, 'inventory', partner_steam_id, game.app_id, game.context_id)) params = {'l': 'english', 'count': count} - response_dict = self._session.get(url, params=params).json() + full_response = self._session.get(url, params=params) + response_dict = full_response.json() + if full_response.status_code == 429: + raise TooManyRequests('Too many requests, try again later.') + if response_dict is None or response_dict.get('success') != 1: raise ApiException('Success value should be 1.')