@@ -79,30 +79,29 @@ def _find_geoip_db(bot):
7979 elif (os .path .isfile (os .path .join ('/usr/share/GeoIP' , 'GeoLite2-City.mmdb' )) and
8080 os .path .isfile (os .path .join ('/usr/share/GeoIP' , 'GeoLite2-ASN.mmdb' ))):
8181 return '/usr/share/GeoIP'
82- elif urlretrieve :
83- LOGGER .info ('Downloading GeoIP database' )
84- bot .say ('Downloading GeoIP database, please wait...' )
85-
86- common_params = {'license_key' : 'JXBEmLjOzislFnh4' , 'suffix' : 'tar.gz' }
87- base_url = 'https://download.maxmind.com/app/geoip_download'
88- geolite_urls = []
89-
90- for edition in ['ASN' , 'City' ]:
91- geolite_urls .append (
92- '{base}?{params}' .format (
93- base = base_url ,
94- params = web .urlencode (dict (common_params , ** {'edition_id' : 'GeoLite2-%s' % edition })),
95- )
82+
83+ LOGGER .info ('Downloading GeoIP database' )
84+ bot .say ('Downloading GeoIP database, please wait...' )
85+
86+ common_params = {'license_key' : 'JXBEmLjOzislFnh4' , 'suffix' : 'tar.gz' }
87+ base_url = 'https://download.maxmind.com/app/geoip_download'
88+ geolite_urls = []
89+
90+ for edition in ['ASN' , 'City' ]:
91+ geolite_urls .append (
92+ '{base}?{params}' .format (
93+ base = base_url ,
94+ params = web .urlencode (dict (common_params , ** {'edition_id' : 'GeoLite2-%s' % edition })),
9695 )
96+ )
9797
98- for url in geolite_urls :
99- LOGGER .debug ('GeoIP Source URL: %s' , url )
100- full_path = os .path .join (config .core .homedir , url .split ("/" )[- 1 ])
101- urlretrieve (url , full_path )
102- _decompress (full_path , config .core .homedir )
103- return bot .config .core .homedir
104- else :
105- return False
98+ for url in geolite_urls :
99+ LOGGER .debug ('GeoIP Source URL: %s' , url )
100+ full_path = os .path .join (config .core .homedir , url .split ("/" )[- 1 ])
101+ urlretrieve (url , full_path )
102+ _decompress (full_path , config .core .homedir )
103+
104+ return config .core .homedir
106105
107106
108107@plugin .command ('iplookup' , 'ip' )
0 commit comments