diff --git a/asset/chinalist/build/build.py b/asset/chinalist/build/build.py deleted file mode 100755 index f9d52cd..0000000 --- a/asset/chinalist/build/build.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/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) if str(ipAddr).find('/') != -1 else str(ipAddr) + '/32') -for ipAddr in ipv6List: - ipList.append(str(ipAddr) if str(ipAddr).find('/') != -1 else str(ipAddr) + '/128') -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') diff --git a/asset/chinalist/build/source-ip.sh b/asset/chinalist/build/source-ip.sh deleted file mode 100644 index 4e0cf66..0000000 --- a/asset/chinalist/build/source-ip.sh +++ /dev/null @@ -1,21 +0,0 @@ -curl -sL https://github.com/misakaio/chnroutes2/raw/master/chnroutes.txt | sed '/^#/d' -curl -sL https://github.com/metowolf/iplist/raw/master/data/special/china.txt -curl -sL https://github.com/17mon/china_ip_list/raw/master/china_ip_list.txt -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 diff --git a/asset/chinalist/build/source.sh b/asset/chinalist/build/source.sh deleted file mode 100644 index 5cf1856..0000000 --- a/asset/chinalist/build/source.sh +++ /dev/null @@ -1,3 +0,0 @@ -curl -sL https://github.com/felixonmars/dnsmasq-china-list/raw/master/accelerated-domains.china.conf | sed '/^#/d' | sed 's/server=\///g;s/\/114.114.114.114//g' -curl -sL https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/direct-list.txt | grep -v ':' -curl -sL https://github.com/hq450/fancyss/raw/master/rules/WhiteList_new.txt | sed 's/Server=\///g;s/\///g' diff --git a/asset/gfwlist/build/build.py b/asset/gfwlist/build/build.py deleted file mode 100755 index da10dea..0000000 --- a/asset/gfwlist/build/build.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/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') diff --git a/asset/gfwlist/build/source.sh b/asset/gfwlist/build/source.sh deleted file mode 100644 index 42dac46..0000000 --- a/asset/gfwlist/build/source.sh +++ /dev/null @@ -1,4 +0,0 @@ -curl -sL https://github.com/Loukky/gfwlist-by-loukky/raw/master/gfwlist.txt | base64 -d | sed '/^$\|@@/d' | sed 's#!.\+##;s#|##g;s#@##g;s#http:\/\/##;s#https:\/\/##;' | sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' | grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' -curl -sL https://github.com/gfwlist/gfwlist/raw/master/gfwlist.txt | base64 -d | sed '/^$\|@@/d' | sed 's#!.\+##;s#|##g;s#@##g;s#http:\/\/##;s#https:\/\/##;' | sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' | grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' -curl -sL https://github.com/hq450/fancyss/raw/master/rules/gfwlist.conf | sed 's/ipset=\/\.//g;s/\/gfwlist//g;/^server/d' -curl -sL https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/gfw.txt diff --git a/assets/china-ip.py b/assets/china-ip.py index 578af7d..f4b0ecf 100755 --- a/assets/china-ip.py +++ b/assets/china-ip.py @@ -50,4 +50,3 @@ for ip in v6: with open('china-ip.txt', 'w') as fileObj: fileObj.write('\n'.join(ips) + '\n') -os.system('xz -kf9 china-ip.txt') diff --git a/assets/chinalist.py b/assets/chinalist.py index 0161ef5..72d926e 100755 --- a/assets/chinalist.py +++ b/assets/chinalist.py @@ -22,4 +22,3 @@ domains = {x for x in domains if re.search(regex, str(x)) is not None} with open('chinalist.txt', 'w') as fileObj: fileObj.write('\n'.join(sorted(domains)) + '\n') -os.system('xz -kf9 chinalist.txt') diff --git a/assets/gfwlist.py b/assets/gfwlist.py index b76d1ad..9c7bcaa 100755 --- a/assets/gfwlist.py +++ b/assets/gfwlist.py @@ -27,4 +27,3 @@ domains = {x for x in domains if re.search(regex, str(x)) is not None} with open('gfwlist.txt', 'w') as fileObj: fileObj.write('\n'.join(sorted(domains)) + '\n') -os.system('xz -kf9 gfwlist.txt')