mirror of
https://github.com/Johnshall/Shadowrocket-ADBlock-Rules-Forever.git
synced 2025-12-19 00:05:12 +08:00
release new Rules!
This commit is contained in:
@@ -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**
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
|
|||||||
@@ -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
@@ -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)
|
# 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
@@ -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
Reference in New Issue
Block a user