def extractZip(archive, targetDir):
 try:
  if (not os.path.exists(targetDir)):
   os.mkdir(targetDir)
  zip_file = zipfile.ZipFile(archive, u'r', allowZip64=True)
  for member in zip_file.namelist():
   filename = os.path.basename(member)
   if (not filename):
    continue
   source = zip_file.open(member)
   target = io.open(os.path.join(targetDir, filename), u'wb')
   shutil.copyfileobj(source, target)
   source.close()
   target.close()
  zip_file.close()
  return True
 except Exception as e:
  sickrage.srCore.srLogger.error((u'Zip extraction error: %r ' % repr(e)))
  return False

def extractZip ( archive , targetDir ) : try : if ( not os . path . exists ( targetDir ) ) : os . mkdir ( targetDir ) zip_file = zipfile . ZipFile ( archive , u'r' , allowZip64 = True ) for member in zip_file . namelist ( ) : filename = os . path . basename ( member ) if ( not filename ) : continue source = zip_file . open ( member ) target = io . open ( os . path . join ( targetDir , filename ) , u'wb' ) shutil . copyfileobj ( source , target ) source . close ( ) target . close ( ) zip_file . close ( ) return True except Exception as e : sickrage . srCore . srLogger . error ( ( u'Zip extraction error: %r ' % repr ( e ) ) ) return False
unzip a file to a directory .