mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
tracer bugfix
This commit is contained in:
parent
942cafd644
commit
15e94bbd83
1 changed files with 3 additions and 1 deletions
4
db.py
4
db.py
|
@ -571,11 +571,13 @@ class Overwatch(Base):
|
||||||
j = r.json()["eu"]["stats"].get("competitive")
|
j = r.json()["eu"]["stats"].get("competitive")
|
||||||
if j is None:
|
if j is None:
|
||||||
raise RequestError("Something went wrong when retrieving the stats.")
|
raise RequestError("Something went wrong when retrieving the stats.")
|
||||||
|
if not j["game_stats"]:
|
||||||
|
raise RequestError("Something went wrong when retrieving the stats.")
|
||||||
j = j["overall_stats"]
|
j = j["overall_stats"]
|
||||||
except TypeError:
|
except TypeError:
|
||||||
raise RequestError("Something went wrong when retrieving the stats.")
|
raise RequestError("Something went wrong when retrieving the stats.")
|
||||||
try:
|
try:
|
||||||
self.icon = re.search(r"https://.+\.cloudfront\.net/game/unlocks/(0x[0-9A-F]+)\.png", j.get("avatar", "")).group(1)
|
self.icon = re.search(r"https://.+\.cloudfront\.net/game/unlocks/(0x[0-9A-F]+)\.png", j["avatar"]).group(1)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
self.level = j["prestige"] * 100 + j["level"]
|
self.level = j["prestige"] * 100 + j["level"]
|
||||||
|
|
Loading…
Reference in a new issue