Skip to content

Instantly share code, notes, and snippets.

@HelloZeroNet
Created November 20, 2016 10:05
Show Gist options
  • Save HelloZeroNet/b03479e404836728faa8f1acc4ccf781 to your computer and use it in GitHub Desktop.
Save HelloZeroNet/b03479e404836728faa8f1acc4ccf781 to your computer and use it in GitHub Desktop.
import zipfile, time
import cStringIO as StringIO
data = StringIO.StringIO()
req = open("archive.zip@ref=master", "rb")
while True:
buff = req.read(1024)
if not buff:
break
data.write(buff)
data.seek(0)
try:
zipdata = zipfile.ZipFile(data)
print ".",
except Exception, err:
print "-",
data.seek(0, 2)
s = time.time()
zipdata = zipfile.ZipFile(data)
print time.time() - s
print zipdata.testzip()
print time.time() - s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment