Open DolleDries opened 4 years ago
bulk_lookup_rdap returns a named tuple.
Try this:
results, stats = bulk_lookup_rdap(['177.104.124.235'])
bulk_lookup_rdap returns a named tuple.
Try this:
results, stats = bulk_lookup_rdap(['177.104.124.235']) pprint(results)
Well... I kind of did (see att.) Still get an error...
I've got a big list of IPnumbers and it just bails out without telling me why. I had some trouble in finding the problem...
BTW Tis is what I am it using for: http://vandervlies.xs4all.nl/~andre/BAN/
Andre van der Vlies <andre@vandervlies.xs4all.nl>
Certifiable Linux/UNIX engineer (CLUE)
Homepage: http://vandervlies.xs4all.nl/~andre
-- 'Reality is that which, when you stop believing in it, doesn't go away.'
Philip K. Dick
Can you include the output from logging? Put this above your code:
import logging
LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] '
'[%(funcName)s()] %(message)s')
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
Can you include the output from logging? Put this above your code:
import logging LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] ' '[%(funcName)s()] %(message)s') logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
Sure.
'Reality is that which, when you stop believing in it, doesn't go away.'
- Philip K. Dick
# vim: ts=4 sw=4 ff=unix sm ai ic:
^[^#]
--
Can you include the output from logging? Put this above your code:
import logging LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] ' '[%(funcName)s()] %(message)s') logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
Sorry, I tried to catch the output with: python trywhois.py 2>&1 >Barf
But didn't succeed??? (need to to dive in the logging module...)
This what I see on screen:
.
.
.
[2020-09-29 11:17:50,391] [DEBUG] [experimental.py:72]
[get_bulk_asn_whois()] ASN bulk query initiated.
Traceback (most recent call last):
File "trywhois.py", line 32, in
'Reality is that which, when you stop believing in it, doesn't go away.'
- Philip K. Dick
# vim: ts=4 sw=4 ff=unix sm ai ic:
^[^#]
--
Can you include the output from logging? Put this above your code:
import logging LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] ' '[%(funcName)s()] %(message)s') logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
Ah! script will do it.... (Not fully awake yet...)
'Reality is that which, when you stop believing in it, doesn't go away.'
- Philip K. Dick
# vim: ts=4 sw=4 ff=unix sm ai ic:
^[^#]
--
I'm going to use this issue to provide the original error message on line 110 in get_bulk_asn_whois.
Is outbound port 43/TCP enabled for you? Can you hit whois.cymru.com:43?
I'm going to use this issue to provide the original error message on line 110 in get_bulk_asn_whois.
Is outbound port 43/TCP enabled for you? Can you hit whois.cymru.com:43?
telnet whois.cymru.com 43 Trying 38.229.36.132... Connected to v4.whois.cymru.com. Escape character is '^]'.
Is this wgat you want? Or should I use http?
'Reality is that which, when you stop believing in it, doesn't go away.'
- Philip K. Dick
# vim: ts=4 sw=4 ff=unix sm ai ic:
^[^#]
--
Code:
from ipwhois import IPWhois from ipwhois.experimental import get_bulk_asn_whois from ipwhois.experimental import bulk_lookup_rdap from pprint import pprint
ipno = '23.129.64.151'
ipno = '177.104.124.235' IPlist = [ipno] print ipno obj = IPWhois(ipno)
RDAP = obj.lookup_rdap(depth=1) print "Rdap" pprint(RDAP)
WHOIS = obj.lookup_whois() print "WhoIs" pprint(WHOIS)
""" Weird, Bulk-mode does't work on '177.104.124.235'. Why? Are there more IPno's it doen't work on? """
BULK = get_bulk_asn_whois(addresses=IPlist, retry_count=5)
print "Bulk"
pprint(BULK)
RDAP = bulk_lookup_rdap(addresses=IPlist)
print "RDAP"
pprint(RDAP)
print "%s ([%s], %s,%s)" % (ipno, WHOIS['asn_description'], WHOIS['asn_country_code'], WHOIS['asn_cidr'] )