From b2f619f824888b90fae97531ec00f8f8d1e613e0 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 1 Jun 2016 13:03:29 +0200 Subject: [PATCH] Update mobileauth.py --- steam/mobileauth.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/steam/mobileauth.py b/steam/mobileauth.py index 6ef7582..e86693b 100644 --- a/steam/mobileauth.py +++ b/steam/mobileauth.py @@ -59,6 +59,22 @@ class MobileAuth(object): self.key = backend.load_rsa_public_numbers(nums) self.timestamp = resp['timestamp'] + + def request(self, uri, data): + if not self.complete: + return None + + headers = { + 'X-Requested-With': 'com.valvesoftware.android.steam.community', + 'User-agent': 'Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; Google Nexus 4 - 4.1.1 - API 16 - 768x1280 Build/JRO03S) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30' + } + + try: + response = self.session.post(uri, data=data, headers=headers) + except requests.exceptions.RequestException as e: + raise HTTPError(str(e)) + else: + return response def login(self, captcha='', email_code='', twofactor_code='', language='english'): if self.complete: