python - GeoIPIPSP.dat Invalid datebase type -
we have commercial maxmind-subscribtion obtain geoip-database isp-information (geioipipsp.dat). however, when try query file, keep getting following error:
geoiperror: invalid database type, expected org, isp or asnum
i'm using python-api:
geo = geoip.open("/geoipipsp.dat", geoip.geoip_standard) isp = geo.name_by_addr(ip) # or isp_by_addr pygeoip
when use api ask database-type (geo._type) "1" ... same value when open regular geoip.dat. i'm wondering if there's wrong geoipisp.dat, it's recent file maxmind's customer-download-page.
any insights appreciated!
it turns out there problem database-file indeed. after re-download works supposed to.
i switched pygeoip though , access database this:
import pygeoip geo_isp = pygeoip.geoip("/usr/share/geoip/geoipipsp.dat") isp = geo_isp.isp_by_addr("8.8.8.8")
Comments
Post a Comment