mirror of
https://github.com/ChronosX88/medved.git
synced 2024-11-24 15:42:17 +00:00
14 lines
305 B
Python
Executable File
14 lines
305 B
Python
Executable File
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)))
|
|
|
|
|