mirror of
https://github.com/zhigang1992/ss.conf-for-surge.git
synced 2026-01-12 22:52:32 +08:00
adlinst dead...
This commit is contained in:
@@ -13,7 +13,7 @@ Proxy list is generate from gfwlist, all marked with `force-remote-dns`.
|
||||
White list come from [GFW Domain White List](https://goo.gl/tBixve).
|
||||
|
||||
##Anti ads
|
||||
Ad's list come from [iyee/main.conf](https://goo.gl/70DG6i).
|
||||
Ad's list come from [iyee/main.conf](https://goo.gl/70DG6i)(dead :( ).
|
||||
|
||||
|
||||
##How to use
|
||||
|
||||
33
ssconf.py
33
ssconf.py
@@ -108,30 +108,31 @@ def getAdList():
|
||||
# the url of https://gist.github.com/iyee/2e27c124af2f7a4f0d5a
|
||||
outfile = './list/adlist.txt'
|
||||
tmpfile = './list/adtmp'
|
||||
baseurl = 'https://gist.githubusercontent.com/raw/2e27c124af2f7a4f0d5a/main.conf'
|
||||
# baseurl = 'https://gist.githubusercontent.com/raw/2e27c124af2f7a4f0d5a/main.conf'
|
||||
|
||||
comment_pattern = '^\!|\[|^@@|\/|http|\#|\*|\?|\_|^\.|^\d+\.\d+\.\d+\.\d+'
|
||||
domain_pattern = '(\#?[\w\-\_]+\,[\/\w\.\-\_]+\,REJECT)[\/\*]*'
|
||||
|
||||
fs = codecs.open(outfile, 'w', 'utf-8')
|
||||
fs.write('// thx https://gist.github.com/iyee/2e27c124af2f7a4f0d5a \n')
|
||||
fs.write('// updated on ' + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + '\n')
|
||||
# fs.write('// thx https://gist.github.com/iyee/2e27c124af2f7a4f0d5a \n')
|
||||
fs.write('// This AD list is not update anymore... \n')
|
||||
# fs.write('// updated on ' + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + '\n')
|
||||
fs.write('\n')
|
||||
|
||||
|
||||
try:
|
||||
|
||||
content = getList(baseurl).decode('utf-8')
|
||||
|
||||
# write the content to file then read line by line
|
||||
if len(content) < 100:
|
||||
raise FileNotFoundError
|
||||
tfs = codecs.open(tmpfile, 'w', 'utf-8')
|
||||
tfs.write(content)
|
||||
tfs.close()
|
||||
print('adlist fetched, writing...')
|
||||
except:
|
||||
print('adlist fetch failed, use tmpfile instead...')
|
||||
# try:
|
||||
#
|
||||
# content = getList(baseurl).decode('utf-8')
|
||||
#
|
||||
# # write the content to file then read line by line
|
||||
# if len(content) < 100:
|
||||
# raise FileNotFoundError
|
||||
# tfs = codecs.open(tmpfile, 'w', 'utf-8')
|
||||
# tfs.write(content)
|
||||
# tfs.close()
|
||||
# print('adlist fetched, writing...')
|
||||
# except:
|
||||
print('adlist fetch failed, use tmpfile instead...')
|
||||
# Store all domains, deduplicate records
|
||||
domainlist = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user