-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
38 lines (32 loc) · 1.14 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from srcomapipy.srcomapipy import SRC
from srcomapipy.srctypes import *
def main():
from os import getenv
from dotenv import load_dotenv
load_dotenv()
api_key = getenv("SRCAPIKEY")
api = SRC(api_key=api_key)
me = api.get_current_profile()
print(me)
print(api.search_game(name="Batman"))
game = api.search_game("Batman: Arkham City")[0]
my_pbs = api.get_user_pbs(me, game_id=game.id, embeds=["game"])
print(my_pbs.runs)
runs: list[Run] = api.get_runs(game_id=game.id, status="new")
print(runs)
cat = game.categories["Fastest"]
lvl = game.levels["Meltdown Mayhem"]
lbrd = api.get_leaderboard(
game, cat, lvl, variables=[(cat.variables["Version"], "PC")]
)
print(lbrd, lbrd.top_runs)
# for name, cat in game.categories.items():
# print(f"category: {name}")
# for _, v in cat.variables.items():
# print(f"{v} {v.mandatory=} {v.obsoletes=} {v.is_subcategory=}")
series = api.get_series(name="Batman")
print(series)
print(api.generic_get("platforms", "o7e25xew"))
print(api.search_game(name="Batman"))
if __name__ == "__main__":
main()