(self)
return True
Download file http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip
Download file http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip
Download file http : // s3 - us - west - 1 . amazonaws . com / umbrella - static / top - 1m . csv . zip
def update(self):
        """
        Download file http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip
        """
        print("Downloading Umbrella Top 1 million websites")
        if os.path.isfile(self.topfile):
            os.remove(self.topfile)
        r = requests.get("http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip")
        if r.status_code != 200:
            print("Impossible to download Umbrella Top 1 millon CSV file.")
            return False
        input_zip=ZipFile(BytesIO(r.content))
        fname = input_zip.namelist()[0]
        with open(self.topfile, "a+") as f:
            f.write(input_zip.read(fname).decode('utf-8'))
        return True
def update ( self ) : print ( "Downloading Umbrella Top 1 million websites" ) if os . path . isfile ( self . topfile ) : os . remove ( self . topfile ) r = requests . get ( "http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip" ) if r . status_code != 200 : print ( "Impossible to download Umbrella Top 1 millon CSV file." ) return False input_zip = ZipFile ( BytesIO ( r . content ) ) fname = input_zip . namelist ( ) [ 0 ] with open ( self . topfile , "a+" ) as f : f . write ( input_zip . read ( fname ) . decode ( 'utf-8' ) ) return True