fixed issue with API not returning certain players, names need to be down-cased for the API
This commit is contained in:
parent
c6910be54f
commit
12c783aa3f
@ -1,8 +1,9 @@
|
||||
import requests, json, pprint, discord
|
||||
from bs4 import BeautifulSoup
|
||||
pp = pprint.PrettyPrinter(indent=4)
|
||||
|
||||
def get_player(player):
|
||||
# try:
|
||||
player = player.lower()
|
||||
url = "https://battlefieldtracker.com/bfv/profile/origin/" + player + "/overview"
|
||||
headers = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)' }
|
||||
response = requests.get(url, headers=headers).text
|
||||
@ -49,7 +50,6 @@ def get_player(player):
|
||||
]
|
||||
|
||||
for stat in gameplay_stats:
|
||||
# print(stat)
|
||||
embed.add_field(name="**%s**" % stats_overview[stat]['displayName'], value=stats_overview[stat]['displayValue'], inline=False)
|
||||
# embed.add_field(name='Raw value', value=stats_overview[stat]['displayValue'], inline=True)
|
||||
# embed.add_field(name='Global Percentile', value=stats_overview[stat]['percentile'], inline=True)
|
||||
@ -59,5 +59,3 @@ def get_player(player):
|
||||
|
||||
# assault_stats = base_stat_blob['segments'][9]
|
||||
# medic_stats = base_stat_blob['segments'][10]
|
||||
|
||||
# pp.pprint(medic_stats)
|
Loading…
x
Reference in New Issue
Block a user