Compare commits

..

1 Commits

Author SHA1 Message Date
MkQtS
9ba660347d create category-non-domestic-cn
They are part of Chinese entities but **exclusively** serving for non-cn area

This is a continuation of https://github.com/v2fly/domain-list-community/pull/3198
2026-02-19 14:47:58 +08:00
59 changed files with 208 additions and 352 deletions

View File

@@ -61,7 +61,7 @@ jobs:
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b release
git add *.txt *.sha256sum dlc.dat dlc.dat_plain.yml dlc.dat.zip dlc.dat.xz
git add *.txt *.sha256sum dlc.dat dlc.dat.zip dlc.dat.xz
git commit -m "${{ env.RELEASE_NAME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u origin release

View File

@@ -34,7 +34,7 @@ jobs:
mv dlc.dat TEST-${{ github.run_number }}-dlc.dat
- name: Upload TEST-${{ github.run_number }}-dlc.dat
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v6
with:
name: TEST-${{ github.run_number }}-dlc.dat
path: TEST-${{ github.run_number }}-dlc.dat

View File

@@ -33,7 +33,6 @@ aboutamazon.in
aboutamazon.it
aboutamazon.jp
aboutamazon.pl
aboutamazon.sg
alexafund.cn @cn
alexafund.com.cn @cn
amaaozn.com
@@ -43,35 +42,24 @@ amazon-lantern.com
amazon-launchpad.com
amazon.ae
amazon.ca
amazon.cl
amazon.cn @cn
amazon.co.jp
amazon.co.uk
amazon.co.za
amazon.com
amazon.com.au
amazon.com.be
amazon.com.br
amazon.com.co
amazon.com.mx
amazon.com.ng
amazon.com.tr
amazon.de
amazon.dev
amazon.eg
amazon.es
amazon.fr
amazon.ie
amazon.in
amazon.it
amazon.jobs
amazon.jp
amazon.lu
amazon.nl
amazon.pl
amazon.red
amazon.sa
amazon.se
amazon.sg
amazonalexavoxcon.com
amazonauthorinsights.com
@@ -115,7 +103,6 @@ media-amazon.com
primeday.cn @cn
primeday.com.cn @cn
primeday.info
seattlespheres.com
siege-amazon.com
ssl-images-amazon.com
ueberamazon.de

View File

@@ -1,3 +1 @@
apkmirror.com
full:apkmirror.disqus.com

View File

@@ -752,7 +752,6 @@ courier-push-apple.com.akadns.net
full:amp-api-edge-lb-cn.itunes-apple.com.akadns.net @cn
full:amp-api-edge-lb.itunes-apple.com.akadns.net @cn
full:amp-api-edge.apps.apple.com @cn
full:amp-api-edge.music.apple.com @cn
full:amp-api-search-edge.apps.apple.com @cn
full:amp-api.apps.apple.com @cn
full:amp-api.music.apple.com @cn
@@ -783,8 +782,6 @@ full:js-cdn.music.apple.com @cn
full:km.support.apple.com @cn
full:maps.apple.com @cn
full:misc-assets.itunes.apple.com @cn
full:musicstatus.music.apple.com @cn
full:mvod.itunes.apple.com @cn
full:myapp.itunes.apple.com @cn
full:np-edge.itunes.apple.com @cn
full:osxapps.itunes.apple.com @cn
@@ -797,7 +794,6 @@ full:se2.itunes.apple.com @cn
full:search.itunes.apple.com @cn
full:sf-api-token-service.itunes.apple.com @cn
full:sp.itunes.apple.com @cn
full:speedysub.music.apple.com @cn
full:streamingaudio.itunes.apple.com @cn
full:su.itunes.apple.com @cn
full:sync.itunes.apple.com @cn

View File

@@ -40,7 +40,6 @@ awssecworkshops.com
awsstatic.com
awsthinkbox.com
awstrack.me
awswaf.com
cdkworkshop.com
cloudfront.com
cloudfront.net

View File

@@ -33,12 +33,10 @@ chutes.ai
copilot.microsoft.com
devin.ai
diabrowser.com
diabrowser.engineering
dify.ai
duck.ai
gateway.ai.cloudflare.com
kiro.dev
lovart.ai
meta.ai
mistral.ai
openart.ai

View File

@@ -1,7 +1,3 @@
include:apkcombo
include:apkmirror
include:apkpure
# Uptodown
uptodown.com
utdstc.com

View File

@@ -5,10 +5,6 @@ alfabank.ru
gazprombank.ru
gpb.ru
# Mts dengi
dbo-dengi.online
mtsdengi.ru
# PSB Bank
psbank.ru
@@ -32,9 +28,5 @@ cdn-tinkoff.ru
tbank-online.com
tbank.ru
# Tochka bank
tochka-tech.com
tochka.com
# VTB Bank
vtb.ru

View File

@@ -3,7 +3,6 @@ include:cdn77
include:cloudflare
include:fastly
include:imgix
include:jsdelivr
include:limelight
include:pagecdn
include:quantil
@@ -14,6 +13,3 @@ include:vrcdn
b-cdn.net
bunny.net
bunnycdn.com
# cdnjs
cdnjs.com

View File

@@ -66,7 +66,6 @@ include:openweather
include:oracle
include:panasonic
include:pccw
include:plex
include:qnap
include:qualcomm
include:qwant

View File

@@ -35,7 +35,6 @@ bitmex.com
bitquick.co
bitstamp.net
bittrex.com
blockchain.com
blockfrost.io
btcbox.co.jp
cex.io

View File

@@ -33,17 +33,22 @@ include:java
include:jetbrains
include:jetbrains-ai
include:jfrog
include:jsdelivr
include:kubernetes
include:microsoft-dev
include:mongodb
include:nginx
include:nixos
include:openwrt
include:osdn
include:perl
include:polymer
include:python
include:python-community
include:qt
include:readthedocs
include:redis
include:remirepo
include:ruby
include:rust
include:redhat
@@ -54,8 +59,10 @@ include:stackexchange
include:strikingly
include:termux
include:thelinuxfoundation
include:topcoder
include:unity
include:v8
include:vim
adventofcode.com
alpinelinux.org
@@ -64,6 +71,7 @@ artixlinux.org
atom.io
badgen.net
bitvise.com
cdnjs.com
centos.org
chocolatey.org
clojure.org
@@ -115,20 +123,16 @@ notepad-plus-plus.org
openresty.org
openssl.org
opensuse.org
osdn.net
packagecloud.io
packagist.org
pcre.org
phantomjs.org
php.net
piwheels.org
postgresql.org
putty.org
r-project.org
raspberrypi.org
raspbian.org
regex101.com
remirepo.net
rpmfusion.org
scientificlinux.org
scoop.sh
@@ -138,11 +142,9 @@ sqlite.org
sublimetext.com
tampermonkey.net
termius.com
topcoder.com
unpkg.com
videojs.com
videolan.org
vim.org
wapm.io
wasmer.io
webflow.com

View File

@@ -1,13 +1,2 @@
1ppt.com
360doc.com
52ppt.com
badou.com
book118.com
doc88.com
docin.com
douding.cn
haohaodoc.com
lazyer.net
renrendoc.com
wenkeju.com
ypppt.com
include:doc88
include:docin

View File

@@ -97,7 +97,6 @@ omobi.cc
oranum.com
overcast.fm
qobuz.com
sendvid.com
syosetu.com
weverse.io
yande.re

View File

@@ -44,8 +44,6 @@ ldmnq.com
lsplayer.com
yeshen.com
# 172Mix 舞曲音乐
172mix.com
# 17K小说
17k.com
# https://github.com/supzhang/epg
@@ -65,7 +63,6 @@ bsbsb.top
dmzj.com
muwai.com
# 懂球帝
dongdianqiu.com
dongqiudi.com
# 飞卢小说
faloo.com

View File

@@ -13,7 +13,7 @@ include:gaijin
include:garena
include:gog
include:hoyoverse
# Dead include:illusion
include:illusion
include:itchio
include:lowiro
include:modrinth
@@ -55,7 +55,6 @@ joinsquad.com
loverslab.com
minecraft.wiki
mobimon.com.tw
muvluv-girls-garden.com
nexus-cdn.com
nexusmods.com
noxygames.com

View File

@@ -18,10 +18,8 @@ cbr.ru # Central Bank of Russia
cikrf.ru # Central Electoral Commission of the Russian Federation
ebs.ru # Unified Biometric System
goskey.ru # GosKey - an electronic signature on a smartphone
grfc.ru # General radio frequency center
izbirkom.ru # Information on ongoing elections and referendums
kremlin.ru # Online representation of the President of Russia
mil.ru # Ministry of Defense of the Russian Federation
nalog.ru # Federal Tax Service
xn--80ajghhoc2aj1c8b.xn--p1ai # Honest Sign - State Labeling System

View File

@@ -1,141 +1,66 @@
include:ipip
2ip.io
2ip.ru
2ip.ua
51degrees.com
abstractapi.com
apiip.net
apivoid.com
bigdatacloud.net
check-host.net
checkip.org
checkip.ru
country.is
curlmyip.net
dadata.ru
db-ip.com
extreme-ip-lookup.com
find-my-ip.com
find-my-ip.net
findip.net
flagfox.net
fraudguard.io
fraudlogix.com
freegeoip.app
freeipapi.com
geodatatool.com
geoip.noc.gov.ru
geojs.io
geolocation-db.com
geoplugin.com
geoplugin.net
getipintel.net
greip.io
hackertarget.com
httpbin.org
icanhazip.com
ident.me
ifconfig.co
ifconfig.es
ifconfig.me
ip-adress.com
ip-api.com
ip-api.io
ip-api.ru
ip-check.info
ip-score.com
ip.me
ip.sb
ip2c.org
ip2location.com
ip2location.io
ip2ruscity.com
ip4.me
ip6.me
ip6only.me
ip8.com
ipaddr.site
ipaddress.com
ipaddress.my
ipaddress.sh
ipapi.co
ipapi.com
ipapi.is
ipbase.com
ipcalf.com
ipchicken.com
ipdata.co
ipecho.net
ipfind.io
ipfinder.io
ipgeolocation.io
ipify.org
ipinfo.io
iplark.com @cn
ipleak.net
ipligence.com
iplocate.io
iplocation.com
iplocation.io
iplocation.net
ipqualityscore.com
ipquery.io
ipregistry.co
iproyal.com
ipstack.com
ipverify.com
ipw.cn @cn
ipwhois.io
ipxapi.com
l2.io
maxmind.com
mon-ip.com
monip.org
my.ipinfo.app
myexternalip.com
myip.com
myip.ms
myip.ru
myipaddress.com
myiplookup.com
mylocation.org
osint.sh
proxycheck.io
realip.cc
seeip.org
showmyip.com
showmyipaddress.com
spur.us
sxgeo.city
sypexgeo.net
tnx.nl
tracemyip.org
trustmyip.com
wgetip.com
whatismyip.com
whatismyip.net
whatismyip.org
whatismyipaddress.com
whatismyipaddress.net
whatismyisp.com
whatismyv6.com
whatsmyip.com
whatsmyip.org
where-am-i.co
whoer.net
whoerip.com
whoisxmlapi.com
wieistmeineip.de
wtfismyip.com
# Subdomains/internal api used for ip-geo-detect
full:checkip.amazonaws.com
geoip.noc.gov.ru
ip.mail.ru
ip.nic.ru
ip.tyk.nu
ipgeo.vercel.app
ipv4-internet.yandex.net
ipv6-internet.yandex.net
whois.pconline.com.cn @cn

View File

@@ -0,0 +1,31 @@
# Part of Chinese entities but exclusively serving for non-cn area
include:alibaba @!cn
include:anker @!cn
include:bilibili @!cn
include:boc @!cn
include:bytedance @!cn
include:ccb @!cn
include:chinamobile @!cn
include:chinatelecom @!cn
include:chinaunicom @!cn
include:citic @!cn
include:cmb @!cn
include:ctrip @!cn
include:deepin @!cn
include:dewu @!cn
include:didi @!cn
include:eastmoney @!cn
include:huawei @!cn
include:icbc @!cn
include:ipip @!cn
include:iqiyi @!cn
include:jd @!cn
include:oppo @!cn
include:pingan @!cn
include:sina @!cn
include:tencent @!cn
include:vivo @!cn
include:xd @!cn
include:xiaohongshu @!cn
include:xiaomi @!cn

View File

@@ -25,9 +25,8 @@ include:hentaichen
include:hentaivn
include:heyzo
include:hooligapps
# Dead include:illusion
include:illusion
include:illusion-nonofficial
include:illgames
include:jable
include:japonx
include:javbus
@@ -138,7 +137,6 @@ porn
18hmanga.com
18insta.com
18j.tv
18jav.tv
18jms.com
18mh.co
18mh.me
@@ -2225,8 +2223,6 @@ heavyfetish.com
hegre.com
heiguab.top
heijidi.life
heiliao.com
heiliao88.com
heise360181.buzz
heise360182.buzz
helixstudios.net
@@ -2694,14 +2690,12 @@ jasmin.com
jav-angel.net
jav-subtitles.com
jav-vr.net
jav.com.co
jav.dog
jav.gallery
jav.guru
jav.la
jav.land
jav.place
jav.sb
jav.si
jav.wine
jav01.cc
@@ -2764,7 +2758,6 @@ javhdporn.net
javher.com
javheroine.com
javhihi.com
javhub.com
javhub.me
javhub.net
javidol.org
@@ -2798,9 +2791,7 @@ javprime.net
javpub.me
javpush.com
javqd.com
javquick.com
javrank.com
javrate.com
javrave.club
javroot.com
javscat.net
@@ -2825,7 +2816,6 @@ javtrust.com
javtube.cc
javtube.com
javtube.net
javvideoporn.com
javvids.com
javxspot.com
javxxx.me
@@ -3597,7 +3587,6 @@ ninpu.cyou
niuc2.com
niziero.info
njav.tv
njavtv.com
nlsexfilmpjes.com
nlt-media.com
noc.syosetu.com
@@ -5577,6 +5566,9 @@ xgtd3.com
xgtdr.buzz
xh-porn.com
xh.video
xhamster.com
xhamster.desi
xhamster2.com
xhot.pro
xhub.tv
xiangrikui-app.com
@@ -6165,7 +6157,6 @@ regexp:(^|\.)tqav[1-9][0-9]\.com$
regexp:(^|\.)tt[1-2][0-9]\.tv$
regexp:(^|\.)ttghg[1-9][0-9]\.xyz$
regexp:(^|\.)tttv([1-9][0-9]?|100)\.com$
regexp:(^|\.)twav[1-9]\.xyz$
regexp:(^|\.)twseb([1-9][0-9]?)?\.com$
regexp:(^|\.)uu[a-z][1-9][0-9]?\.com$
regexp:(^|\.)whtdh0[1-3]\.cc$

View File

@@ -24,15 +24,10 @@ spvb.ru # Saint-Petersburg Stock Exchange
# Financial marketplace
banki.ru
finuslugi.ru
# Investment
sistema-capital.com
# Mir payment system
mirpayonline.ru
# National Payment Card System
nspk.ru
# Tipping service
netmonet.co
tips.tips
# Telecom operators
beeline.ru
@@ -54,6 +49,4 @@ ngenix.net # NGENIX is a Russian provider of acceleration and security servi
pochta.ru # Russian post
qms.ru # Russian internet speed testing service
rustore.ru # RuStore is a Russian mobile app store for Android
t1.cloud # Russian cloud storage provider
taxsee.com # Taxi for business (self-employed drivers)
yclients.com # Russian SaaS platform for online booking and business automation for service companies

View File

@@ -8,6 +8,7 @@ include:doi
include:elsevier
include:google-scholar
include:ieee
include:knovel
include:mit
include:proquest
include:sci-hub

View File

@@ -6,20 +6,9 @@ include:instagram
include:linkedin
include:mailru
include:misskey
include:mixi
include:ok
include:threads
include:twitter
include:vk
onlyfans.com
truthsocial.com
# Mastodon
# * We can not make a comprehensive domain list of all Mastodon instances.
# * Many more dynamic/random instance domains are not listed here.
# * geosite:mastodon is not provided to avoid creating excessive expectations among users.
joinmastodon.org
mastodon.online
mastodon.social
pawoo.net

View File

@@ -1,3 +0,0 @@
include:bitly
include:shorturl
include:tinyurl

View File

@@ -2,3 +2,4 @@
include:tld-cn
include:geolocation-cn
#include:category-non-domestic-cn

View File

@@ -1,7 +1,6 @@
chobit.cc
ci-en.jp
ci-en.net
dlaf.jp
dlsite.com
dlsite.com.tw
dlsite.jp

1
data/doc88 Normal file
View File

@@ -0,0 +1 @@
doc88.com

2
data/docin Normal file
View File

@@ -0,0 +1,2 @@
docin.com
douding.cn

View File

@@ -1,5 +1,8 @@
# This list contains domains that don't have access point in China mainland. This is opposite to geolocation-cn.
# Part of Chinese entities but exclusively serving for non-cn area
include:category-non-domestic-cn
# AI Chat
include:category-ai-!cn
@@ -45,8 +48,6 @@ include:paypal
include:softbank
include:stripe
include:visa
## アプリペイ
app-pay.jp
# CDN companies & Services
include:category-cdn-!cn
@@ -85,6 +86,7 @@ include:embl
include:freecodecamp
include:kaggle
include:khanacademy
include:knovel
include:laracasts
include:libgen
include:lifewire
@@ -157,7 +159,6 @@ include:category-enhance-gaming
include:category-mobile-repair
include:category-ntp
include:category-password-management
include:category-urlshortner
include:category-web-archive
include:decryptipastore # iOS
@@ -172,6 +173,7 @@ include:addtoany
include:adguard
include:aptoide
include:arphic
include:bitly
include:blender
include:brightcove
include:buymeacoffee
@@ -225,6 +227,7 @@ include:sb
include:setapp
include:sharethis
include:shopify
include:shorturl
include:slideshare
include:sourceforge
include:squareup
@@ -234,6 +237,7 @@ include:svp
include:test-ipv6
include:tex
include:tidelift
include:tinyurl
include:trello
include:tumblr
include:tutanota
@@ -258,10 +262,6 @@ cookielaw.org
onetrust.com
osano.com
usercentrics.eu
## Dynatrace
dynatrace.com
## FamilySearch
familysearch.org
## Greasy Fork
greasyfork.org
## Online LaTeX Editor
@@ -311,6 +311,7 @@ wiki.gg
# Others
include:avaxhome
include:dlsite
include:espressif
include:familymart
include:fzdm

View File

@@ -180,10 +180,6 @@ wuyou.net # 无忧启动论坛
x-station.cn # X电站
znds.com # 智能电视网
# DCC Forum心跳文学部中文论坛
edgemonix.top # 图床
monika.love
423down.com # 423Down
acwifi.net # 路由器技术分享
appinn.com # 小众软件
@@ -491,9 +487,6 @@ hlgdata.com
huanleguang.com
ttxsapp.com.cn
xsbapp.cn
# 凯迪仕
juziwulian.com
kaadas.com
# Telecommunication
include:chinabroadnet
@@ -606,6 +599,7 @@ ycrx360.com
35.com
3533.com
360aiyi.com
360doc.com
360jq.com
360zhyx.com
365azw.com
@@ -1466,6 +1460,7 @@ youxigt.com
youzu.com
yoyojie.com
yoyou.com
ypppt.com
yrz.name
yslyhr.com
ysten.com

View File

@@ -8,7 +8,6 @@ icloud-content.com
icloud-isupport.com
icloud-sandbox.com
icloud.ch
icloud.cn @cn
icloud.com
icloud.com.cn @cn
icloud.de

View File

@@ -1,3 +0,0 @@
# Also known as "Illusion"
illgames.jp
japan-illgames.com

View File

@@ -1,3 +1,2 @@
# Dead: https://en.wikipedia.org/wiki/Illusion_(company)
illusion.co.jp
illusion.jp

View File

@@ -1,15 +1,13 @@
datalore.io
intellij.com
intellij.net
intellij.org
jb.gg
jetbrains.cloud
jetbrains.com
jetbrains.net
jetbrains.space
jetbrains.team
datalore.io
kotlinlang.org
youtrack.cloud
cdn.jetbrains.com @cn
download-cdn.jetbrains.com.cn @cn
jb.gg
youtrack.cloud

View File

@@ -1,3 +1,5 @@
esm.run
jsdelivr.com
jsdelivr.net
esm.run
full:cdn.jsdelivr.net

View File

@@ -11,6 +11,5 @@ cdn-service.space
cdn2cdn.com
cdn2site.com
pushbr.com # poster images CDN
smarttvcdn.online
regexp:(\w+)-static-[0-9]+\.cdntogo\.net$

1
data/knovel Normal file
View File

@@ -0,0 +1 @@
knovel.com

View File

@@ -9,7 +9,3 @@ max.ru
memealerts.com
oneme.ru
tamtam.chat
youla.io
youla.ru
full:youla-web-static.mrgcdn.ru

View File

@@ -1,7 +1,5 @@
missav.ai
missav.com
missav.live
missav.uno
missav.vip
missav.ws
missav123.com

View File

@@ -1,3 +0,0 @@
mixi.co.jp
mixi.jp
mixi.net

View File

@@ -1,5 +1,6 @@
include:firefox
include:mdn
include:rust
mozgcp.net
mozilla.com
@@ -23,10 +24,7 @@ seamonkey-project.org
thunderbird.net
# Mozilla Location Service
# * Overrided by above `mozilla.com`
# * In March 2024, Mozilla announced the project was being discontinued
#location.services.mozilla.com
location.services.mozilla.com
# Mozilla Push Service
# * Overrided by above `mozilla.com`
#push.services.mozilla.com
push.services.mozilla.com

1
data/nixos Normal file
View File

@@ -0,0 +1 @@
nixos.org

View File

@@ -1,6 +1,3 @@
ok.ru
okcdn.ru
mycdn.me
full:st-ok-pts.cdn-vk.ru
full:st-ok.cdn-vk.ru

1
data/osdn Normal file
View File

@@ -0,0 +1 @@
osdn.net

View File

@@ -2,5 +2,4 @@ perplexity.ai
perplexity.com
pplx.ai
full:ppl-ai-file-upload.s3.amazonaws.com
full:pplx-res.cloudinary.com

View File

@@ -1,14 +0,0 @@
# Plex Media Server domains
# Basic domains for Plex services
plex.com
plex.services
plex.tv
plexapp.com
# Note for Plex users
# * Plex's mechanism requires certain domains to go through a direct connection.
# * Using a proxy for these domains may cause the system to malfunction.
# * If you wish to access plex domains through a proxy, remember to ensure the following domains remain directly connected.
# * Related domains:
# plex.direct
# v4.plex.tv

View File

@@ -22,6 +22,7 @@ internal
# References: https://www.iana.org/assignments/locally-served-dns-zones/locally-served-dns-zones.xhtml
# https://www.rfc-editor.org/rfc/rfc6303.html
0.in-addr.arpa
2.0.192.in-addr.arpa
10.in-addr.arpa
16.172.in-addr.arpa
@@ -46,6 +47,7 @@ internal
168.192.in-addr.arpa
254.169.in-addr.arpa
255.255.255.255.in-addr.arpa
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
8.b.d.0.1.0.0.2.ip6.arpa
8.e.f.ip6.arpa

1
data/python-community Normal file
View File

@@ -0,0 +1 @@
piwheels.org

1
data/remirepo Normal file
View File

@@ -0,0 +1 @@
remirepo.net

View File

@@ -25,7 +25,6 @@ quotable.com
radian6.com
relateiq.com
salesforce-setup.com
salesforce-sites.com
salesforce.com
salesforce.org
salesforceiq.com

View File

@@ -19,9 +19,7 @@ samsungeshop.com.cn @cn
samsunggalaxyfriends.com
samsunghealth.com
samsungiotcloud.com
samsungiots.com
samsungknox.com
samsungosp.com
samsungqbe.com
samsungrs.com
smartthings.com

View File

@@ -19,14 +19,13 @@ th.weibo.com @!cn
tw.weibo.com @!cn
us.weibo.com @!cn
videoself.cn
wbimg.cn
wbimg.com
wbimg.cn
wcdn.cn
weibo.cn
weibo.com
weibo.com.cn
weibocdn.com
weibopay.com
xhaiwai.com
# Ads/tracking

View File

@@ -20,7 +20,6 @@ tiktokv.eu @!cn
tiktokv.us @!cn
tiktokw.eu @!cn
tiktokw.us @!cn
ttcdn-us.com @!cn
ttlivecdn.com @!cn
ttoverseaus.net @!cn
ttwstatic.com @!cn

1
data/topcoder Normal file
View File

@@ -0,0 +1 @@
topcoder.com

1
data/vim Normal file
View File

@@ -0,0 +1 @@
vim.org

View File

@@ -3,8 +3,6 @@ xhamster.desi
xhamster.xxx
xhamster18.com
xhamster18.desi
xhamster19.com
xhamster3.com
xhamsterlive.com
xhcdn.com

View File

@@ -53,10 +53,8 @@ yandexadexchange.net
yandexcloud.net
yandexcom.net
yandexmetrica.com
yandexwebcache.net
yandexwebcache.org
yastat.net
yastatic-net.ru
yastatic.net
# Watching movies, included in the Yandex subscription

201
main.go
View File

@@ -22,11 +22,18 @@ var (
exportLists = flag.String("exportlists", "", "Lists to be flattened and exported in plaintext format, separated by ',' comma")
)
var (
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 []string
Plain string
Affs []string
}
type Inclusion struct {
@@ -41,12 +48,6 @@ type ParsedList struct {
Entries []*Entry
}
type Processor struct {
plMap map[string]*ParsedList
finalMap map[string][]*Entry
cirIncMap map[string]bool
}
func makeProtoList(listName string, entries []*Entry) (*router.GeoSite, error) {
site := &router.GeoSite{
CountryCode: listName,
@@ -89,27 +90,29 @@ func writePlainList(listname string, entries []*Entry) error {
return w.Flush()
}
func parseEntry(line string) (*Entry, []string, error) {
entry := new(Entry)
func parseEntry(line string) (Entry, error) {
var entry Entry
parts := strings.Fields(line)
if len(parts) == 0 {
return entry, nil, fmt.Errorf("empty line")
return entry, fmt.Errorf("empty line")
}
// Parse type and value
typ, val, isTypeSpecified := strings.Cut(parts[0], ":")
typ = strings.ToLower(typ)
if !isTypeSpecified { // Default RuleType
if !validateDomainChars(typ) {
return entry, nil, fmt.Errorf("invalid domain: %q", typ)
v := parts[0]
colonIndex := strings.Index(v, ":")
if colonIndex == -1 {
entry.Type = dlc.RuleTypeDomain // Default type
entry.Value = strings.ToLower(v)
if !validateDomainChars(entry.Value) {
return entry, fmt.Errorf("invalid domain: %q", entry.Value)
}
entry.Type = dlc.RuleTypeDomain
entry.Value = typ
} else {
typ := strings.ToLower(v[:colonIndex])
val := v[colonIndex+1:]
switch typ {
case dlc.RuleTypeRegexp:
if _, err := regexp.Compile(val); err != nil {
return entry, nil, fmt.Errorf("invalid regexp %q: %w", val, err)
return entry, fmt.Errorf("invalid regexp %q: %w", val, err)
}
entry.Type = dlc.RuleTypeRegexp
entry.Value = val
@@ -117,42 +120,39 @@ func parseEntry(line string) (*Entry, []string, error) {
entry.Type = dlc.RuleTypeInclude
entry.Value = strings.ToUpper(val)
if !validateSiteName(entry.Value) {
return entry, nil, fmt.Errorf("invalid included list name: %q", entry.Value)
return entry, fmt.Errorf("invalid include list name: %q", entry.Value)
}
case dlc.RuleTypeDomain, dlc.RuleTypeFullDomain, dlc.RuleTypeKeyword:
entry.Type = typ
entry.Value = strings.ToLower(val)
if !validateDomainChars(entry.Value) {
return entry, nil, fmt.Errorf("invalid domain: %q", entry.Value)
return entry, fmt.Errorf("invalid domain: %q", entry.Value)
}
default:
return entry, nil, fmt.Errorf("invalid type: %q", typ)
return entry, fmt.Errorf("invalid type: %q", typ)
}
}
// Parse attributes and affiliations
var affs []string
for _, part := range parts[1:] {
switch part[0] {
case '@':
attr := strings.ToLower(part[1:])
if strings.HasPrefix(part, "@") {
attr := strings.ToLower(part[1:]) // Trim attribute prefix `@` character
if !validateAttrChars(attr) {
return entry, affs, fmt.Errorf("invalid attribute: %q", attr)
return entry, fmt.Errorf("invalid attribute: %q", attr)
}
entry.Attrs = append(entry.Attrs, attr)
case '&':
aff := strings.ToUpper(part[1:])
} else if strings.HasPrefix(part, "&") {
aff := strings.ToUpper(part[1:]) // Trim affiliation prefix `&` character
if !validateSiteName(aff) {
return entry, affs, fmt.Errorf("invalid affiliation: %q", aff)
return entry, fmt.Errorf("invalid affiliation: %q", aff)
}
affs = append(affs, aff)
default:
return entry, affs, fmt.Errorf("invalid attribute/affiliation: %q", part)
entry.Affs = append(entry.Affs, aff)
} else {
return entry, fmt.Errorf("invalid attribute/affiliation: %q", part)
}
}
if entry.Type != dlc.RuleTypeInclude {
slices.Sort(entry.Attrs) // Sort attributes
// Sort attributes
slices.Sort(entry.Attrs)
// Formated plain entry: type:domain.tld:@attr1,@attr2
var plain strings.Builder
plain.Grow(len(entry.Type) + len(entry.Value) + 10)
@@ -169,8 +169,8 @@ func parseEntry(line string) (*Entry, []string, error) {
plain.WriteString(attr)
}
entry.Plain = plain.String()
}
return entry, affs, nil
return entry, nil
}
func validateDomainChars(domain string) bool {
@@ -206,54 +206,62 @@ func validateSiteName(name string) bool {
return true
}
func (p *Processor) getOrCreateParsedList(name string) *ParsedList {
pl, exist := p.plMap[name]
if !exist {
pl = &ParsedList{Name: name}
p.plMap[name] = pl
}
return pl
}
func (p *Processor) loadData(listName string, path string) error {
func loadData(path string) ([]*Entry, error) {
file, err := os.Open(path)
if err != nil {
return err
return nil, err
}
defer file.Close()
pl := p.getOrCreateParsedList(listName)
var entries []*Entry
scanner := bufio.NewScanner(file)
lineIdx := 0
for scanner.Scan() {
line := scanner.Text()
lineIdx++
line, _, _ := strings.Cut(scanner.Text(), "#") // Remove comments
if idx := strings.Index(line, "#"); idx != -1 {
line = line[:idx] // Remove comments
}
line = strings.TrimSpace(line)
if line == "" {
continue
}
entry, affs, err := parseEntry(line)
entry, err := parseEntry(line)
if err != nil {
return fmt.Errorf("error in %q at line %d: %w", path, lineIdx, err)
return entries, fmt.Errorf("error in %q at line %d: %w", path, lineIdx, err)
}
entries = append(entries, &entry)
}
return entries, nil
}
func parseList(refName string, refList []*Entry) error {
pl, _ := plMap[refName]
if pl == nil {
pl = &ParsedList{Name: refName}
plMap[refName] = pl
}
for _, entry := range refList {
if entry.Type == dlc.RuleTypeInclude {
if len(entry.Affs) != 0 {
return fmt.Errorf("affiliation is not allowed for include:%q", entry.Value)
}
inc := &Inclusion{Source: entry.Value}
for _, attr := range entry.Attrs {
if attr[0] == '-' {
inc.BanAttrs = append(inc.BanAttrs, attr[1:])
if strings.HasPrefix(attr, "-") {
inc.BanAttrs = append(inc.BanAttrs, attr[1:]) // Trim attribute prefix `-` character
} else {
inc.MustAttrs = append(inc.MustAttrs, attr)
}
}
for _, aff := range affs {
apl := p.getOrCreateParsedList(aff)
apl.Inclusions = append(apl.Inclusions, inc)
}
pl.Inclusions = append(pl.Inclusions, inc)
} else {
for _, aff := range affs {
apl := p.getOrCreateParsedList(aff)
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)
@@ -263,6 +271,9 @@ func (p *Processor) loadData(listName string, path string) error {
}
func isMatchAttrFilters(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
}
@@ -285,7 +296,9 @@ func polishList(roughMap map[string]*Entry) []*Entry {
domainsMap := make(map[string]bool)
for _, entry := range roughMap {
switch entry.Type { // Bypass regexp, keyword and "full/domain with attr"
case dlc.RuleTypeRegexp, dlc.RuleTypeKeyword:
case dlc.RuleTypeRegexp:
finalList = append(finalList, entry)
case dlc.RuleTypeKeyword:
finalList = append(finalList, entry)
case dlc.RuleTypeDomain:
domainsMap[entry.Value] = true
@@ -310,11 +323,11 @@ func polishList(roughMap map[string]*Entry) []*Entry {
pd = "." + pd // So that `domain:example.org` overrides `full:example.org`
}
for {
var hasParent bool
_, pd, hasParent = strings.Cut(pd, ".") // Go for next parent
if !hasParent {
idx := strings.Index(pd, ".")
if idx == -1 {
break
}
pd = pd[idx+1:] // Go for next parent
if domainsMap[pd] {
isRedundant = true
break
@@ -331,36 +344,36 @@ func polishList(roughMap map[string]*Entry) []*Entry {
return finalList
}
func (p *Processor) resolveList(plname string) error {
if _, pldone := p.finalMap[plname]; pldone {
func resolveList(pl *ParsedList) error {
if _, pldone := finalMap[pl.Name]; pldone {
return nil
}
pl, plexist := p.plMap[plname]
if !plexist {
return fmt.Errorf("list %q not found", plname)
if cirIncMap[pl.Name] {
return fmt.Errorf("circular inclusion in: %q", pl.Name)
}
if p.cirIncMap[plname] {
return fmt.Errorf("circular inclusion in: %q", plname)
}
p.cirIncMap[plname] = true
defer delete(p.cirIncMap, plname)
cirIncMap[pl.Name] = true
defer delete(cirIncMap, pl.Name)
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 { // Add included entries
if err := p.resolveList(inc.Source); err != nil {
return fmt.Errorf("failed to resolve inclusion %q: %w", inc.Source, err)
for _, inc := range pl.Inclusions {
incPl, exist := plMap[inc.Source]
if !exist {
return fmt.Errorf("list %q includes a non-existent list: %q", pl.Name, inc.Source)
}
isFullInc := len(inc.MustAttrs) == 0 && len(inc.BanAttrs) == 0
for _, ientry := range p.finalMap[inc.Source] {
if isFullInc || isMatchAttrFilters(ientry, inc) {
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
}
}
}
p.finalMap[plname] = polishList(roughMap)
finalMap[pl.Name] = polishList(roughMap)
return nil
}
@@ -368,8 +381,8 @@ func run() error {
dir := *dataPath
fmt.Printf("using domain lists data in %q\n", dir)
// Generate plMap
processor := &Processor{plMap: make(map[string]*ParsedList)}
// Generate refMap
refMap := make(map[string][]*Entry)
err := filepath.WalkDir(dir, func(path string, d os.DirEntry, err error) error {
if err != nil {
return err
@@ -381,16 +394,23 @@ func run() error {
if !validateSiteName(listName) {
return fmt.Errorf("invalid list name: %q", listName)
}
return processor.loadData(listName, path)
refMap[listName], err = loadData(path)
return err
})
if err != nil {
return fmt.Errorf("failed to loadData: %w", err)
}
// Generate plMap
for refName, refList := range refMap {
if err := parseList(refName, refList); err != nil {
return fmt.Errorf("failed to parseList %q: %w", refName, err)
}
}
// Generate finalMap
processor.finalMap = make(map[string][]*Entry, len(processor.plMap))
processor.cirIncMap = make(map[string]bool)
for plname := range processor.plMap {
if err := processor.resolveList(plname); err != nil {
for plname, pl := range plMap {
if err := resolveList(pl); err != nil {
return fmt.Errorf("failed to resolveList %q: %w", plname, err)
}
}
@@ -399,10 +419,11 @@ func run() error {
if err := os.MkdirAll(*outputDir, 0755); err != nil {
return fmt.Errorf("failed to create output directory: %w", err)
}
// Export plaintext lists
// Export plaintext list
for rawEpList := range strings.SplitSeq(*exportLists, ",") {
if epList := strings.TrimSpace(rawEpList); epList != "" {
entries, exist := processor.finalMap[strings.ToUpper(epList)]
entries, exist := finalMap[strings.ToUpper(epList)]
if !exist || len(entries) == 0 {
fmt.Printf("list %q does not exist or is empty\n", epList)
continue
@@ -417,7 +438,7 @@ func run() error {
// Generate dat file
protoList := new(router.GeoSiteList)
for siteName, siteEntries := range processor.finalMap {
for siteName, siteEntries := range finalMap {
site, err := makeProtoList(siteName, siteEntries)
if err != nil {
return fmt.Errorf("failed to makeProtoList %q: %w", siteName, err)