From 99c97032b49121f44bff4c18897f66395065c1b4 Mon Sep 17 00:00:00 2001 From: derrod Date: Wed, 29 Dec 2021 21:14:59 +0100 Subject: [PATCH] [api] Fix GQL API requests These need to use a different User-Agent for some reason. --- legendary/api/egs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/legendary/api/egs.py b/legendary/api/egs.py index 0b0ddc7..cf4bd53 100644 --- a/legendary/api/egs.py +++ b/legendary/api/egs.py @@ -235,6 +235,7 @@ class EPCAPI: def store_get_uplay_codes(self): user_id = self.user.get('account_id') r = self.session.post(f'https://{self._store_gql_host}/graphql', + headers={'user-agent': self._store_user_agent}, json=dict(query=uplay_codes_query, variables=dict(accountId=user_id))) r.raise_for_status() @@ -243,6 +244,7 @@ class EPCAPI: def store_claim_uplay_code(self, uplay_id, game_id): user_id = self.user.get('account_id') r = self.session.post(f'https://{self._store_gql_host}/graphql', + headers={'user-agent': self._store_user_agent}, json=dict(query=uplay_claim_query, variables=dict(accountId=user_id, uplayAccountId=uplay_id, @@ -253,6 +255,7 @@ class EPCAPI: def store_redeem_uplay_codes(self, uplay_id): user_id = self.user.get('account_id') r = self.session.post(f'https://{self._store_gql_host}/graphql', + headers={'user-agent': self._store_user_agent}, json=dict(query=uplay_redeem_query, variables=dict(accountId=user_id, uplayAccountId=uplay_id)))