From a73c687596c2fd66afb50aac1844d2c3e5a5fcd3 Mon Sep 17 00:00:00 2001 From: ctso Date: Wed, 30 Jun 2010 05:52:16 +0000 Subject: [PATCH] More get-google-files bugfixes. --- get-google-files | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/get-google-files b/get-google-files index 153f9f48..fa3c5612 100755 --- a/get-google-files +++ b/get-google-files @@ -15,7 +15,6 @@ def download(): os.makedirs("proprietary") except: pass - os.chdir("proprietary") if len(MIRRORS) > 1: i = random.randrange(0, len(MIRRORS)-1) else: @@ -27,11 +26,15 @@ def download(): zip = zipfile.ZipFile(StringIO.StringIO(data),'r') for filename in zip.namelist(): - if filename.split("/")[0] == "system": + if filename.split("/")[0] == "system" and filename[-1] != "/": print "Extracting %s" % filename try: - zip.extract(filename) - except: + bytes = zip.read(filename) + fd = open("proprietary/"+os.path.basename(filename),"wb") + fd.write(bytes) + fd.close() + except Exception, e: + print e pass def main():