From f62900e6bf45d0cb01d95e8ec6fd3780fa493047 Mon Sep 17 00:00:00 2001 From: R0uter Date: Wed, 8 Jun 2016 15:05:52 +0800 Subject: [PATCH] adlinst dead... --- README.md | 2 +- ssconf.py | 33 +++++++++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index bb778d5..ba53cdb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/ssconf.py b/ssconf.py index 1527d61..40dffd5 100644 --- a/ssconf.py +++ b/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 = []