1
0
Fork 0
mirror of synced 2024-06-28 19:20:34 +12:00

Sent headers with the requests

This commit is contained in:
phxntxm 2016-08-19 01:52:59 -05:00
parent 942bd67c2c
commit 9fda5f3bad

View file

@ -19,7 +19,7 @@ class Steam:
async def find_id(self, user: str):
# Get the profile link based on the user provided, and request the xml data for it
url = 'http://steamcommunity.com/id/{}/?xml=1'.format(user)
async with self.session.get(url) as response:
async with self.session.get(url, headers=self.headers) as response:
data = response.text()
# Remove the xml version content, it breaks etree.fromstring
data = re.sub('<\?xml.*\?>', '', data)
@ -56,7 +56,7 @@ class Steam:
return
url = "{}&appid=730&steamid={}".format(base_url, steam_id)
async with self.session.get(url) as response:
async with self.session.get(url, headers=self.headers) as response:
data = response.json()
stuff_to_print = ['total_kills', 'total_deaths', 'total_wins', 'total_mvps']