Browse Source

update: remove legacy assets script

dev
Dnomd343 2 years ago
parent
commit
7e5eef7fca
  1. 35
      asset/chinalist/build/build.py
  2. 21
      asset/chinalist/build/source-ip.sh
  3. 3
      asset/chinalist/build/source.sh
  4. 13
      asset/gfwlist/build/build.py
  5. 4
      asset/gfwlist/build/source.sh
  6. 1
      assets/china-ip.py
  7. 1
      assets/chinalist.py
  8. 1
      assets/gfwlist.py

35
asset/chinalist/build/build.py

@ -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')

21
asset/chinalist/build/source-ip.sh

@ -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

3
asset/chinalist/build/source.sh

@ -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'

13
asset/gfwlist/build/build.py

@ -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')

4
asset/gfwlist/build/source.sh

@ -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

1
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')

1
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')

1
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')

Loading…
Cancel
Save