import zlib

INPUT_JSON = "library.json"
OUTPUT_BIN = "library.bin"

with open(INPUT_JSON, "rb") as f:
    raw = f.read()

# zlib compress level 9 (Flash expects this)
data = zlib.compress(raw, 9)

with open(OUTPUT_BIN, "wb") as f:
    f.write(data)

print("✔ Repack sukses →", OUTPUT_BIN)
