mirror of
https://github.com/adulau/ptr-db.git
synced 2024-12-22 08:45:58 +00:00
If PTR records are not UTF-8, ignore the conversion errors.
This commit is contained in:
parent
49954da366
commit
dfe3262212
1 changed files with 5 additions and 5 deletions
|
@ -25,9 +25,9 @@ r = redis.StrictRedis(host='localhost', port=8323)
|
||||||
|
|
||||||
if args.r:
|
if args.r:
|
||||||
for x in args.r:
|
for x in args.r:
|
||||||
with open(x) as f:
|
with open(x, encoding='UTF-8', errors='ignore') as f:
|
||||||
for l in f:
|
for l in f:
|
||||||
(ip, ptr) = l.rstrip().split(',')
|
(ip, ptr) = l.rstrip().split(',')[:2]
|
||||||
print (terms(ptr))
|
print (terms(ptr))
|
||||||
r.set(ip,ptr)
|
r.set(ip,ptr)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue