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` 文件。
**resultant/ad_domains.list**
**resultant/ad.list**
域名列表,由 `ad.py` 自动生成。包括所有需要屏蔽的广告域名
**resultant/ad_ips.list**
IP 列表,由 `ad.py` 自动生成。包括所有需要屏蔽的广告服务器的 IP。
广告列表,由 `ad.py` 自动生成。包括所有需要屏蔽的广告服务器的域名和 IP
**ad.py**

View File

@@ -7,8 +7,14 @@ import re
rules_url = [
'https://easylist-downloads.adblockplus.org/easylistchina.txt', # EasyList China
'https://github.com/cjx82630/cjxlist/raw/master/cjxlist.txt' # EasyList Lite
# EasyList China
#'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
@@ -36,14 +42,31 @@ for rule_url in rules_url:
rule = r.text
# parse html
reg_ret = re.findall(r'\|\|([\w\.]+)\^?\n', rule)
for ret in reg_ret:
domains.append(ret)
rule = rule.split('\n')
for row in rule:
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.')
# write in files
# write into files
domains.sort()

View File

@@ -17,7 +17,6 @@ confs_names = [
def getRulesStringFromFile(path, kind):
file = open(path, 'r', encoding='utf-8')
contents = file.readlines()
file.close()
ret = ''
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)
# by Moshel
# build time: 2017-06-23 23:46:51
# build time: 2017-06-24 12:36:54
[General]
bypass-system = true
@@ -10,10 +10,10 @@ dns-server =
[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)
# by Moshel
# build time: 2017-06-23 23:46:51
# build time: 2017-06-24 12:36:54
[General]
bypass-system = true
@@ -10,10 +10,10 @@ dns-server =
[Rule]
#
# 白名单模式,对不确定的网站尽可能地代理
# 白名单中包含了境外网站中可以访问的那些,对不确定的网站尽可能地代理
#
# 直连top500 网站中可直连的网站、中国网站
# 代理:其余的所有外网站
# 直连top500 网站中可直连的境外网站、中国网站
# 代理:其余的所有外网站
# 不包含广告过滤
#

File diff suppressed because it is too large Load Diff