import zlib

INPUT_BIN  = "library.bin"
OUTPUT_JSON = "library.json"

with open(INPUT_BIN, "rb") as f:
    data = f.read()

# zlib decompress (Flash-compatible)
raw = zlib.decompress(data)

with open(OUTPUT_JSON, "wb") as f:
    f.write(raw)

print("✔ Extract sukses →", OUTPUT_JSON)
