Sent headers with the requests
This commit is contained in:
parent
942bd67c2c
commit
9fda5f3bad
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ class Steam:
|
||||||
async def find_id(self, user: str):
|
async def find_id(self, user: str):
|
||||||
# Get the profile link based on the user provided, and request the xml data for it
|
# 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)
|
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()
|
data = response.text()
|
||||||
# Remove the xml version content, it breaks etree.fromstring
|
# Remove the xml version content, it breaks etree.fromstring
|
||||||
data = re.sub('<\?xml.*\?>', '', data)
|
data = re.sub('<\?xml.*\?>', '', data)
|
||||||
|
@ -56,7 +56,7 @@ class Steam:
|
||||||
return
|
return
|
||||||
|
|
||||||
url = "{}&appid=730&steamid={}".format(base_url, steam_id)
|
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()
|
data = response.json()
|
||||||
|
|
||||||
stuff_to_print = ['total_kills', 'total_deaths', 'total_wins', 'total_mvps']
|
stuff_to_print = ['total_kills', 'total_deaths', 'total_wins', 'total_mvps']
|
||||||
|
|
Loading…
Reference in a new issue