MCPcopy Index your code
hub / github.com/Python3WebSpider/ProxyPool / is_ip_valid

Function is_ip_valid

proxypool/utils/proxy.py:19–34  ·  view source on GitHub ↗

check this string is within ip format

(ip)

Source from the content-addressed store, hash-verified

17
18
19def is_ip_valid(ip):
20 """
21 check this string is within ip format
22 """
23 if is_auth_proxy(ip):
24 ip = ip.split('@')[1]
25 a = ip.split('.')
26 if len(a) != 4:
27 return False
28 for x in a:
29 if not x.isdigit():
30 return False
31 i = int(x)
32 if i < 0 or i > 255:
33 return False
34 return True
35
36
37def is_port_valid(port):

Callers 1

is_valid_proxyFunction · 0.85

Calls 1

is_auth_proxyFunction · 0.85

Tested by

no test coverage detected