mirror of
https://github.com/ChronosX88/medved.git
synced 2024-11-22 06:32:19 +00:00
14 lines
305 B
Python
14 lines
305 B
Python
|
import netaddr as n
|
||
|
import requests as r
|
||
|
|
||
|
# country two letter code
|
||
|
cn = 'ru'
|
||
|
|
||
|
# list of networks
|
||
|
nets = [n.IPNetwork(net.decode('ascii')) for net in r.get('http://www.cc2asn.com/data/%s_ipv4' % cn).iter_lines()]
|
||
|
|
||
|
for net in nets:
|
||
|
print(str(n.IPAddress(net.first)) + '-' + str(n.IPAddress(net.last)))
|
||
|
|
||
|
|