Skip to content

Commit 066ee28

Browse files
committed
Remove null bytes before VDF parsing
1 parent 4f2f495 commit 066ee28

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tf2utilities/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ def get_paint_kits() -> dict:
15231523
"""
15241524
response = requests.get('https://raw.githubusercontent.com/SteamDatabase/GameTracking-TF2/master/tf/resource/tf_proto_obj_defs_english.txt', timeout=10)
15251525
if response.status_code == 200:
1526-
parsed = vdf.loads(response.text)
1526+
parsed = vdf.loads(response.text.replace('\x00', ''))
15271527
protodefs = parsed["lang"]["Tokens"]
15281528
paintkits = []
15291529
for protodef in protodefs:
@@ -1557,7 +1557,7 @@ def get_items_game() -> dict:
15571557
"""
15581558
response = requests.get('https://raw.githubusercontent.com/SteamDatabase/GameTracking-TF2/master/tf/scripts/items/items_game.txt', timeout=10)
15591559
if response.status_code == 200:
1560-
return vdf.loads(response.text)["items_game"]
1560+
return vdf.loads(response.text.replace('\x00', ''))["items_game"]
15611561
else:
15621562
raise Exception("Failed to get items game.")
15631563

0 commit comments

Comments
 (0)