Skip to content

Instantly share code, notes, and snippets.

@HippoProgrammer
Created October 30, 2025 14:28
Show Gist options
  • Select an option

  • Save HippoProgrammer/5dfc621e157a2c949d9ca5acedfdf7e3 to your computer and use it in GitHub Desktop.

Select an option

Save HippoProgrammer/5dfc621e157a2c949d9ca5acedfdf7e3 to your computer and use it in GitHub Desktop.
A Python script that fixes the output of this script - https://gist.github.com/SomeAspy/2b27a6d66b97db6bd1b62afac5343285?ref=blog.aspy.dev - to work again.
# A quick and dirty script to convert old Lurkr-format data extracted from Arcane to new Lurkr-format
import json
import os
from copy import deepcopy
input_file = 'None'
while not os.path.exists(input_file):
input_file = str(input('Input file path? '))
output_file = "output.json"
with open(input_file,'r') as old_file:
old_file_json = json.loads(old_file.read())
new_file_json = {
"levels": []
}
new_user_json_template = {
"messageCount":0,
"user": {
"avatar": "",
"discriminator": "0",
"username": ""
},
"userId": "",
"xp": 0,
"level": 0
}
for old_user_json in old_file_json["levels"]:
new_user_json = deepcopy(new_user_json_template)
new_user_json["messageCount"] = old_user_json["messageCount"]
new_user_json["user"]["avatar"] = old_user_json["avatar"]
new_user_json["user"]["username"] = old_user_json["tag"]
new_user_json["userId"] = old_user_json["userId"]
new_user_json["xp"] = old_user_json["xp"]
new_user_json["level"] = old_user_json["level"]
new_file_json["levels"].append(new_user_json)
with open(output_file,'w') as new_file:
new_file.write(json.dumps(new_file_json, indent = 2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment