mirror of
https://github.com/ChronosX88/medved.git
synced 2024-11-24 23:42:19 +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)))
|
|
|
|
|