Compare commits

..

28 Commits

Author SHA1 Message Date
MkQtS
b119839e7d icloud: add icloud.cn (#3322) 2026-03-03 17:49:33 +08:00
Minwe LUO
a335e24269 category-ai-!cn: add diabrowser.engineering for Dia login (#3321) 2026-03-03 17:19:23 +08:00
wakesend
d9d97a7132 Porn updates (#3313)
- illusion is dead. remove it from other categories
- dlsite is included in both category-entertainment and category-porn, no need to include it in geolocation-!cn
- dlsite: add dlaf.jp
- add illgames
- create category-urlshortner
2026-03-03 17:16:58 +08:00
ᡠᠵᡠᡳ ᡠᠵᡠ ᠮᠠᠨᡩ᠋ᠠᠨ
deb950bb2b remove :: and 0.0.0.0 (#2780) 2026-03-02 23:47:20 +08:00
EvanLiu2000
be2ec83092 category-porn: add more domains (#3320) 2026-03-02 21:29:45 +08:00
MkQtS
6b16be4020 category-social-media-!cn: add some mastodon domains (#3318) 2026-03-02 14:48:30 +08:00
MkQtS
42aafe324e main.go: optimize attr filter (#3317)
[skip ci]
2026-03-02 14:15:40 +08:00
0-Kutya-0
882f48e486 category-ip-geo-detect: add check-host.net (#3316) 2026-03-02 13:53:25 +08:00
Ivan
614b291120 category-ru: add mil.ru (#3315)
Ministry of Defense of the Russian Federation

Co-authored-by: karspls <iaplekh@gmail.com>
2026-03-02 13:51:03 +08:00
grill-glitch
2b3211df98 geolocation-cn: add monika.love and edgemonix.top (#3314) 2026-03-02 13:43:57 +08:00
direnquanbuKO
71e31ba221 apple: mark more sub domains with cn attr (#3312)
Apple Music API endpoints
2026-02-27 17:35:44 +08:00
MkQtS
b11bfaa138 sina: add weibopay.com (#3311) 2026-02-27 13:11:31 +08:00
MkQtS
afb9e6cad0 main.go: clean up (#3310)
[skip ci]
2026-02-27 13:09:18 +08:00
Konstantin
5f7c4aa60a yandex: add yandexwebcache.net (#3308) 2026-02-27 13:03:46 +08:00
Nikita Ugnich
48eb616779 perplexity: add ppl-ai-file-upload.s3.amazonaws.com (#3307) 2026-02-27 13:02:30 +08:00
Ivan
d57e3b3f45 category-gov-ru: add general radio frequency center domain (#3306)
Co-authored-by: Ivan Plekhanov <iaplekh@gmail.com>
2026-02-27 13:00:09 +08:00
dependabot[bot]
c308e3430d Chore: bump actions/upload-artifact from 6 to 7 (#3309)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 12:10:39 +08:00
MkQtS
9a46bff5f3 amazon: add more domains (#3304)
* aws: add awswaf.com

Close https://github.com/v2fly/domain-list-community/issues/3303

* amazon: add more domains

source: https://crt.sh/?id=23663232392

* amazon: add more domains

source: https://crt.sh/?id=22217736606
2026-02-25 14:18:09 +08:00
MkQtS
051556734c category-dev: add packagecloud.io (#3302) 2026-02-24 16:45:44 +08:00
wakesend
8829b0ea28 Add mixi (#3299) 2026-02-24 16:37:58 +08:00
Konstantin
a201aae131 category-ru: add t1.cloud and yclients.com; kinopub: add smarttvcdn.online (#3298) 2026-02-24 16:25:50 +08:00
sergeevms
2c661d32b6 Update salesforce (#3295) 2026-02-20 18:21:58 +08:00
MkQtS
1be2a927c0 category-cryptocurrency: add blockchain.com (#3294) 2026-02-20 16:30:41 +08:00
EvanLiu2000
3490c96b46 Update category-porn (#3291) 2026-02-20 16:27:57 +08:00
allkeltysss
8ae86bbb4a yandex: add yastatic-net.ru (#3293) 2026-02-20 16:16:51 +08:00
MkQtS
db9c0fe466 main.go: improve codes (#3290) 2026-02-19 17:24:13 +08:00
Konstantin
109a50f048 Add more ru bank/financial domains (#3264) 2026-02-19 14:36:27 +08:00
EvanLiu2000
b258a6594e Update missav & category-porn (#3289) 2026-02-19 14:30:57 +08:00
33 changed files with 197 additions and 174 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -33,6 +33,7 @@ chutes.ai
copilot.microsoft.com copilot.microsoft.com
devin.ai devin.ai
diabrowser.com diabrowser.com
diabrowser.engineering
dify.ai dify.ai
duck.ai duck.ai
gateway.ai.cloudflare.com gateway.ai.cloudflare.com

View File

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

View File

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

View File

@@ -123,6 +123,7 @@ notepad-plus-plus.org
openresty.org openresty.org
openssl.org openssl.org
opensuse.org opensuse.org
packagecloud.io
packagist.org packagist.org
pcre.org pcre.org
phantomjs.org phantomjs.org

View File

@@ -13,7 +13,7 @@ include:gaijin
include:garena include:garena
include:gog include:gog
include:hoyoverse include:hoyoverse
include:illusion # Dead include:illusion
include:itchio include:itchio
include:lowiro include:lowiro
include:modrinth include:modrinth

View File

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

View File

@@ -3,6 +3,7 @@
2ip.ua 2ip.ua
abstractapi.com abstractapi.com
bigdatacloud.net bigdatacloud.net
check-host.net
db-ip.com db-ip.com
extreme-ip-lookup.com extreme-ip-lookup.com
fraudguard.io fraudguard.io

View File

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

View File

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

View File

@@ -6,9 +6,19 @@ include:instagram
include:linkedin include:linkedin
include:mailru include:mailru
include:misskey include:misskey
include:mixi
include:ok include:ok
include:threads include:threads
include:twitter include:twitter
include:vk include:vk
truthsocial.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

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

View File

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

View File

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

View File

@@ -1,8 +1,5 @@
# This list contains domains that don't have access point in China mainland. This is opposite to geolocation-cn. # 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 # AI Chat
include:category-ai-!cn include:category-ai-!cn
@@ -159,6 +156,7 @@ include:category-enhance-gaming
include:category-mobile-repair include:category-mobile-repair
include:category-ntp include:category-ntp
include:category-password-management include:category-password-management
include:category-urlshortner
include:category-web-archive include:category-web-archive
include:decryptipastore # iOS include:decryptipastore # iOS
@@ -173,7 +171,6 @@ include:addtoany
include:adguard include:adguard
include:aptoide include:aptoide
include:arphic include:arphic
include:bitly
include:blender include:blender
include:brightcove include:brightcove
include:buymeacoffee include:buymeacoffee
@@ -227,7 +224,6 @@ include:sb
include:setapp include:setapp
include:sharethis include:sharethis
include:shopify include:shopify
include:shorturl
include:slideshare include:slideshare
include:sourceforge include:sourceforge
include:squareup include:squareup
@@ -237,7 +233,6 @@ include:svp
include:test-ipv6 include:test-ipv6
include:tex include:tex
include:tidelift include:tidelift
include:tinyurl
include:trello include:trello
include:tumblr include:tumblr
include:tutanota include:tutanota
@@ -311,7 +306,6 @@ wiki.gg
# Others # Others
include:avaxhome include:avaxhome
include:dlsite
include:espressif include:espressif
include:familymart include:familymart
include:fzdm include:fzdm

View File

@@ -180,6 +180,10 @@ wuyou.net # 无忧启动论坛
x-station.cn # X电站 x-station.cn # X电站
znds.com # 智能电视网 znds.com # 智能电视网
# DCC Forum心跳文学部中文论坛
edgemonix.top # 图床
monika.love
423down.com # 423Down 423down.com # 423Down
acwifi.net # 路由器技术分享 acwifi.net # 路由器技术分享
appinn.com # 小众软件 appinn.com # 小众软件

View File

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

3
data/illgames Normal file
View File

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

View File

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

View File

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

View File

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

3
data/mixi Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

231
main.go
View File

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