mirror of
https://github.com/Johnshall/Shadowrocket-ADBlock-Rules-Forever.git
synced 2025-12-18 07:44:57 +08:00
release new Rules!
This commit is contained in:
@@ -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**
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
@@ -1,9 +1,9 @@
|
||||
|
||||
#
|
||||
# 黑名单模式,对不确定的网站尽可能地直连
|
||||
# 黑名单中包含了境外网站中无法访问的那些,对不确定的网站则尽可能地直连。
|
||||
#
|
||||
# 代理:top500 网站中不可直连的网站
|
||||
# 直连:中国网站、国外的其余网站
|
||||
# 代理:top500 网站中不可直连的境外网站
|
||||
# 直连:境外其余网站、中国网站
|
||||
# 不包含广告过滤
|
||||
#
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
#
|
||||
# 黑名单模式,对不确定的网站尽可能地直连
|
||||
# 黑名单中包含了境外网站中无法访问的那些,对不确定的网站则尽可能地直连。
|
||||
#
|
||||
# 代理:top500 网站中不可直连的网站
|
||||
# 直连:中国网站、国外的其余网站
|
||||
# 代理:top500 网站中不可直连的境外网站
|
||||
# 直连:境外其余网站、中国网站
|
||||
# 包含广告过滤
|
||||
#
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
#
|
||||
# 白名单模式,对不确定的网站尽可能地走代理
|
||||
# 白名单中包含了境外网站中可以访问的那些,对不确定的网站则尽可能地代理。
|
||||
#
|
||||
# 直连:top500 网站中可直连的网站、中国网站
|
||||
# 代理:其余的所有国外网站
|
||||
# 直连:top500 网站中可直连的境外网站、中国网站
|
||||
# 代理:其余的所有境外网站
|
||||
# 不包含广告过滤
|
||||
#
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
#
|
||||
# 白名单模式,对不确定的网站尽可能地走代理
|
||||
# 白名单中包含了境外网站中可以访问的那些,对不确定的网站则尽可能地代理。
|
||||
#
|
||||
# 直连:top500 网站中可直连的网站、中国网站
|
||||
# 代理:其余的所有国外网站
|
||||
# 直连:top500 网站中可直连的境外网站、中国网站
|
||||
# 代理:其余的所有境外网站
|
||||
# 包含广告过滤
|
||||
#
|
||||
|
||||
|
||||
@@ -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
@@ -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
Reference in New Issue
Block a user