Browse Source

update geoip related stuff

pull/3/head
Jeff Becker 8 years ago
parent
commit
e548512f1e
  1. 6
      baddie-detector/netdb/netdb.py

6
baddie-detector/netdb/netdb.py

@ -7,9 +7,12 @@ @@ -7,9 +7,12 @@
import os,sys,struct,time,hashlib,fnmatch,io
import base64
import logging
import pygeoip
try:
import pygeoip
geo = pygeoip.GeoIP('/usr/share/GeoIP/GeoIPCity.dat')
except:
geo = None
b64encode = lambda x : base64.b64encode(x, b'~-').decode('ascii')
@ -156,6 +159,7 @@ class Entry: @@ -156,6 +159,7 @@ class Entry:
@staticmethod
def geolookup(entry):
if geo:
return geo.record_by_addr(entry)
@staticmethod

Loading…
Cancel
Save