Created
May 20, 2020 02:20
-
-
Save squaresmile/0c16c459c2a9164e7e9456ace28f01a5 to your computer and use it in GitHub Desktop.
A small script to extract fgo master data from kazemai
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lzstring | |
import requests | |
KAZEMAI_DATA = "https://kazemai.github.io/fgo-vz/common/js/master.js" | |
print("Downloading master.js") | |
r = requests.get(KAZEMAI_DATA) | |
master_data = r.text.splitlines()[0][65:-4] | |
with open("master.txt", "w", encoding="utf-8") as fp: | |
fp.write(master_data) | |
master_bytes = bytes.fromhex(master_data) | |
master_string = "" | |
for i in range(len(master_bytes) // 2): | |
master_string += chr(master_bytes[i * 2] | master_bytes[i * 2 + 1] << 8) | |
print("LZString decompress") | |
lz_string = lzstring.LZString() | |
mstTxt = lz_string.decompress(master_string) | |
with open("kazemai.json", "w", encoding="utf-8") as fp: | |
fp.write(mstTxt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Browse the data here https://fgo.square.ovh/kazemai/