mirror of https://github.com/dnomd343/ClearDNS
dnomd343
3 years ago
6 changed files with 83 additions and 0 deletions
@ -0,0 +1,35 @@ |
|||
#!/usr/bin/python3 |
|||
# -*- coding:utf-8 -*- |
|||
|
|||
import os, re |
|||
workDir = os.path.split(os.path.realpath(__file__))[0] |
|||
domainList = os.popen('sh ' + workDir + '/source.sh | sort -u').read().split('\n') |
|||
regex = r'^(?=^.{3,255}$)[a-zA-Z0-9][a-zA-Z0-9\-]{0,62}(.[a-zA-Z0-9][a-zA-Z0-9\-]{0,62})+$' |
|||
for domain in domainList: |
|||
if re.search(regex, domain) is None: |
|||
domainList.remove(domain) |
|||
with open (workDir + '/../chinalist.txt', 'w') as fileObj: |
|||
fileObj.write('\n'.join(domainList) + '\n') |
|||
os.popen('gzip -cf9 ' + workDir + '/../chinalist.txt > ' + workDir + '/../chinalist.txt.gz') |
|||
|
|||
from IPy import IP, IPSet |
|||
ipv4List = IPSet() |
|||
ipv6List = IPSet() |
|||
ipList = os.popen('sh ' + workDir + '/source-ip.sh | sort -u').read().split('\n') |
|||
for ipStr in ipList: |
|||
try: |
|||
ipAddr = IP(ipStr) |
|||
if ipAddr.version() == 4: |
|||
ipv4List.add(ipAddr) |
|||
else: |
|||
ipv6List.add(ipAddr) |
|||
except: |
|||
pass |
|||
ipList = [] |
|||
for ipAddr in ipv4List: |
|||
ipList.append(str(ipAddr)) |
|||
for ipAddr in ipv6List: |
|||
ipList.append(str(ipAddr)) |
|||
with open (workDir + '/../china-ip.txt', 'w') as fileObj: |
|||
fileObj.write('\n'.join(ipList) + '\n') |
|||
os.popen('gzip -cf9 ' + workDir + '/../china-ip.txt > ' + workDir + '/../china-ip.txt.gz') |
@ -0,0 +1,20 @@ |
|||
curl -sL https://github.com/17mon/china_ip_list/raw/master/china_ip_list.txt |
|||
curl -sL https://github.com/misakaio/chnroutes2/raw/master/chnroutes.txt | sed '/^#/d' |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/cernet.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/china.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/chinanet.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/cmcc.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/cstnet.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/drpeng.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/googlecn.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/tietong.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/unicom.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/cernet6.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/china6.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/chinanet6.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/cmcc6.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/cstnet6.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/drpeng6.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/googlecn6.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/tietong6.txt |
|||
curl -sL https://gaoyifan.github.io/china-operator-ip/unicom6.txt |
@ -0,0 +1,2 @@ |
|||
curl -sL https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf | sed 's/server=\///g;s/\/114.114.114.114//g' | sort -u |
|||
curl -sL https://raw.githubusercontent.com/hq450/fancyss/master/rules/WhiteList_new.txt | sed 's/Server=\///g;s/\///g' | sort -u |
@ -0,0 +1,13 @@ |
|||
#!/usr/bin/python3 |
|||
# -*- coding:utf-8 -*- |
|||
|
|||
import os, re |
|||
workDir = os.path.split(os.path.realpath(__file__))[0] |
|||
domainList = os.popen('sh ' + workDir + '/source.sh | sort -u').read().split('\n') |
|||
regex = r'^(?=^.{3,255}$)[a-zA-Z0-9][a-zA-Z0-9\-]{0,62}(.[a-zA-Z0-9][a-zA-Z0-9\-]{0,62})+$' |
|||
for domain in domainList: |
|||
if re.search(regex, domain) is None: |
|||
domainList.remove(domain) |
|||
with open (workDir + '/../gfwlist.txt', 'w') as fileObj: |
|||
fileObj.write('\n'.join(domainList) + '\n') |
|||
os.popen('gzip -cf9 ' + workDir + '/../gfwlist.txt > ' + workDir + '/../gfwlist.txt.gz') |
@ -0,0 +1,7 @@ |
|||
curl -sL https://raw.githubusercontent.com/Loukky/gfwlist-by-loukky/master/gfwlist.txt | base64 -d | sort -u | sed '/^$\|@@/d'| sed 's#!.\+##; s#|##g; s#@##g; s#http:\/\/##; s#https:\/\/##;' | sed '/\*/d; /apple\.com/d; /sina\.cn/d; /sina\.com\.cn/d; /baidu\.com/d; /qq\.com/d' | sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' | grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | sort -u |
|||
|
|||
curl -sL https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt | base64 -d | sort -u | sed '/^$\|@@/d'| sed 's#!.\+##; s#|##g; s#@##g; s#http:\/\/##; s#https:\/\/##;' | sed '/\*/d; /apple\.com/d; /sina\.cn/d; /sina\.com\.cn/d; /baidu\.com/d; /qq\.com/d' | sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' | grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | sort -u |
|||
|
|||
curl -sL https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/$(curl -sL https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')/gfw.txt | sort -u |
|||
|
|||
curl -sL https://raw.githubusercontent.com/hq450/fancyss/master/rules/gfwlist.conf | sed 's/ipset=\/\.//g; s/\/gfwlist//g; /^server/d' | sort -u |
Loading…
Reference in new issue