Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _fetch_confirmations_page(self) -> requests.Response:
tag = Tag.CONF.value
params = self._create_confirmation_params(tag)
headers = {'X-Requested-With': 'com.valvesoftware.android.steam.community'}
response = self._session.get(self.CONF_URL + '/conf', params=params, headers=headers)
if 'Steam Guard Mobile Authenticator is providing incorrect Steam Guard codes.' in response.text:
raise InvalidCredentials('Invalid Steam Guard file')
return response
def api_call(self, request_method: str, interface: str, api_method: str, version: str,
params: dict = None) -> requests.Response:
url = '/'.join([SteamUrl.API_URL, interface, api_method, version])
if request_method == 'GET':
response = requests.get(url, params=params)
else:
response = requests.post(url, data=params)
if self.is_invalid_api_key(response):
raise InvalidCredentials('Invalid API key')
return response