Fix download of samples with the new archive format.

pull/2/merge v1.7
Raphaël Vinot 2015-08-24 12:05:49 +02:00
parent 218ffcd915
commit e4d96bd198
2 changed files with 7 additions and 2 deletions

View File

@ -320,7 +320,12 @@ class PyMISP(object):
for f in result['result']:
zipped = StringIO.StringIO(base64.b64decode(f['base64']))
archive = zipfile.ZipFile(zipped)
unzipped = StringIO.StringIO(archive.open(f['md5'], pwd='infected').read())
try:
# New format
unzipped = StringIO.StringIO(archive.open(f['filename'], pwd='infected').read())
except KeyError:
# Old format
unzipped = StringIO.StringIO(archive.open(f['md5'], pwd='infected').read())
details.append([f['event_id'], f['filename'], unzipped])
return True, details

View File

@ -4,7 +4,7 @@ from setuptools import setup
setup(
name='pymisp',
version='1.6',
version='1.7',
author='Raphaël Vinot',
author_email='raphael.vinot@circl.lu',
maintainer='Raphaël Vinot',