release new Rules!

This commit is contained in:
Moshel
2017-06-24 12:39:26 +08:00
parent f78e91335f
commit e9e07d28f4
12 changed files with 2897 additions and 80 deletions

View File

@@ -42,13 +42,9 @@
脚本,运行所需时间较长。自动爬取生成 `top500_*.list` 文件。 脚本,运行所需时间较长。自动爬取生成 `top500_*.list` 文件。
**resultant/ad_domains.list** **resultant/ad.list**
域名列表,由 `ad.py` 自动生成。包括所有需要屏蔽的广告域名 广告列表,由 `ad.py` 自动生成。包括所有需要屏蔽的广告服务器的域名和 IP
**resultant/ad_ips.list**
IP 列表,由 `ad.py` 自动生成。包括所有需要屏蔽的广告服务器的 IP。
**ad.py** **ad.py**

View File

@@ -7,8 +7,14 @@ import re
rules_url = [ rules_url = [
'https://easylist-downloads.adblockplus.org/easylistchina.txt', # EasyList China # EasyList China
'https://github.com/cjx82630/cjxlist/raw/master/cjxlist.txt' # EasyList Lite #'https://easylist-downloads.adblockplus.org/easylistchina.txt',
# EasyList Lite
#'https://github.com/cjx82630/cjxlist/raw/master/cjxlist.txt',
# EasyList + China
'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt',
# 乘风 广告过滤规则
'https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/ABP-FX.txt'
] ]
# contain both domains and ips # contain both domains and ips
@@ -36,14 +42,31 @@ for rule_url in rules_url:
rule = r.text rule = r.text
# parse html # parse html
reg_ret = re.findall(r'\|\|([\w\.]+)\^?\n', rule) rule = rule.split('\n')
for ret in reg_ret: for row in rule:
domains.append(ret) if not row.startswith('||') and not row.startswith('|http'):
continue
# del prefix
row = re.sub(r'^\|(\||https?:\/\/)', '', row)
# del suffix
row = row.rstrip('/^')
if re.search(r'[\$\^:\*]', row):
continue
if row.count('/'):
continue
if not re.match(r'\w+\.\w+', row):
continue
# match
domains.append(row)
print('done.') print('done.')
# write in files # write into files
domains.sort() domains.sort()

View File

@@ -17,7 +17,6 @@ confs_names = [
def getRulesStringFromFile(path, kind): def getRulesStringFromFile(path, kind):
file = open(path, 'r', encoding='utf-8') file = open(path, 'r', encoding='utf-8')
contents = file.readlines() contents = file.readlines()
file.close()
ret = '' ret = ''
for content in contents: for content in contents:

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
# #
# 黑名单模式,对不确定的网站尽可能地直连 # 黑名单中包含了境外网站中无法访问的那些,对不确定的网站尽可能地直连
# #
# 代理top500 网站中不可直连的网站 # 代理top500 网站中不可直连的境外网站
# 直连:中国网站、国外的其余网站 # 直连:境外其余网站、中国网站
# 不包含广告过滤 # 不包含广告过滤
# #

View File

@@ -1,9 +1,9 @@
# #
# 黑名单模式,对不确定的网站尽可能地直连 # 黑名单中包含了境外网站中无法访问的那些,对不确定的网站尽可能地直连
# #
# 代理top500 网站中不可直连的网站 # 代理top500 网站中不可直连的境外网站
# 直连:中国网站、国外的其余网站 # 直连:境外其余网站、中国网站
# 包含广告过滤 # 包含广告过滤
# #

View File

@@ -1,9 +1,9 @@
# #
# 白名单模式,对不确定的网站尽可能地代理 # 白名单中包含了境外网站中可以访问的那些,对不确定的网站尽可能地代理
# #
# 直连top500 网站中可直连的网站、中国网站 # 直连top500 网站中可直连的境外网站、中国网站
# 代理:其余的所有外网站 # 代理:其余的所有外网站
# 不包含广告过滤 # 不包含广告过滤
# #

View File

@@ -1,9 +1,9 @@
# #
# 白名单模式,对不确定的网站尽可能地代理 # 白名单中包含了境外网站中可以访问的那些,对不确定的网站尽可能地代理
# #
# 直连top500 网站中可直连的网站、中国网站 # 直连top500 网站中可直连的境外网站、中国网站
# 代理:其余的所有外网站 # 代理:其余的所有外网站
# 包含广告过滤 # 包含广告过滤
# #

View File

@@ -1,6 +1,6 @@
# Best Shadowrocket Rules (https://github.com/h2y/Shadowrocket-ADBlock-Rules) # Best Shadowrocket Rules (https://github.com/h2y/Shadowrocket-ADBlock-Rules)
# by Moshel # by Moshel
# build time: 2017-06-23 23:46:51 # build time: 2017-06-24 12:36:54
[General] [General]
bypass-system = true bypass-system = true
@@ -10,10 +10,10 @@ dns-server =
[Rule] [Rule]
# #
# 黑名单模式,对不确定的网站尽可能地直连 # 黑名单中包含了境外网站中无法访问的那些,对不确定的网站尽可能地直连
# #
# 代理top500 网站中不可直连的网站 # 代理top500 网站中不可直连的境外网站
# 直连:中国网站、国外的其余网站 # 直连:境外其余网站、中国网站
# 不包含广告过滤 # 不包含广告过滤
# #

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
# Best Shadowrocket Rules (https://github.com/h2y/Shadowrocket-ADBlock-Rules) # Best Shadowrocket Rules (https://github.com/h2y/Shadowrocket-ADBlock-Rules)
# by Moshel # by Moshel
# build time: 2017-06-23 23:46:51 # build time: 2017-06-24 12:36:54
[General] [General]
bypass-system = true bypass-system = true
@@ -10,10 +10,10 @@ dns-server =
[Rule] [Rule]
# #
# 白名单模式,对不确定的网站尽可能地代理 # 白名单中包含了境外网站中可以访问的那些,对不确定的网站尽可能地代理
# #
# 直连top500 网站中可直连的网站、中国网站 # 直连top500 网站中可直连的境外网站、中国网站
# 代理:其余的所有外网站 # 代理:其余的所有外网站
# 不包含广告过滤 # 不包含广告过滤
# #

File diff suppressed because it is too large Load Diff