Skip to content

Instantly share code, notes, and snippets.

@jedy
Created July 8, 2013 02:34
Show Gist options
  • Save jedy/5945865 to your computer and use it in GitHub Desktop.
Save jedy/5945865 to your computer and use it in GitHub Desktop.
convert pvr to pvr.ccz
import zlib
import struct
import sys
pvr = sys.argv[1]
ccz = pvr + ".ccz"
pvr = open(pvr).read()
ccz = open(ccz, "wb")
ccz.write(struct.pack(">4sHHII", "CCZ!", 0, 1, 0, len(pvr)))
ccz.write(zlib.compress(pvr))
ccz.close()
@harmy
Copy link

harmy commented Jan 28, 2015

第8行改成pvr=open(pvr, "rb").read()  后能正常工作。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment