verify: fix cdnlist logic

This commit is contained in:
Felix Yan 2018-12-13 02:57:21 +08:00
parent 56344f430d
commit b7c22157dd
No known key found for this signature in database
GPG Key ID: 786C63F330D7CB92
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,2 @@
www.azure.cn.mschcdn.com
www.gov.cn

View File

@ -24,7 +24,7 @@ except:
with open("accelerated-domains.china.raw.txt") as f:
domains = random.sample([line.rstrip('\n') for line in f], 100)
# domains = [line.rstrip('\n') for line in f][46389:46400]
# domains = [line.rstrip('\n') for line in f][13820:13830]
def cn_ip_test(domain):
@ -56,7 +56,10 @@ for domain in domains:
if any(i in nameserver_text for i in whitelist):
print(colored("NS Whitelist matched for domain: " + domain, "green"))
elif domain.count(".") > 1 or any(testdomain.endswith(domain) for testdomain in cdnlist):
if testdomain is None:
for testdomain in cdnlist:
if testdomain.endswith(domain):
break
else:
testdomain = domain
if chnroutes:
try: