Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Commit

Permalink
fix: raise auth error
Browse files Browse the repository at this point in the history
  • Loading branch information
sibalzer committed Oct 4, 2021
1 parent 450402d commit 74de12e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions primelooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ def auth(self) -> None:
self.page.goto('https://gaming.amazon.com/home')
response = response_info.value.json()['data']['currentUser']
if not response['isSignedIn']:
Exception('Authentication: Not signed in')
raise Exception('Authentication: Not signed in')
elif not response['isAmazonPrime']:
Exception('Authentication: Not a valid Amazon Prime account')
raise Exception(
'Authentication: Not a valid Amazon Prime account')
elif not response['isTwitchPrime']:
Exception('Authentication: Not a valid Twitch Prime account')
raise Exception(
'Authentication: Not a valid Twitch Prime account')

def get_offers(self) -> typing.List:
with self.page.expect_response(lambda response: 'https://gaming.amazon.com/graphql' in response.url and 'primeOffers' in response.json()['data']) as response_info:
Expand Down

0 comments on commit 74de12e

Please sign in to comment.