rename is_usable_ipv4 -> is_reserved_ipv4

This commit is contained in:
mickael
2019-01-04 22:52:45 +00:00
parent 5a2d994b49
commit 97416017c4

4
ppf.py
View File

@@ -107,7 +107,7 @@ def proxyfind(sqlite = None):
sqlite.commit()
def is_usable_ipv4(ip):
def is_reserved_ipv4(ip):
if ( ip.startswith("10.") or ip.startswith("192.168.") or ip.startswith("127.") or ip.startswith("0.")) or \
(ip.startswith("172.") and (int(ip.split(".")[1]) >= 16 and int(ip.split(".")[1]) <= 31)): return True
return False
@@ -123,7 +123,7 @@ def proxyleech(sqlite, rows):
for p in sorted(re.findall(r'[0-9]+(?:\.[0-9]+){3}:[0-9]+', cleanhtml(content))):
if p in uniques: continue
try:
if not is_usable_ipv4(p.split(':')[0]): uniques.append(p)
if not is_reserved_ipv4(p.split(':')[0]): uniques.append(p)
except:
pass