mirror of
https://github.com/v2fly/domain-list-community.git
synced 2026-02-06 05:53:13 +07:00
Compare commits
28 Commits
2026011006
...
2026012013
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
912c689da3 | ||
|
|
d1addde6f7 | ||
|
|
ec95fedc45 | ||
|
|
d50e2e1ad7 | ||
|
|
ab42940731 | ||
|
|
efd57f30ee | ||
|
|
3ee190ac78 | ||
|
|
fa279bdd79 | ||
|
|
b18f5e3049 | ||
|
|
5411cefcaa | ||
|
|
d84e864ce8 | ||
|
|
49444d78b7 | ||
|
|
dad8e15cd0 | ||
|
|
e6e731a616 | ||
|
|
8c0b190c3f | ||
|
|
9f846c0f2e | ||
|
|
fe01057830 | ||
|
|
3ba71a115d | ||
|
|
8f1fe6b425 | ||
|
|
82ad580e6e | ||
|
|
488ee0334e | ||
|
|
1b63c69d76 | ||
|
|
6dee1594d4 | ||
|
|
49cbfc60e5 | ||
|
|
8786ff74f0 | ||
|
|
cc8a866863 | ||
|
|
593e467448 | ||
|
|
76b32b86b8 |
@@ -11,6 +11,14 @@ This project is not opinionated. In other words, it does NOT endorse, claim or i
|
||||
- **dlc.dat**:[https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat](https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat)
|
||||
- **dlc.dat.sha256sum**:[https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat.sha256sum](https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat.sha256sum)
|
||||
|
||||
## Notice
|
||||
|
||||
Rules with `@!cn` attribute has been cast out from cn lists. `geosite:geolocation-cn@!cn` is no longer available.
|
||||
|
||||
Check [#390](https://github.com/v2fly/domain-list-community/issues/390), [#3119](https://github.com/v2fly/domain-list-community/pull/3119) and [#3198](https://github.com/v2fly/domain-list-community/pull/3198) for more information.
|
||||
|
||||
Please report if you have any problems or questions.
|
||||
|
||||
## Usage example
|
||||
|
||||
Each file in the `data` directory can be used as a rule in this format: `geosite:filename`.
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
4399biule.com
|
||||
4399dmw.com
|
||||
4399er.com
|
||||
4399hdhh.com
|
||||
4399hhh.com
|
||||
4399inc.com
|
||||
4399mail.com
|
||||
@@ -30,17 +31,22 @@
|
||||
4399yyy.com
|
||||
5054399.com
|
||||
5054399.net
|
||||
5wyxi.com
|
||||
71acg.com
|
||||
71acg.net
|
||||
abdf002.com
|
||||
appeeres.com
|
||||
buke999.com
|
||||
bx1k.com
|
||||
edu4399.com
|
||||
funnycore.com
|
||||
guoping123.com
|
||||
haohaowan.net
|
||||
i3839.com
|
||||
ihykb.com
|
||||
img4399.com
|
||||
mail4399.com
|
||||
maindown4399.com
|
||||
me4399.com
|
||||
my4399.com
|
||||
mysiteres.com
|
||||
@@ -52,4 +58,6 @@ wanwan4399.com
|
||||
we4399.com
|
||||
webgame163.com
|
||||
youba.com
|
||||
yxhapi.com
|
||||
yxhhdl.com
|
||||
yxhimg.com
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
annas-archive.in
|
||||
annas-archive.li
|
||||
annas-archive.org
|
||||
annas-archive.pm
|
||||
annas-archive.se
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
advertising.apple.com @ads
|
||||
api-adservices.apple.com @ads
|
||||
iadsdk.apple.com @ads
|
||||
iad.apple.com @ads
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
include:fqnovel-ads
|
||||
|
||||
ad.toutiao.com @ads
|
||||
analytics.tiktok.com @ads
|
||||
bds.snssdk.com @ads
|
||||
byteadverts.com @ads
|
||||
ctobsnssdk.com @ads
|
||||
dig.bdurl.net @ads
|
||||
extlog.snssdk.com @ads
|
||||
i.snssdk.com @ads
|
||||
log.zijieapi.com @ads
|
||||
mcs.snssdk.com @ads
|
||||
pangolin-dsp-toutiao-b.com @ads
|
||||
pangolin-dsp-toutiao.com @ads
|
||||
|
||||
@@ -12,12 +12,12 @@ include:atom-data-ads
|
||||
include:baidu-ads
|
||||
include:bytedance-ads
|
||||
include:category-ads-ir
|
||||
include:cctv @ads
|
||||
include:clearbit-ads
|
||||
include:dmm-ads
|
||||
include:duolingo-ads
|
||||
include:emogi-ads
|
||||
include:flurry-ads
|
||||
include:github-ads
|
||||
include:google-ads
|
||||
include:growingio-ads
|
||||
include:hiido-ads
|
||||
@@ -38,12 +38,11 @@ include:newrelic-ads
|
||||
include:ogury-ads
|
||||
include:ookla-speedtest-ads
|
||||
include:openx-ads
|
||||
include:picacg-ads
|
||||
include:picacg @ads
|
||||
include:pocoiq-ads
|
||||
include:pubmatic-ads
|
||||
include:qihoo360-ads
|
||||
include:segment-ads
|
||||
include:sensorsdata-ads
|
||||
include:sina-ads
|
||||
include:sohu-ads
|
||||
include:spotify-ads
|
||||
@@ -52,6 +51,7 @@ include:tagtic-ads
|
||||
include:tappx-ads
|
||||
include:television-ads
|
||||
include:tencent-ads
|
||||
include:tendcloud @ads
|
||||
include:uberads-ads
|
||||
include:umeng-ads
|
||||
include:unity-ads
|
||||
@@ -59,7 +59,7 @@ include:xhamster-ads
|
||||
include:xiaomi-ads
|
||||
include:ximalaya-ads
|
||||
include:yahoo-ads
|
||||
include:zhihu-ads
|
||||
include:zhihu @ads
|
||||
|
||||
# Other domains for ads serving
|
||||
51.la
|
||||
@@ -73,6 +73,7 @@ adbutter.net
|
||||
addthisedge.com
|
||||
ads.trafficjunky.net
|
||||
ads.wteam.xyz
|
||||
adservice.sigmob.cn
|
||||
adtechus.com
|
||||
adtrue.com
|
||||
adxprtz.com
|
||||
@@ -192,7 +193,18 @@ reachmax.cn
|
||||
# 热云数据
|
||||
reyun.com
|
||||
|
||||
# 神策数据
|
||||
static.sensorsdata.cn
|
||||
|
||||
# 诸葛io
|
||||
zhugeapi.com
|
||||
zhugeapi.net
|
||||
zhugeio.com
|
||||
|
||||
# 车来了
|
||||
atrace.chelaile.net.cn
|
||||
logs.chelaile.net.cn
|
||||
|
||||
# 航旅纵横
|
||||
analytics.umetrip.com
|
||||
sensors.umetrip.com.cn
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
ad-delivery.net @ads
|
||||
adinplay.com @ads
|
||||
adnxs.com @ads
|
||||
adview.cn @ads
|
||||
ads.trafficjunky.net @ads
|
||||
advertserve.com @ads
|
||||
casalemedia.com @ads
|
||||
@@ -18,6 +19,7 @@ mfadsrvr.com @ads
|
||||
mgid.com @ads
|
||||
ns1p.net @ads
|
||||
pubmatic.com @ads
|
||||
sigmob.com @ads
|
||||
snapads.com @ads
|
||||
spotxchange.com @ads
|
||||
unimhk.com @ads
|
||||
|
||||
@@ -7,10 +7,12 @@ include:elevenlabs
|
||||
include:google-deepmind
|
||||
include:groq
|
||||
include:huggingface
|
||||
include:liveperson
|
||||
include:openai
|
||||
include:perplexity
|
||||
include:poe
|
||||
include:xai
|
||||
include:youmind
|
||||
|
||||
# CodeRabbit
|
||||
coderabbit.ai
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
include:boc
|
||||
include:ccb
|
||||
include:citic
|
||||
include:cmb
|
||||
include:boc @-!cn
|
||||
include:ccb @-!cn
|
||||
include:citic @-!cn
|
||||
include:cmb @-!cn
|
||||
include:hsbc-cn
|
||||
include:icbc
|
||||
include:icbc @-!cn
|
||||
include:unionpay
|
||||
|
||||
abchina.com
|
||||
|
||||
@@ -1,43 +1,37 @@
|
||||
# 远程桌面/远程组网
|
||||
|
||||
## 连连控
|
||||
asklink.com
|
||||
## EasyTier
|
||||
easytier.cn
|
||||
## Oray
|
||||
oray.com
|
||||
oray.net
|
||||
orayer.com
|
||||
orayimg.com
|
||||
sunlogin.net
|
||||
|
||||
## 叮当猫脚本管理系统 懒人精灵远程调试
|
||||
privateapi.xyz
|
||||
## ToDesk
|
||||
todesk.cn
|
||||
todesk.com
|
||||
|
||||
## 连连控
|
||||
asklink.com
|
||||
|
||||
## 叮当猫脚本管理系统 懒人精灵远程调试
|
||||
privateapi.xyz
|
||||
|
||||
# xEdge干将互联
|
||||
## xEdge干将互联
|
||||
include:xedge
|
||||
|
||||
# 文档协作
|
||||
|
||||
## Tower 团队协作
|
||||
tower.im
|
||||
|
||||
## 秀米编辑器
|
||||
tritoninfo.net
|
||||
xiumi.us
|
||||
xiumius.com
|
||||
|
||||
## 语雀
|
||||
nlark.com
|
||||
yuque.com
|
||||
## 石墨文档
|
||||
shimo.im
|
||||
shimonote.com
|
||||
smgv.cn
|
||||
|
||||
## 语雀
|
||||
nlark.com
|
||||
yuque.com
|
||||
|
||||
## Tower 团队协作
|
||||
tower.im
|
||||
## 秀米编辑器
|
||||
tritoninfo.net
|
||||
xiumi.us
|
||||
xiumius.com
|
||||
## 吾道
|
||||
woodo.cn
|
||||
|
||||
@@ -140,6 +140,7 @@ shellcheck.net
|
||||
shields.io
|
||||
sqlite.org
|
||||
sublimetext.com
|
||||
tampermonkey.net
|
||||
termius.com
|
||||
unpkg.com
|
||||
videojs.com
|
||||
|
||||
@@ -4,7 +4,7 @@ include:apipost
|
||||
include:baltamatica
|
||||
include:cnblogs
|
||||
include:csdn
|
||||
include:deepin
|
||||
include:deepin @-!cn
|
||||
include:gitee
|
||||
include:goproxy
|
||||
include:huawei-dev
|
||||
|
||||
@@ -188,3 +188,6 @@ emby1.69yun69.com
|
||||
|
||||
# 云梯
|
||||
yunti.online
|
||||
|
||||
# 守候网络
|
||||
server2.cn2gias.uk
|
||||
@@ -1,5 +1,6 @@
|
||||
# This list contains services related to entertainment & games & music & podcasts & videos outside China mainland.
|
||||
|
||||
include:category-acg
|
||||
include:category-entertainment-ru
|
||||
include:category-games-!cn
|
||||
include:category-novel
|
||||
@@ -104,6 +105,9 @@ bag.itunes.apple.com
|
||||
bookeeper.itunes.apple.com
|
||||
|
||||
# Entertainment oriented media
|
||||
# This section references the "Source Considerations" page on the Chinese Wikipedia:
|
||||
# - https://zh.wikipedia.org/wiki/WikiProject:电子游戏/来源考量
|
||||
# - https://zh.wikipedia.org/wiki/WikiProject:ACG/來源考量
|
||||
## 4Gamer.net
|
||||
4gamer.net
|
||||
## 4Gamers
|
||||
@@ -116,20 +120,28 @@ appget.com
|
||||
appmedia.jp
|
||||
## Automaton
|
||||
automaton-media.com
|
||||
## 橙心社
|
||||
cxacg.com
|
||||
## 电faminicogamer
|
||||
denfaminicogamer.jp
|
||||
## ASCII Media Works
|
||||
dengekionline.com
|
||||
## E-ROAD
|
||||
eroge-road.com
|
||||
## esports.gg
|
||||
esports.gg
|
||||
## ファミ通
|
||||
famitsu.com
|
||||
## GameApps.HK
|
||||
gameapps.hk
|
||||
## 遊戲基地
|
||||
gamebase.com.tw
|
||||
## IID, Inc.
|
||||
gamebusiness.jp
|
||||
gamespark.jp
|
||||
inside-games.jp
|
||||
## Game Focus
|
||||
gamefocus.co.kr
|
||||
## GameMeca
|
||||
gamemeca.com
|
||||
## Gameover有機網
|
||||
@@ -141,6 +153,8 @@ onlinegamer.jp
|
||||
greatgame.asia
|
||||
## HobbiGame
|
||||
hobbigame.com
|
||||
## ゲーム文化保存研究所
|
||||
igcc.jp
|
||||
## IGN
|
||||
ign.com
|
||||
ignimg.com
|
||||
@@ -152,18 +166,30 @@ mediaclip.jp
|
||||
maedahiroyuki.com
|
||||
## MANTANWEB
|
||||
mantan-web.jp
|
||||
## モエデジ
|
||||
moedigi.com
|
||||
## Moepedia
|
||||
moepedia.net
|
||||
## マイナビニュース
|
||||
mynavi.jp
|
||||
## Openbook阅读通
|
||||
openbook.org.tw
|
||||
## QooApp
|
||||
qoo-app.com
|
||||
## Real Sound
|
||||
realsound.jp
|
||||
## れポたま!
|
||||
repotama.com
|
||||
## Saiga NAK
|
||||
saiganak.com
|
||||
## SQOOL
|
||||
sqool.net
|
||||
## The Games Daily
|
||||
tgdaily.co.kr
|
||||
## Thisisgame
|
||||
thisisgame.com
|
||||
## 玩具人
|
||||
toy-people.com
|
||||
## Wanuxi
|
||||
wanuxi.com
|
||||
## よろず〜
|
||||
|
||||
@@ -6,7 +6,7 @@ include:aamgame
|
||||
include:acfun
|
||||
include:acplay
|
||||
include:bestv
|
||||
include:bilibili
|
||||
include:bilibili @-!cn
|
||||
include:ciweimao
|
||||
include:dedao
|
||||
include:douyin
|
||||
@@ -18,7 +18,7 @@ include:gamersky
|
||||
include:gitv
|
||||
include:hunantv
|
||||
include:huya
|
||||
include:iqiyi
|
||||
include:iqiyi @-!cn
|
||||
include:ku6
|
||||
include:kuaikan
|
||||
include:kuaishou
|
||||
@@ -89,6 +89,8 @@ motie.com
|
||||
motieimg.com
|
||||
# 梨视频
|
||||
pearvideo.com
|
||||
# 皮皮网
|
||||
pipi.cn
|
||||
# SF轻小说二次元
|
||||
sfacg.com
|
||||
# 书海小说
|
||||
@@ -109,6 +111,9 @@ zhulang.com
|
||||
zongheng.com
|
||||
|
||||
# 娱乐资讯媒体
|
||||
# 该部分参考了中文维基百科的「来源考量」:
|
||||
# - https://zh.wikipedia.org/wiki/WikiProject:电子游戏/来源考量
|
||||
# - https://zh.wikipedia.org/wiki/WikiProject:ACG/來源考量
|
||||
|
||||
include:tgbus
|
||||
include:vgtime
|
||||
@@ -143,11 +148,15 @@ ign.com.cn
|
||||
nadianshi.com
|
||||
## 游戏日报
|
||||
news.yxrb.net
|
||||
## 手谈姬
|
||||
shoutanjjj.com
|
||||
## 游戏机实用技术
|
||||
ucg.cn
|
||||
## 游戏茶馆
|
||||
youxichaguan.com
|
||||
## 游戏葡萄
|
||||
youxiputao.com
|
||||
## 游戏陀螺
|
||||
youxituoluo.com
|
||||
## 游研社
|
||||
yystv.cn
|
||||
|
||||
@@ -12,6 +12,7 @@ include:itiger
|
||||
include:longbridge
|
||||
include:n26
|
||||
include:schwab
|
||||
include:standardchartered
|
||||
include:wise
|
||||
|
||||
fxcorporate.com
|
||||
|
||||
@@ -24,12 +24,14 @@ include:pandanet
|
||||
include:pinkcore
|
||||
include:playstation
|
||||
include:projectsekai
|
||||
include:pubg
|
||||
include:purikonejp
|
||||
include:riot
|
||||
include:roblox
|
||||
include:rockstar
|
||||
include:snk
|
||||
include:steam
|
||||
include:steaminventoryhelper
|
||||
include:steamunlocked
|
||||
include:supercell
|
||||
include:ubisoft
|
||||
@@ -38,6 +40,7 @@ include:wbgames
|
||||
include:xbox
|
||||
include:ynoproject
|
||||
|
||||
dinopoloclub.com
|
||||
dodi-repacks.download
|
||||
dodi-repacks.site
|
||||
fabricmc.net
|
||||
@@ -48,8 +51,10 @@ humblebundle.com
|
||||
joinsquad.com
|
||||
loverslab.com
|
||||
minecraft.wiki
|
||||
mobimon.com.tw
|
||||
nexus-cdn.com
|
||||
nexusmods.com
|
||||
noxygames.com
|
||||
offworldindustries.com
|
||||
offworldindustries.net
|
||||
papermc.io
|
||||
@@ -57,5 +62,7 @@ planetminecraft.com
|
||||
prismlauncher.org
|
||||
protondb.com
|
||||
quiltmc.org
|
||||
rayark.download
|
||||
rayark.net
|
||||
speedrun.com
|
||||
steamdb.info
|
||||
|
||||
@@ -9,7 +9,7 @@ include:mihoyo-cn
|
||||
include:tencent-games
|
||||
include:tiancity
|
||||
include:vrzwk
|
||||
include:xd
|
||||
include:xd @-!cn
|
||||
include:yokaverse
|
||||
|
||||
# 北京奇客创想科技有限公司
|
||||
@@ -26,14 +26,16 @@ fxt365.com
|
||||
gameabc.com
|
||||
# 游戏魅 合肥启云软件 皖B2-20160087-3
|
||||
gamemei.com
|
||||
# Enhance Gaming
|
||||
heavenlywind.cc
|
||||
# 乐都网 浙ICP备2024091002号-2
|
||||
ledu.com
|
||||
# 龙图游戏 京ICP备11023195号
|
||||
longtugame.com
|
||||
# 北京慕飞科技 京ICP备20006112号-2
|
||||
morefreegame.com
|
||||
# Enhance Gaming
|
||||
heavenlywind.cc
|
||||
# Phira
|
||||
phira.cn
|
||||
# 沪ICP备18041304号-1
|
||||
tgpro.top
|
||||
tgprocs.net
|
||||
|
||||
@@ -112,6 +112,7 @@ hkej.com
|
||||
hkgpao.com
|
||||
hongkongfp.com
|
||||
inmediahk.net
|
||||
inquirer.net
|
||||
inside.com.tw
|
||||
itmedia.co.jp
|
||||
jfengtime.com
|
||||
@@ -120,6 +121,7 @@ limedia.tw
|
||||
localpresshk.com
|
||||
ltsports.com.tw
|
||||
macaodaily.com
|
||||
maidonanews.jp
|
||||
mdnkids.com
|
||||
mirrormedia.com.tw
|
||||
mirrormedia.mg
|
||||
@@ -158,6 +160,7 @@ tnntoday.com
|
||||
tvbs.com.tw
|
||||
tvmost.com.hk
|
||||
twgreatnews.com
|
||||
twreporter.org
|
||||
unwire.hk
|
||||
upmedia.mg
|
||||
vjmedia.com.hk
|
||||
|
||||
@@ -16,6 +16,8 @@ include:ynet
|
||||
21jingji.com
|
||||
# 站长网
|
||||
admin5.com
|
||||
# 安徽新闻
|
||||
anhuinews.com
|
||||
# 锋潮科技
|
||||
anzhuo.cn
|
||||
# 鞭牛士
|
||||
@@ -55,6 +57,8 @@ cztv.com
|
||||
cztvcdn.com
|
||||
cztvcloud.com
|
||||
zjstv.com
|
||||
# 读特新闻
|
||||
dutenews.com
|
||||
# 大智慧
|
||||
dzh.com.cn
|
||||
gw.com.cn
|
||||
@@ -169,6 +173,9 @@ ssimg.cn
|
||||
stockstar.com
|
||||
# 证券时报网
|
||||
stcn.com
|
||||
# 深圳报业集团
|
||||
sznews.com
|
||||
szpgm.com
|
||||
# 大公网/大公报
|
||||
takungpao.com
|
||||
# TechWeb
|
||||
|
||||
@@ -52,6 +52,7 @@ hwshu.com # 瀚文民国书库
|
||||
hytung.cn # 瀚堂典藏古籍
|
||||
incopat.com # incoPat 专利数据库
|
||||
lawyee.org # 北大法意网 中国法律资料库
|
||||
libvideo.com # 知识视界 武汉缘来文化
|
||||
neohytung.com # 瀚堂近代报刊
|
||||
nmrdata.com # 微谱数据
|
||||
nssd.cn # 国家哲学社会科学学术期刊数据库
|
||||
@@ -67,5 +68,3 @@ unihan.com.cn # 书同文
|
||||
wenxin-ge.com # 文心阁古籍全文数据库
|
||||
wind.com.cn # Wind 资讯金融
|
||||
yiigle.com # 中华医学期刊全文数据库
|
||||
|
||||
full:www.libvideo.com # 武汉缘来文化-知识视界
|
||||
|
||||
@@ -6,7 +6,7 @@ include:gracg
|
||||
include:hupu
|
||||
include:meipian
|
||||
include:okjike
|
||||
include:sina
|
||||
include:sina @-!cn
|
||||
include:xiaohongshu
|
||||
include:yy
|
||||
include:zhihu
|
||||
@@ -21,3 +21,6 @@ dandanvoice.com
|
||||
# 脉脉
|
||||
maimai.cn
|
||||
taou.com
|
||||
|
||||
# 知识星球
|
||||
zsxq.com
|
||||
|
||||
@@ -39,3 +39,5 @@ zggbdszt.cn
|
||||
zggbdszt.com.cn
|
||||
zggbdszt.net.cn
|
||||
zygbdszt.net.cn
|
||||
|
||||
ad.cctv.com @ads
|
||||
|
||||
@@ -13,11 +13,21 @@ migucloud.com
|
||||
migufun.com
|
||||
miguvideo.com
|
||||
|
||||
# 中移金科
|
||||
cmft.com.cn
|
||||
|
||||
# 中移在线
|
||||
cmcc-cs.cn
|
||||
online-cmcc.cn
|
||||
|
||||
# 中移互联
|
||||
andfx.cn
|
||||
andfx.net
|
||||
cmicapm.com
|
||||
cmicrwx.cn
|
||||
cmicvip.cn
|
||||
cmpassport.com
|
||||
cytxl.com.cn
|
||||
fetion-portal.com
|
||||
fetionpic.com
|
||||
mmarket.com
|
||||
|
||||
@@ -23,3 +23,4 @@ wo.com.cn
|
||||
wo116114.com
|
||||
wocloud.com.cn
|
||||
woread.com.cn
|
||||
wosms.cn
|
||||
|
||||
@@ -2,33 +2,44 @@ include:cloudflare-cn
|
||||
include:cloudflare-ipfs
|
||||
|
||||
argotunnel.com
|
||||
browser.run
|
||||
cfargotunnel.com
|
||||
cfdata.org
|
||||
cfl.re
|
||||
cloudflare-dns.com
|
||||
cloudflare-ech.com
|
||||
cloudflare-esni.com
|
||||
cloudflare-gateway.com
|
||||
cloudflare-quic.com
|
||||
cloudflare-terms-of-service-abuse.com
|
||||
cloudflare.com
|
||||
cloudflare.dev
|
||||
cloudflare.net
|
||||
cloudflare.tv
|
||||
cloudflareaccess.com
|
||||
cloudflareapps.com
|
||||
cloudflarebolt.com
|
||||
cloudflarebrowser.com
|
||||
cloudflarechallenge.com
|
||||
cloudflareclient.com
|
||||
cloudflarecp.com
|
||||
cloudflareinsights.com
|
||||
cloudflareok.com
|
||||
cloudflarepartners.com
|
||||
cloudflareportal.com
|
||||
cloudflarepreview.com
|
||||
cloudflareregistrar.com
|
||||
cloudflareresearch.com
|
||||
cloudflareresolve.com
|
||||
cloudflaressl.com
|
||||
cloudflarestatus.com
|
||||
cloudflarestorage.com
|
||||
cloudflarestream.com
|
||||
cloudflaresupport.com
|
||||
cloudflaretest.com
|
||||
cloudflarewarp.com
|
||||
cloudflareworkers.com
|
||||
encryptedsni.com
|
||||
every1dns.net
|
||||
imagedelivery.net
|
||||
isbgpsafeyet.com
|
||||
|
||||
@@ -46,16 +46,20 @@ ntd.com
|
||||
ntd.tv
|
||||
ntdca.com
|
||||
ntdimg.com
|
||||
ntdtv-dc.com
|
||||
ntdtv.ca
|
||||
ntdtv.co.il
|
||||
ntdtv.co.kr
|
||||
ntdtv.com
|
||||
ntdtv.com.tw
|
||||
ntdtv.fr
|
||||
ntdtv.jp
|
||||
ntdtv.kr
|
||||
ntdtv.org
|
||||
ntdtv.ru
|
||||
ntdtv-dc.com
|
||||
ntdtv.se
|
||||
ntdtvla.com
|
||||
ntdvideo.tw
|
||||
ntdvn.com
|
||||
persianepochtimes.com
|
||||
renminbao.com
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
# AI Chat
|
||||
include:category-ai-!cn
|
||||
|
||||
# Anime, Comics & Games
|
||||
include:category-acg
|
||||
|
||||
# Advertisment & Analytics
|
||||
include:pubmatic
|
||||
include:taboola
|
||||
@@ -247,29 +244,31 @@ include:zeplin
|
||||
include:zoho
|
||||
include:zoom
|
||||
|
||||
biliplus.com # BiliPlus
|
||||
|
||||
# Graphing for Science and Engineering
|
||||
originlab.com
|
||||
|
||||
# Online LaTeX Editor
|
||||
cloudlatex.io
|
||||
overleaf.com
|
||||
|
||||
# Translator & Dictionary
|
||||
include:linguee
|
||||
|
||||
collinsdictionary.com
|
||||
ldoceonline.com
|
||||
immersivetranslate.com # 沉浸式翻译 (国际版)
|
||||
|
||||
# Aurora Open Source Software (https://gitlab.com/AuroraOSS)
|
||||
## Aurora Open Source Software (https://gitlab.com/AuroraOSS)
|
||||
auroraoss.com
|
||||
|
||||
# CookiePro, provides cookies and tracking
|
||||
## BiliPlus
|
||||
biliplus.com
|
||||
## CataBoom
|
||||
cataboom.com
|
||||
## Consent Management Platforms / Cookie service
|
||||
consentpro.com
|
||||
cookiepro.com
|
||||
cookielaw.org
|
||||
onetrust.com
|
||||
osano.com
|
||||
usercentrics.eu
|
||||
## Greasy Fork
|
||||
greasyfork.org
|
||||
## Online LaTeX Editor
|
||||
cloudlatex.io
|
||||
overleaf.com
|
||||
## Translator & Dictionary
|
||||
include:linguee
|
||||
collinsdictionary.com
|
||||
ldoceonline.com
|
||||
immersivetranslate.com # 沉浸式翻译 (国际版)
|
||||
## OriginLab (Graphing for Science and Engineering)
|
||||
originlab.com
|
||||
|
||||
# Software development
|
||||
include:category-dev
|
||||
@@ -287,9 +286,6 @@ include:rarbg
|
||||
dmhy.org
|
||||
rutor.info
|
||||
|
||||
# User scripts
|
||||
greasyfork.org
|
||||
|
||||
# VPN services
|
||||
include:category-vpnservices
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ include:getui
|
||||
include:jiguang
|
||||
include:umeng
|
||||
|
||||
# 神策数据
|
||||
sensorsdata.cn
|
||||
|
||||
# category-httpdns-cn is mainly for advertising purpose
|
||||
include:category-httpdns-cn
|
||||
|
||||
@@ -35,9 +38,9 @@ include:category-httpdns-cn
|
||||
# Bank & Finance & Insurance & Securities
|
||||
include:category-bank-cn
|
||||
include:category-securities-cn
|
||||
include:eastmoney
|
||||
include:eastmoney @-!cn
|
||||
include:everbright
|
||||
include:pingan
|
||||
include:pingan @-!cn
|
||||
include:taikang
|
||||
|
||||
## 航财通·校园付
|
||||
@@ -89,11 +92,11 @@ pkoplink.com
|
||||
|
||||
# E-commerce
|
||||
include:58tongcheng
|
||||
include:ctrip
|
||||
include:ctrip @-!cn
|
||||
include:dangdang
|
||||
include:dewu
|
||||
include:dewu @-!cn
|
||||
include:dongjiao
|
||||
include:jd
|
||||
include:jd @-!cn
|
||||
include:lianjia
|
||||
include:meituan
|
||||
include:miaomiaozhe
|
||||
@@ -230,8 +233,14 @@ xiamenair.com # 厦门航空
|
||||
12306.cn
|
||||
95306.cn
|
||||
ccrgt.com
|
||||
## 北京市政交通一卡通
|
||||
bmac.com.cn
|
||||
## 车来了
|
||||
chelaile.net.cn
|
||||
## 跨境巴士
|
||||
kuajing84.com
|
||||
## 掌上公交
|
||||
mygolbs.com
|
||||
## 宁停车
|
||||
ningtingche.com
|
||||
## 航旅纵横
|
||||
@@ -315,6 +324,8 @@ include:zhubajie
|
||||
## 容联七陌 客服 营销
|
||||
7moor-fs1.com
|
||||
7moor.com
|
||||
## Alook 浏览器
|
||||
alookweb.com
|
||||
## 安兔兔
|
||||
antutu.com
|
||||
antutu.net
|
||||
@@ -332,14 +343,27 @@ clink.cn
|
||||
## 当贝
|
||||
dangbei.com
|
||||
dangbei.net
|
||||
## DCloud 数字天堂
|
||||
dcloud.io
|
||||
dcloud.net.cn
|
||||
## 酷控
|
||||
deepepg.com
|
||||
kookong.com
|
||||
## 滴答清单
|
||||
dida365.com
|
||||
## 兑吧
|
||||
dui88.com
|
||||
duiba.com.cn
|
||||
## 快应用
|
||||
hapjs.org
|
||||
quickapp.cn
|
||||
## 乐播投屏
|
||||
hpplay.cn
|
||||
lbtp.com
|
||||
lebo.cn
|
||||
lebo.com.cn
|
||||
lebo.top
|
||||
mirrorcast.cn
|
||||
## 货拉拉
|
||||
huolala.cn
|
||||
## 火绒
|
||||
@@ -377,6 +401,8 @@ soboten.com
|
||||
tacool.com
|
||||
## Via 浏览器
|
||||
viayoo.com
|
||||
## X 浏览器
|
||||
xbext.com
|
||||
## 印象笔记
|
||||
yinxiang.com
|
||||
## 智联招聘
|
||||
@@ -385,19 +411,19 @@ zhaopin.cn
|
||||
# Tech companies & Orginations
|
||||
include:aisiku # 北京艾斯酷科技有限公司
|
||||
include:akiko # 秋子酱科技
|
||||
include:alibaba
|
||||
include:alibaba @-!cn
|
||||
include:baidu
|
||||
include:beisen
|
||||
include:bluepoch
|
||||
include:bytedance
|
||||
include:didi
|
||||
include:bytedance @-!cn
|
||||
include:didi @-!cn
|
||||
include:dingdatech # 叮哒出行(杭州金通互联科技有限公司)
|
||||
include:dji
|
||||
include:gree
|
||||
include:haier
|
||||
include:hikvision
|
||||
include:honor
|
||||
include:huawei
|
||||
include:huawei @-!cn
|
||||
include:hupun # 杭州湖畔网络技术有限公司
|
||||
include:iflytek
|
||||
include:ishumei # 北京数美时代科技有限公司
|
||||
@@ -409,14 +435,14 @@ include:meizu
|
||||
include:midea
|
||||
include:narwal # 云鲸科技
|
||||
include:netease
|
||||
include:oppo
|
||||
include:oppo @-!cn
|
||||
include:qihoo360
|
||||
include:sumkoo #北京尚古创新科技有限公司
|
||||
include:tcl
|
||||
include:tencent
|
||||
include:tencent @-!cn
|
||||
include:tongfang
|
||||
include:vivo
|
||||
include:xiaomi
|
||||
include:vivo @-!cn
|
||||
include:xiaomi @-!cn
|
||||
include:xunlei
|
||||
include:youquan # 祐全科技
|
||||
include:yuanbei # 上海圆贝信息科技有限公司
|
||||
@@ -453,13 +479,14 @@ xsbapp.cn
|
||||
|
||||
# Telecommunication
|
||||
include:chinabroadnet
|
||||
include:chinamobile
|
||||
include:chinatelecom
|
||||
include:chinamobile @-!cn
|
||||
include:chinatelecom @-!cn
|
||||
include:chinatower
|
||||
include:chinaunicom
|
||||
include:chinaunicom @-!cn
|
||||
|
||||
# 在线工具
|
||||
include:ipip # IPIP ip地理位置数据库
|
||||
## IPIP ip地理位置数据库
|
||||
include:ipip @-!cn
|
||||
|
||||
chaziyu.com # 滇ICP备2024035496号
|
||||
fofa.info # Fofa网站测绘(华顺信安)
|
||||
|
||||
@@ -22,7 +22,15 @@ bard.google.com
|
||||
gemini.google
|
||||
gemini.google.com
|
||||
|
||||
# Gemini Code Assist
|
||||
# https://docs.cloud.google.com/gemini/docs/codeassist/set-up-gemini
|
||||
full:cloudaicompanion.googleapis.com
|
||||
full:cloudcode-pa.googleapis.com
|
||||
full:daily-cloudcode-pa.googleapis.com
|
||||
|
||||
# NotebookLM
|
||||
full:notebooklm-pa.googleapis.com
|
||||
full:notebooklm.googleapis.com
|
||||
notebooklm.google
|
||||
notebooklm.google.com
|
||||
|
||||
@@ -41,3 +49,9 @@ aida.googleapis.com
|
||||
# Opal
|
||||
opal.google
|
||||
opal.google.com
|
||||
|
||||
# Antigravity
|
||||
full:antigravity-pa.googleapis.com
|
||||
full:antigravity.googleapis.com
|
||||
antigravity.google
|
||||
antigravity-unleash.goog
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
bisheng.cn @cn
|
||||
bishengcompiler.cn @cn
|
||||
devui.design @cn
|
||||
gneec.com @cn
|
||||
gneec.com.cn @cn
|
||||
gneec3.com @cn
|
||||
gneec4.com @cn
|
||||
gneec7.com @cn
|
||||
harmonyos.com @cn
|
||||
hiascend.cn @cn
|
||||
hiascend.com @cn
|
||||
hiclc.com @cn
|
||||
hikunpeng.cn @cn
|
||||
hikunpeng.com @cn
|
||||
hikunpeng.com.cn @cn
|
||||
hikunpeng.net @cn
|
||||
hisilicon.com @cn
|
||||
hisilicon.com.cn @cn
|
||||
huaweiapaas.com @cn
|
||||
mindspore.cn @cn
|
||||
owsgo.com @cn
|
||||
teleows.com @cn
|
||||
saasops.tech @cn
|
||||
bisheng.cn
|
||||
bishengcompiler.cn
|
||||
devui.design
|
||||
gneec.com
|
||||
gneec.com.cn
|
||||
gneec3.com
|
||||
gneec4.com
|
||||
gneec7.com
|
||||
harmonyos.com
|
||||
hiascend.cn
|
||||
hiascend.com
|
||||
hiclc.com
|
||||
hikunpeng.cn
|
||||
hikunpeng.com
|
||||
hikunpeng.com.cn
|
||||
hikunpeng.net
|
||||
hisilicon.com
|
||||
hisilicon.com.cn
|
||||
huaweiapaas.com
|
||||
mindspore.cn
|
||||
owsgo.com
|
||||
saasops.tech
|
||||
teleows.com
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kechuang.org
|
||||
full:kc.kexinshe.com @cn
|
||||
kexinshe.com
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
kurogames.com @cn
|
||||
kurogames.com
|
||||
|
||||
# Wuthering Waves
|
||||
aki-game.com @cn
|
||||
aki-game.com
|
||||
|
||||
2
data/liveperson
Normal file
2
data/liveperson
Normal file
@@ -0,0 +1,2 @@
|
||||
liveperson.net
|
||||
lpsnmedia.net
|
||||
@@ -1,3 +1,5 @@
|
||||
include:github-ads
|
||||
|
||||
browser.events.data.msn.cn @ads
|
||||
browser.events.data.msn.com @ads
|
||||
clarity.ms @ads
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
include:picacg-ads
|
||||
|
||||
bikaa.xyz
|
||||
bikac.xyz
|
||||
bikaios.xyz
|
||||
@@ -14,3 +12,6 @@ wikawika.xyz
|
||||
# Image Resource Domain like `img.diwodiwo.xyz` `s3.diwodiwo.xyz` `storage.diwodiwo.xyz` `storage-b.diwodiwo.xyz`
|
||||
diwodiwo.xyz
|
||||
|
||||
# Ad Domain
|
||||
full:ad-channel.diwodiwo.xyz @ads
|
||||
full:ad-display.diwodiwo.xyz @ads
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
full:ad-channel.diwodiwo.xyz @ads
|
||||
full:ad-display.diwodiwo.xyz @ads
|
||||
5
data/pubg
Normal file
5
data/pubg
Normal file
@@ -0,0 +1,5 @@
|
||||
kraftonde.com
|
||||
playbattlegrounds.com
|
||||
pubg.com
|
||||
|
||||
full:pubg1.battleye.com
|
||||
@@ -1,3 +1,4 @@
|
||||
c.sayhi.360.cn @ads
|
||||
fenxi.360.cn @ads
|
||||
fenxi.com @ads
|
||||
lianmeng.360.cn @ads
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
static.sensorsdata.cn @ads
|
||||
4
data/standardchartered
Normal file
4
data/standardchartered
Normal file
@@ -0,0 +1,4 @@
|
||||
sc.com
|
||||
standardchartered.com
|
||||
full:standchartbank.sc.omtrdc.net
|
||||
full:standchartbank.tt.omtrdc.net
|
||||
3
data/steaminventoryhelper
Normal file
3
data/steaminventoryhelper
Normal file
@@ -0,0 +1,3 @@
|
||||
sih-db.com
|
||||
sih.app
|
||||
steaminventoryhelper.com
|
||||
@@ -1,4 +1,5 @@
|
||||
ad.hpplay.cn @ads
|
||||
adc.hpplay.cn @ads
|
||||
adeng.hpplay.cn @ads
|
||||
ads-uo.api.leiniao.com @ads
|
||||
ads-ut.api.leiniao.com @ads
|
||||
|
||||
11
data/tencent
11
data/tencent
@@ -79,3 +79,14 @@ fymallqa3.com
|
||||
fymallqa4.com
|
||||
fymallqa7.com
|
||||
fymallqa9.com
|
||||
|
||||
tdnsdl1.cn
|
||||
tdnsdl1.com.cn
|
||||
tdnsdl2.cn
|
||||
tdnsdl2.com.cn
|
||||
tdnsdl3.cn
|
||||
tdnsdl3.com.cn
|
||||
tdnsdl4.cn
|
||||
tdnsdl4.com.cn
|
||||
tdnsdl5.cn
|
||||
tdnsdl5.com.cn
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ad.browser.qq.com @ads
|
||||
ad.qq.com @ads
|
||||
ad.qun.qq.com @ads
|
||||
ad.tencentmusic.com @ads
|
||||
ad.weixin.qq.com @ads
|
||||
adfilter.imtt.qq.com @ads
|
||||
adnet.qq.com @ads
|
||||
@@ -33,18 +34,24 @@ isdspeed.qq.com @ads
|
||||
log.tbs.qq.com @ads
|
||||
mdt.qq.com @ads
|
||||
monitor.music.qq.com @ads
|
||||
monitor.uu.qq.com @ads
|
||||
mpush.qq.com @ads
|
||||
mtrace.qq.com @ads
|
||||
pgdt.gtimg.cn @ads
|
||||
pingjs.qq.com @ads
|
||||
pmir.3g.qq.com @ads
|
||||
push.qq.com @ads
|
||||
qqdata.ab.qq.com @ads
|
||||
report.qqweb.qq.com @ads
|
||||
report.tencentmusic.com @ads
|
||||
rmonitor.qq.com @ads
|
||||
sngmta.qq.com @ads
|
||||
stat.y.qq.com @ads
|
||||
tajs.qq.com @ads
|
||||
tcss.qq.com @ads
|
||||
tmead.y.qq.com @ads
|
||||
tmeadcomm.y.qq.com @ads
|
||||
tpstelemetry.tencent.com @ads
|
||||
trace.qq.com @ads
|
||||
ugdtimg.com @ads
|
||||
wit.qq.com @ads
|
||||
|
||||
@@ -11,4 +11,4 @@ tencentcloud.com
|
||||
tjstats.com
|
||||
wegamedeveloper.com
|
||||
weixinbridge.com
|
||||
weui.io @cn
|
||||
weui.io
|
||||
|
||||
@@ -2,3 +2,5 @@ tendcloud.com
|
||||
talkingdata.com
|
||||
talkinggame.com
|
||||
cpatrk.net
|
||||
|
||||
tdsdk.cpatrk.net @ads
|
||||
|
||||
@@ -107,6 +107,7 @@ volcfcdnrd.com
|
||||
volcfcdnsc.com
|
||||
volcfxgjrtm.com
|
||||
volcgroup.com
|
||||
volcgslb-mlt.com
|
||||
volcgslb.com
|
||||
volcgtm.com
|
||||
volciad.com
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
include:xiaomi-ads
|
||||
include:xiaomi-ai
|
||||
include:xiaomi-iot
|
||||
|
||||
mgslb.com
|
||||
mi-idc.com
|
||||
|
||||
5
data/xiaomi-iot
Normal file
5
data/xiaomi-iot
Normal file
@@ -0,0 +1,5 @@
|
||||
# Xiaomi IoT Services
|
||||
account.xiaomi.com
|
||||
cn-ha.mqtt.io.mi.com
|
||||
ha.api.io.mi.com
|
||||
miot-spec.org
|
||||
@@ -1,2 +1,5 @@
|
||||
xv-ru.com
|
||||
xvideos-ar.com
|
||||
xvideos-cdn.com
|
||||
xvideos-india.com
|
||||
xvideos.com
|
||||
|
||||
4
data/youmind
Normal file
4
data/youmind
Normal file
@@ -0,0 +1,4 @@
|
||||
# Youmind
|
||||
youmind.ai
|
||||
youmind.com
|
||||
youmind.site
|
||||
@@ -1,3 +1,10 @@
|
||||
# 掌淘
|
||||
mob.com
|
||||
dutils.com
|
||||
sharesdk.cn
|
||||
|
||||
# 游昆
|
||||
accuratead.cn
|
||||
dutils.com
|
||||
hiaiabc.com
|
||||
mobsdks.com
|
||||
yksdks.com
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
include:zhihu-ads
|
||||
|
||||
zhihu.com
|
||||
zhimg.com
|
||||
|
||||
crash2.zhihu.com @ads
|
||||
zhihu-web-analytics.zhihu.com @ads
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
crash2.zhihu.com @ads
|
||||
zhihu-web-analytics.zhihu.com @ads
|
||||
532
main.go
532
main.go
@@ -7,7 +7,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"sort"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
router "github.com/v2fly/v2ray-core/v5/app/router/routercommon"
|
||||
@@ -29,286 +29,307 @@ const (
|
||||
RuleTypeInclude string = "include"
|
||||
)
|
||||
|
||||
var (
|
||||
TypeChecker = regexp.MustCompile(`^(domain|full|keyword|regexp|include)$`)
|
||||
ValueChecker = regexp.MustCompile(`^[a-z0-9!\.-]+$`)
|
||||
AttrChecker = regexp.MustCompile(`^[a-z0-9!-]+$`)
|
||||
SiteChecker = regexp.MustCompile(`^[A-Z0-9!-]+$`)
|
||||
)
|
||||
|
||||
var (
|
||||
refMap = make(map[string][]*Entry)
|
||||
plMap = make(map[string]*ParsedList)
|
||||
finalMap = make(map[string][]*Entry)
|
||||
cirIncMap = make(map[string]bool) // Used for circular inclusion detection
|
||||
)
|
||||
|
||||
type Entry struct {
|
||||
Type string
|
||||
Value string
|
||||
Attrs []*router.Domain_Attribute
|
||||
Attrs []string
|
||||
Plain string
|
||||
Affs []string
|
||||
}
|
||||
|
||||
type List struct {
|
||||
Name string
|
||||
Entry []Entry
|
||||
type Inclusion struct {
|
||||
Source string
|
||||
MustAttrs []string
|
||||
BanAttrs []string
|
||||
}
|
||||
|
||||
type ParsedList struct {
|
||||
Name string
|
||||
Inclusion map[string]bool
|
||||
Entry []Entry
|
||||
Name string
|
||||
Inclusions []*Inclusion
|
||||
Entries []*Entry
|
||||
}
|
||||
|
||||
func (l *ParsedList) toPlainText(listName string) error {
|
||||
var entryBytes []byte
|
||||
for _, entry := range l.Entry {
|
||||
var attrString string
|
||||
if entry.Attrs != nil {
|
||||
for _, attr := range entry.Attrs {
|
||||
attrString += "@" + attr.GetKey() + ","
|
||||
}
|
||||
attrString = strings.TrimRight(":"+attrString, ",")
|
||||
}
|
||||
// Entry output format is: type:domain.tld:@attr1,@attr2
|
||||
entryBytes = append(entryBytes, []byte(entry.Type+":"+entry.Value+attrString+"\n")...)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(*outputDir, listName+".txt"), entryBytes, 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *ParsedList) toProto() (*router.GeoSite, error) {
|
||||
func makeProtoList(listName string, entries []*Entry) (*router.GeoSite, error) {
|
||||
site := &router.GeoSite{
|
||||
CountryCode: l.Name,
|
||||
CountryCode: listName,
|
||||
Domain: make([]*router.Domain, 0, len(entries)),
|
||||
}
|
||||
for _, entry := range l.Entry {
|
||||
for _, entry := range entries {
|
||||
pdomain := &router.Domain{Value: entry.Value}
|
||||
for _, attr := range entry.Attrs {
|
||||
pdomain.Attribute = append(pdomain.Attribute, &router.Domain_Attribute{
|
||||
Key: attr,
|
||||
TypedValue: &router.Domain_Attribute_BoolValue{BoolValue: true},
|
||||
})
|
||||
}
|
||||
|
||||
switch entry.Type {
|
||||
case RuleTypeDomain:
|
||||
site.Domain = append(site.Domain, &router.Domain{
|
||||
Type: router.Domain_RootDomain,
|
||||
Value: entry.Value,
|
||||
Attribute: entry.Attrs,
|
||||
})
|
||||
|
||||
pdomain.Type = router.Domain_RootDomain
|
||||
case RuleTypeRegexp:
|
||||
// check regexp validity to avoid runtime error
|
||||
_, err := regexp.Compile(entry.Value)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid regexp in list %s: %s", l.Name, entry.Value)
|
||||
}
|
||||
site.Domain = append(site.Domain, &router.Domain{
|
||||
Type: router.Domain_Regex,
|
||||
Value: entry.Value,
|
||||
Attribute: entry.Attrs,
|
||||
})
|
||||
|
||||
pdomain.Type = router.Domain_Regex
|
||||
case RuleTypeKeyword:
|
||||
site.Domain = append(site.Domain, &router.Domain{
|
||||
Type: router.Domain_Plain,
|
||||
Value: entry.Value,
|
||||
Attribute: entry.Attrs,
|
||||
})
|
||||
|
||||
pdomain.Type = router.Domain_Plain
|
||||
case RuleTypeFullDomain:
|
||||
site.Domain = append(site.Domain, &router.Domain{
|
||||
Type: router.Domain_Full,
|
||||
Value: entry.Value,
|
||||
Attribute: entry.Attrs,
|
||||
})
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown domain type: %s", entry.Type)
|
||||
pdomain.Type = router.Domain_Full
|
||||
}
|
||||
site.Domain = append(site.Domain, pdomain)
|
||||
}
|
||||
return site, nil
|
||||
}
|
||||
|
||||
func exportPlainTextList(list []string, refName string, pl *ParsedList) {
|
||||
for _, listName := range list {
|
||||
if strings.EqualFold(refName, listName) {
|
||||
if err := pl.toPlainText(strings.ToLower(refName)); err != nil {
|
||||
fmt.Println("Failed:", err)
|
||||
continue
|
||||
}
|
||||
fmt.Printf("'%s' has been generated successfully.\n", listName)
|
||||
}
|
||||
func writePlainList(exportedName string) error {
|
||||
targetList, exist := finalMap[strings.ToUpper(exportedName)]
|
||||
if !exist || len(targetList) == 0 {
|
||||
return fmt.Errorf("'%s' list does not exist or is empty.", exportedName)
|
||||
}
|
||||
file, err := os.Create(filepath.Join(*outputDir, strings.ToLower(exportedName) + ".txt"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
w := bufio.NewWriter(file)
|
||||
for _, entry := range targetList {
|
||||
fmt.Fprintln(w, entry.Plain)
|
||||
}
|
||||
return w.Flush()
|
||||
}
|
||||
|
||||
func removeComment(line string) string {
|
||||
idx := strings.Index(line, "#")
|
||||
if idx == -1 {
|
||||
return line
|
||||
}
|
||||
return strings.TrimSpace(line[:idx])
|
||||
}
|
||||
func parseEntry(line string) (Entry, error) {
|
||||
var entry Entry
|
||||
parts := strings.Fields(line)
|
||||
|
||||
func parseDomain(domain string, entry *Entry) error {
|
||||
kv := strings.Split(domain, ":")
|
||||
// Parse type and value
|
||||
rawTypeVal := parts[0]
|
||||
kv := strings.Split(rawTypeVal, ":")
|
||||
if len(kv) == 1 {
|
||||
entry.Type = RuleTypeDomain
|
||||
entry.Value = strings.ToLower(kv[0])
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(kv) == 2 {
|
||||
entry.Type = RuleTypeDomain // Default type
|
||||
entry.Value = strings.ToLower(rawTypeVal)
|
||||
} else if len(kv) == 2 {
|
||||
entry.Type = strings.ToLower(kv[0])
|
||||
|
||||
if strings.EqualFold(entry.Type, RuleTypeRegexp) {
|
||||
if entry.Type == RuleTypeRegexp {
|
||||
entry.Value = kv[1]
|
||||
} else {
|
||||
entry.Value = strings.ToLower(kv[1])
|
||||
}
|
||||
|
||||
return nil
|
||||
} else {
|
||||
return entry, fmt.Errorf("invalid format: %s", line)
|
||||
}
|
||||
|
||||
return fmt.Errorf("invalid format: %s", domain)
|
||||
}
|
||||
|
||||
func parseAttribute(attr string) (*router.Domain_Attribute, error) {
|
||||
var attribute router.Domain_Attribute
|
||||
if len(attr) == 0 || attr[0] != '@' {
|
||||
return &attribute, fmt.Errorf("invalid attribute: %s", attr)
|
||||
// Check type and value
|
||||
if !TypeChecker.MatchString(entry.Type) {
|
||||
return entry, fmt.Errorf("invalid type: %s", entry.Type)
|
||||
}
|
||||
|
||||
attribute.Key = strings.ToLower(attr[1:]) // Trim attribute prefix `@` character
|
||||
attribute.TypedValue = &router.Domain_Attribute_BoolValue{BoolValue: true}
|
||||
return &attribute, nil
|
||||
}
|
||||
|
||||
func parseEntry(line string) (Entry, error) {
|
||||
line = strings.TrimSpace(line)
|
||||
parts := strings.Split(line, " ")
|
||||
|
||||
var entry Entry
|
||||
if len(parts) == 0 {
|
||||
return entry, fmt.Errorf("empty entry")
|
||||
}
|
||||
|
||||
if err := parseDomain(parts[0], &entry); err != nil {
|
||||
return entry, err
|
||||
}
|
||||
|
||||
for i := 1; i < len(parts); i++ {
|
||||
attr, err := parseAttribute(parts[i])
|
||||
if err != nil {
|
||||
return entry, err
|
||||
if entry.Type == RuleTypeRegexp {
|
||||
if _, err := regexp.Compile(entry.Value); err != nil {
|
||||
return entry, fmt.Errorf("invalid regexp: %s", entry.Value)
|
||||
}
|
||||
entry.Attrs = append(entry.Attrs, attr)
|
||||
} else if !ValueChecker.MatchString(entry.Value) {
|
||||
return entry, fmt.Errorf("invalid value: %s", entry.Value)
|
||||
}
|
||||
|
||||
// Parse/Check attributes and affiliations
|
||||
for _, part := range parts[1:] {
|
||||
if strings.HasPrefix(part, "@") {
|
||||
attr := strings.ToLower(part[1:]) // Trim attribute prefix `@` character
|
||||
if !AttrChecker.MatchString(attr) {
|
||||
return entry, fmt.Errorf("invalid attribute key: %s", attr)
|
||||
}
|
||||
entry.Attrs = append(entry.Attrs, attr)
|
||||
} else if strings.HasPrefix(part, "&") {
|
||||
aff := strings.ToUpper(part[1:]) // Trim affiliation prefix `&` character
|
||||
if !SiteChecker.MatchString(aff) {
|
||||
return entry, fmt.Errorf("invalid affiliation key: %s", aff)
|
||||
}
|
||||
entry.Affs = append(entry.Affs, aff)
|
||||
} else {
|
||||
return entry, fmt.Errorf("invalid attribute/affiliation: %s", part)
|
||||
}
|
||||
}
|
||||
// Sort attributes
|
||||
slices.Sort(entry.Attrs)
|
||||
// Formated plain entry: type:domain.tld:@attr1,@attr2
|
||||
entry.Plain = entry.Type + ":" + entry.Value
|
||||
if len(entry.Attrs) != 0 {
|
||||
entry.Plain = entry.Plain + ":@" + strings.Join(entry.Attrs, ",@")
|
||||
}
|
||||
|
||||
return entry, nil
|
||||
}
|
||||
|
||||
func Load(path string) (*List, error) {
|
||||
func loadData(path string) error {
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
list := &List{
|
||||
Name: strings.ToUpper(filepath.Base(path)),
|
||||
listName := strings.ToUpper(filepath.Base(path))
|
||||
if !SiteChecker.MatchString(listName) {
|
||||
return fmt.Errorf("invalid list name: %s", listName)
|
||||
}
|
||||
scanner := bufio.NewScanner(file)
|
||||
lineIdx := 0
|
||||
for scanner.Scan() {
|
||||
line := strings.TrimSpace(scanner.Text())
|
||||
line = removeComment(line)
|
||||
if len(line) == 0 {
|
||||
line := scanner.Text()
|
||||
lineIdx++
|
||||
// Remove comments
|
||||
if idx := strings.Index(line, "#"); idx != -1 {
|
||||
line = line[:idx]
|
||||
}
|
||||
line = strings.TrimSpace(line)
|
||||
if line == "" {
|
||||
continue
|
||||
}
|
||||
entry, err := parseEntry(line)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return fmt.Errorf("error in %s at line %d: %v", path, lineIdx, err)
|
||||
}
|
||||
list.Entry = append(list.Entry, entry)
|
||||
refMap[listName] = append(refMap[listName], &entry)
|
||||
}
|
||||
|
||||
return list, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func isMatchAttr(Attrs []*router.Domain_Attribute, includeKey string) bool {
|
||||
isMatch := false
|
||||
mustMatch := true
|
||||
matchName := includeKey
|
||||
if strings.HasPrefix(includeKey, "!") {
|
||||
isMatch = true
|
||||
mustMatch = false
|
||||
matchName = strings.TrimLeft(includeKey, "!")
|
||||
func parseList(refName string, refList []*Entry) error {
|
||||
pl, _ := plMap[refName]
|
||||
if pl == nil {
|
||||
pl = &ParsedList{Name: refName}
|
||||
plMap[refName] = pl
|
||||
}
|
||||
|
||||
for _, Attr := range Attrs {
|
||||
attrName := Attr.Key
|
||||
if mustMatch {
|
||||
if matchName == attrName {
|
||||
isMatch = true
|
||||
break
|
||||
for _, entry := range refList {
|
||||
if entry.Type == RuleTypeInclude {
|
||||
if len(entry.Affs) != 0 {
|
||||
return fmt.Errorf("affiliation is not allowed for include:%s", entry.Value)
|
||||
}
|
||||
} else {
|
||||
if matchName == attrName {
|
||||
isMatch = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return isMatch
|
||||
}
|
||||
|
||||
func createIncludeAttrEntrys(list *List, matchAttr *router.Domain_Attribute) []Entry {
|
||||
newEntryList := make([]Entry, 0, len(list.Entry))
|
||||
matchName := matchAttr.Key
|
||||
for _, entry := range list.Entry {
|
||||
matched := isMatchAttr(entry.Attrs, matchName)
|
||||
if matched {
|
||||
newEntryList = append(newEntryList, entry)
|
||||
}
|
||||
}
|
||||
return newEntryList
|
||||
}
|
||||
|
||||
func ParseList(list *List, ref map[string]*List) (*ParsedList, error) {
|
||||
pl := &ParsedList{
|
||||
Name: list.Name,
|
||||
Inclusion: make(map[string]bool),
|
||||
}
|
||||
entryList := list.Entry
|
||||
for {
|
||||
newEntryList := make([]Entry, 0, len(entryList))
|
||||
hasInclude := false
|
||||
for _, entry := range entryList {
|
||||
if entry.Type == RuleTypeInclude {
|
||||
refName := strings.ToUpper(entry.Value)
|
||||
if entry.Attrs != nil {
|
||||
for _, attr := range entry.Attrs {
|
||||
InclusionName := strings.ToUpper(refName + "@" + attr.Key)
|
||||
if pl.Inclusion[InclusionName] {
|
||||
continue
|
||||
}
|
||||
pl.Inclusion[InclusionName] = true
|
||||
|
||||
refList := ref[refName]
|
||||
if refList == nil {
|
||||
return nil, fmt.Errorf("list not found: %s", entry.Value)
|
||||
}
|
||||
attrEntrys := createIncludeAttrEntrys(refList, attr)
|
||||
if len(attrEntrys) != 0 {
|
||||
newEntryList = append(newEntryList, attrEntrys...)
|
||||
}
|
||||
}
|
||||
inc := &Inclusion{Source: strings.ToUpper(entry.Value)}
|
||||
for _, attr := range entry.Attrs {
|
||||
if strings.HasPrefix(attr, "-") {
|
||||
inc.BanAttrs = append(inc.BanAttrs, attr[1:]) // Trim attribute prefix `-` character
|
||||
} else {
|
||||
InclusionName := refName
|
||||
if pl.Inclusion[InclusionName] {
|
||||
continue
|
||||
}
|
||||
pl.Inclusion[InclusionName] = true
|
||||
refList := ref[refName]
|
||||
if refList == nil {
|
||||
return nil, fmt.Errorf("list not found: %s", entry.Value)
|
||||
}
|
||||
newEntryList = append(newEntryList, refList.Entry...)
|
||||
inc.MustAttrs = append(inc.MustAttrs, attr)
|
||||
}
|
||||
hasInclude = true
|
||||
} else {
|
||||
newEntryList = append(newEntryList, entry)
|
||||
}
|
||||
}
|
||||
entryList = newEntryList
|
||||
if !hasInclude {
|
||||
break
|
||||
pl.Inclusions = append(pl.Inclusions, inc)
|
||||
} else {
|
||||
for _, aff := range entry.Affs {
|
||||
apl, _ := plMap[aff]
|
||||
if apl == nil {
|
||||
apl = &ParsedList{Name: aff}
|
||||
plMap[aff] = apl
|
||||
}
|
||||
apl.Entries = append(apl.Entries, entry)
|
||||
}
|
||||
pl.Entries = append(pl.Entries, entry)
|
||||
}
|
||||
}
|
||||
pl.Entry = entryList
|
||||
return nil
|
||||
}
|
||||
|
||||
return pl, nil
|
||||
func polishList(roughMap *map[string]*Entry) []*Entry {
|
||||
finalList := make([]*Entry, 0, len(*roughMap))
|
||||
queuingList := make([]*Entry, 0, len(*roughMap)) // Domain/full entries without attr
|
||||
domainsMap := make(map[string]bool)
|
||||
for _, entry := range *roughMap {
|
||||
switch entry.Type { // Bypass regexp, keyword and "full/domain with attr"
|
||||
case RuleTypeRegexp:
|
||||
finalList = append(finalList, entry)
|
||||
case RuleTypeKeyword:
|
||||
finalList = append(finalList, entry)
|
||||
case RuleTypeDomain:
|
||||
domainsMap[entry.Value] = true
|
||||
if len(entry.Attrs) != 0 {
|
||||
finalList = append(finalList, entry)
|
||||
} else {
|
||||
queuingList = append(queuingList, entry)
|
||||
}
|
||||
case RuleTypeFullDomain:
|
||||
if len(entry.Attrs) != 0 {
|
||||
finalList = append(finalList, entry)
|
||||
} else {
|
||||
queuingList = append(queuingList, entry)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Remove redundant subdomains for full/domain without attr
|
||||
for _, qentry := range queuingList {
|
||||
isRedundant := false
|
||||
pd := qentry.Value // Parent domain
|
||||
for {
|
||||
idx := strings.Index(pd, ".")
|
||||
if idx == -1 { break }
|
||||
pd = pd[idx+1:] // Go for next parent
|
||||
if !strings.Contains(pd, ".") { break } // Not allow tld to be a parent
|
||||
if domainsMap[pd] {
|
||||
isRedundant = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !isRedundant {
|
||||
finalList = append(finalList, qentry)
|
||||
}
|
||||
}
|
||||
// Sort final entries
|
||||
slices.SortFunc(finalList, func(a, b *Entry) int {
|
||||
return strings.Compare(a.Plain, b.Plain)
|
||||
})
|
||||
return finalList
|
||||
}
|
||||
|
||||
func resolveList(pl *ParsedList) error {
|
||||
if _, pldone := finalMap[pl.Name]; pldone { return nil }
|
||||
|
||||
if cirIncMap[pl.Name] {
|
||||
return fmt.Errorf("circular inclusion in: %s", pl.Name)
|
||||
}
|
||||
cirIncMap[pl.Name] = true
|
||||
defer delete(cirIncMap, pl.Name)
|
||||
|
||||
isMatchAttrFilters := func(entry *Entry, incFilter *Inclusion) bool {
|
||||
if len(incFilter.MustAttrs) == 0 && len(incFilter.BanAttrs) == 0 { return true }
|
||||
if len(entry.Attrs) == 0 { return len(incFilter.MustAttrs) == 0 }
|
||||
|
||||
for _, m := range incFilter.MustAttrs {
|
||||
if !slices.Contains(entry.Attrs, m) { return false }
|
||||
}
|
||||
for _, b := range incFilter.BanAttrs {
|
||||
if slices.Contains(entry.Attrs, b) { return false }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
roughMap := make(map[string]*Entry) // Avoid basic duplicates
|
||||
for _, dentry := range pl.Entries { // Add direct entries
|
||||
roughMap[dentry.Plain] = dentry
|
||||
}
|
||||
for _, inc := range pl.Inclusions {
|
||||
incPl, exist := plMap[inc.Source]
|
||||
if !exist {
|
||||
return fmt.Errorf("list '%s' includes a non-existent list: '%s'", pl.Name, inc.Source)
|
||||
}
|
||||
if err := resolveList(incPl); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, ientry := range finalMap[inc.Source] {
|
||||
if isMatchAttrFilters(ientry, inc) { // Add included entries
|
||||
roughMap[ientry.Plain] = ientry
|
||||
}
|
||||
}
|
||||
}
|
||||
finalMap[pl.Name] = polishList(&roughMap)
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -317,7 +338,7 @@ func main() {
|
||||
dir := *dataPath
|
||||
fmt.Println("Use domain lists in", dir)
|
||||
|
||||
ref := make(map[string]*List)
|
||||
// Generate refMap
|
||||
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -325,18 +346,32 @@ func main() {
|
||||
if info.IsDir() {
|
||||
return nil
|
||||
}
|
||||
list, err := Load(path)
|
||||
if err != nil {
|
||||
if err := loadData(path); err != nil {
|
||||
return err
|
||||
}
|
||||
ref[list.Name] = list
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println("Failed:", err)
|
||||
fmt.Println("Failed to loadData:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Generate plMap
|
||||
for refName, refList := range refMap {
|
||||
if err := parseList(refName, refList); err != nil {
|
||||
fmt.Println("Failed to parseList:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// Generate finalMap
|
||||
for _, pl := range plMap {
|
||||
if err := resolveList(pl); err != nil {
|
||||
fmt.Println("Failed to resolveList:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// Create output directory if not exist
|
||||
if _, err := os.Stat(*outputDir); os.IsNotExist(err) {
|
||||
if mkErr := os.MkdirAll(*outputDir, 0755); mkErr != nil {
|
||||
@@ -345,55 +380,40 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
protoList := new(router.GeoSiteList)
|
||||
var existList []string
|
||||
for refName, list := range ref {
|
||||
pl, err := ParseList(list, ref)
|
||||
if err != nil {
|
||||
fmt.Println("Failed:", err)
|
||||
os.Exit(1)
|
||||
// Export plaintext list
|
||||
if *exportLists != "" {
|
||||
exportedListSlice := strings.Split(*exportLists, ",")
|
||||
for _, exportedList := range exportedListSlice {
|
||||
if err := writePlainList(exportedList); err != nil {
|
||||
fmt.Println("Failed to write list:", err)
|
||||
continue
|
||||
}
|
||||
fmt.Printf("list: '%s' has been generated successfully.\n", exportedList)
|
||||
}
|
||||
site, err := pl.toProto()
|
||||
}
|
||||
|
||||
// Generate dat file
|
||||
protoList := new(router.GeoSiteList)
|
||||
for siteName, siteEntries := range finalMap {
|
||||
site, err := makeProtoList(siteName, siteEntries)
|
||||
if err != nil {
|
||||
fmt.Println("Failed:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
protoList.Entry = append(protoList.Entry, site)
|
||||
|
||||
// Flatten and export plaintext list
|
||||
if *exportLists != "" {
|
||||
if existList != nil {
|
||||
exportPlainTextList(existList, refName, pl)
|
||||
} else {
|
||||
exportedListSlice := strings.Split(*exportLists, ",")
|
||||
for _, exportedListName := range exportedListSlice {
|
||||
fileName := filepath.Join(dir, exportedListName)
|
||||
_, err := os.Stat(fileName)
|
||||
if err == nil || os.IsExist(err) {
|
||||
existList = append(existList, exportedListName)
|
||||
} else {
|
||||
fmt.Printf("'%s' list does not exist in '%s' directory.\n", exportedListName, dir)
|
||||
}
|
||||
}
|
||||
if existList != nil {
|
||||
exportPlainTextList(existList, refName, pl)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sort protoList so the marshaled list is reproducible
|
||||
sort.SliceStable(protoList.Entry, func(i, j int) bool {
|
||||
return protoList.Entry[i].CountryCode < protoList.Entry[j].CountryCode
|
||||
slices.SortFunc(protoList.Entry, func(a, b *router.GeoSite) int {
|
||||
return strings.Compare(a.CountryCode, b.CountryCode)
|
||||
})
|
||||
|
||||
protoBytes, err := proto.Marshal(protoList)
|
||||
if err != nil {
|
||||
fmt.Println("Failed:", err)
|
||||
fmt.Println("Failed to marshal:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(*outputDir, *outputName), protoBytes, 0644); err != nil {
|
||||
fmt.Println("Failed:", err)
|
||||
fmt.Println("Failed to write output:", err)
|
||||
os.Exit(1)
|
||||
} else {
|
||||
fmt.Println(*outputName, "has been generated successfully.")
|
||||
|
||||
Reference in New Issue
Block a user