mirror of
https://github.com/v2fly/domain-list-community.git
synced 2025-12-21 01:50:05 +07:00
Compare commits
15 Commits
2025121211
...
2025121616
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8bd29ce92 | ||
|
|
72eb885658 | ||
|
|
93bfcfd142 | ||
|
|
cbe19f0562 | ||
|
|
ea99bef4a2 | ||
|
|
9b01521761 | ||
|
|
8d50851b58 | ||
|
|
16923730a4 | ||
|
|
7e3137a0d1 | ||
|
|
6b4c09860b | ||
|
|
6a11042b92 | ||
|
|
5a2d4ca56a | ||
|
|
22997b1833 | ||
|
|
182647ca79 | ||
|
|
c40fdf359e |
2
.github/workflows/test-pr.yml
vendored
2
.github/workflows/test-pr.yml
vendored
@@ -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@v5
|
uses: actions/upload-artifact@v6
|
||||||
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
|
||||||
|
|||||||
36
data/18comic
36
data/18comic
@@ -5,11 +5,47 @@
|
|||||||
18comic.company
|
18comic.company
|
||||||
18comic.org
|
18comic.org
|
||||||
18comic.vip
|
18comic.vip
|
||||||
|
asjmapihost.cc
|
||||||
|
cdnblackmyth.club
|
||||||
|
cdnmhws.cc
|
||||||
|
cdnmhwscc.vip
|
||||||
|
cdnuc.vip
|
||||||
|
cdnxxx-proxy.co
|
||||||
|
cdnxxx-proxy.xyz
|
||||||
|
jm-comic2.cc
|
||||||
|
jm18c-bbm.cc
|
||||||
|
jm18c-bbm.net
|
||||||
|
jm18c-uoi.net
|
||||||
|
jm365.work
|
||||||
|
jm365.xyz
|
||||||
|
jmapibranch1.cc
|
||||||
|
jmapibranch2.cc
|
||||||
|
jmapibranch3.cc
|
||||||
|
jmapinode.biz
|
||||||
|
jmapinode.vip
|
||||||
|
jmapinode.xyz
|
||||||
|
jmapinode1.top
|
||||||
|
jmapinode2.top
|
||||||
|
jmapinode3.top
|
||||||
|
jmapinodeudzn.net
|
||||||
|
jmapinodeudzn.xyz
|
||||||
|
jmapiproxy1.cc
|
||||||
|
jmapiproxy1.monster
|
||||||
|
jmapiproxy2.cc
|
||||||
|
jmapiproxy3.cc
|
||||||
|
jmapiproxy4.cc
|
||||||
|
jmapiproxyxxx.vip
|
||||||
|
jmcomic.group
|
||||||
jmcomic.ltd
|
jmcomic.ltd
|
||||||
jmcomic.me
|
jmcomic.me
|
||||||
jmcomic.mobi
|
jmcomic.mobi
|
||||||
jmcomic.moe
|
jmcomic.moe
|
||||||
|
jmcomic.rocks
|
||||||
|
jmcomic-fb.vip
|
||||||
|
jmcomic-zzz.one
|
||||||
|
jmcomic-zzz.org
|
||||||
jmcomic1.city
|
jmcomic1.city
|
||||||
jmcomic1.me
|
jmcomic1.me
|
||||||
jmcomic1.mobi
|
jmcomic1.mobi
|
||||||
|
jmcomic1.rocks
|
||||||
jmcomic2.moe
|
jmcomic2.moe
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
include:amap-ads
|
||||||
include:youku-ads
|
include:youku-ads
|
||||||
|
|
||||||
a.alimama.cn @ads
|
a.alimama.cn @ads
|
||||||
@@ -10,7 +11,6 @@ adash.man.aliyuncs.com @ads
|
|||||||
adashbc.m.taobao.com @ads
|
adashbc.m.taobao.com @ads
|
||||||
adashbc.ut.taobao.com @ads
|
adashbc.ut.taobao.com @ads
|
||||||
adashx.m.taobao.com @ads
|
adashx.m.taobao.com @ads
|
||||||
adashx.ut.amap.com @ads
|
|
||||||
adashx.ut.ele.me @ads
|
adashx.ut.ele.me @ads
|
||||||
adashx4ae.ut.taobao.com @ads
|
adashx4ae.ut.taobao.com @ads
|
||||||
adashx4yt.m.taobao.com @ads
|
adashx4yt.m.taobao.com @ads
|
||||||
@@ -38,7 +38,6 @@ retcode.taobao.com @ads
|
|||||||
tce.alicdn.com @ads
|
tce.alicdn.com @ads
|
||||||
tns.simba.taobao.com @ads
|
tns.simba.taobao.com @ads
|
||||||
track.lc.quark.cn @ads
|
track.lc.quark.cn @ads
|
||||||
v6-adashx.ut.amap.com @ads
|
|
||||||
v6-adashx.ut.cainiao.com @ads
|
v6-adashx.ut.cainiao.com @ads
|
||||||
v6-adashx.ut.ele.me @ads
|
v6-adashx.ut.ele.me @ads
|
||||||
v6-adashx.ut.taobao.com @ads
|
v6-adashx.ut.taobao.com @ads
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
include:amap-ads
|
||||||
|
|
||||||
a-map.cn
|
a-map.cn
|
||||||
a-map.co
|
a-map.co
|
||||||
a-map.link
|
a-map.link
|
||||||
|
|||||||
5
data/amap-ads
Normal file
5
data/amap-ads
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
adashx.ut.amap.com @ads
|
||||||
|
dualstack-logs.amap.com @ads
|
||||||
|
logs.amap.com @ads
|
||||||
|
optimus-ads.amap.com @ads
|
||||||
|
v6-adashx.ut.amap.com @ads
|
||||||
@@ -30,6 +30,7 @@ include:kuaishou-ads
|
|||||||
include:kugou-ads
|
include:kugou-ads
|
||||||
include:letv-ads
|
include:letv-ads
|
||||||
include:meta-ads
|
include:meta-ads
|
||||||
|
include:microsoft-ads
|
||||||
include:mopub-ads
|
include:mopub-ads
|
||||||
include:mxplayer-ads
|
include:mxplayer-ads
|
||||||
include:netease-ads
|
include:netease-ads
|
||||||
@@ -37,6 +38,7 @@ include:newrelic-ads
|
|||||||
include:ogury-ads
|
include:ogury-ads
|
||||||
include:ookla-speedtest-ads
|
include:ookla-speedtest-ads
|
||||||
include:openx-ads
|
include:openx-ads
|
||||||
|
include:picacg-ads
|
||||||
include:pocoiq-ads
|
include:pocoiq-ads
|
||||||
include:pubmatic-ads
|
include:pubmatic-ads
|
||||||
include:qihoo360-ads
|
include:qihoo360-ads
|
||||||
@@ -57,7 +59,7 @@ include:xhamster-ads
|
|||||||
include:xiaomi-ads
|
include:xiaomi-ads
|
||||||
include:ximalaya-ads
|
include:ximalaya-ads
|
||||||
include:yahoo-ads
|
include:yahoo-ads
|
||||||
include:youku-ads
|
include:zhihu-ads
|
||||||
|
|
||||||
# Other domains for ads serving
|
# Other domains for ads serving
|
||||||
51.la
|
51.la
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ diabrowser.com
|
|||||||
dify.ai
|
dify.ai
|
||||||
duck.ai
|
duck.ai
|
||||||
gateway.ai.cloudflare.com
|
gateway.ai.cloudflare.com
|
||||||
|
kiro.dev
|
||||||
meta.ai
|
meta.ai
|
||||||
mistral.ai
|
mistral.ai
|
||||||
openart.ai
|
openart.ai
|
||||||
|
|||||||
@@ -53,6 +53,11 @@ qgzb.net
|
|||||||
zbbm.gov.cn
|
zbbm.gov.cn
|
||||||
zbbm.net
|
zbbm.net
|
||||||
|
|
||||||
|
# 中国考试教育网
|
||||||
|
# 京ICP备05064772号
|
||||||
|
neea.cn
|
||||||
|
# neea.edu.cn
|
||||||
|
|
||||||
# 云校
|
# 云校
|
||||||
91yunxiao.com
|
91yunxiao.com
|
||||||
# 爱云校/好分数
|
# 爱云校/好分数
|
||||||
|
|||||||
@@ -23,5 +23,6 @@ include:mailru-group
|
|||||||
include:okko
|
include:okko
|
||||||
include:ozon
|
include:ozon
|
||||||
include:rutube
|
include:rutube
|
||||||
|
include:wink
|
||||||
include:x5
|
include:x5
|
||||||
include:yandex
|
include:yandex
|
||||||
|
|||||||
69
data/ctyun
Normal file
69
data/ctyun
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# 天翼云
|
||||||
|
# 京ICP备2021034386号
|
||||||
|
ctadns.cn
|
||||||
|
bjctyiptv.cn
|
||||||
|
cqctyiptv.cn
|
||||||
|
ctacdn.cn
|
||||||
|
ctaigw.cn
|
||||||
|
ctbcdn.com
|
||||||
|
ctcdn.cn
|
||||||
|
ctcdn.com.cn
|
||||||
|
ctcdnov.net
|
||||||
|
ctcloudzos.cn
|
||||||
|
ctcns.cn
|
||||||
|
ctdcdn.com
|
||||||
|
ctdns.cn
|
||||||
|
ctdns.com.cn
|
||||||
|
ctdns.net
|
||||||
|
ctecdn.cn
|
||||||
|
ctecx.cn
|
||||||
|
ctgcdn.com
|
||||||
|
cthcdn.cn
|
||||||
|
cthcdn.com
|
||||||
|
cthcdn.net
|
||||||
|
ctlcdn.cn
|
||||||
|
ctlcdn.com
|
||||||
|
ctlcdn.net
|
||||||
|
ctmcdn.cn
|
||||||
|
ctovcdn.com
|
||||||
|
ctrender.com
|
||||||
|
ctwcdn.cn
|
||||||
|
ctxcdn.cn
|
||||||
|
ctxcdn.com
|
||||||
|
ctxcdn.net
|
||||||
|
ctxirang.cn
|
||||||
|
ctxirang.com
|
||||||
|
ctycdn.cn
|
||||||
|
ctycdn.net
|
||||||
|
ctycdn.net.cn
|
||||||
|
ctydoh.cn
|
||||||
|
ctyecx.cn
|
||||||
|
ctyiptv.cn
|
||||||
|
ctyun.cn
|
||||||
|
ctyun.com.cn
|
||||||
|
ctyuncdn.cn
|
||||||
|
ctyuncs.cn
|
||||||
|
ctyuninner.com
|
||||||
|
ctyunmds.cn
|
||||||
|
ctyunwaf.cn
|
||||||
|
ctyunwaf.com
|
||||||
|
ctyunwaf1.com
|
||||||
|
ctyunwaf3.cn
|
||||||
|
ctyunxs.cn
|
||||||
|
ctyunzos.cn
|
||||||
|
ctzcdn.cn
|
||||||
|
ctzcdn.com
|
||||||
|
edgecloudx.cn
|
||||||
|
faasapp.cn
|
||||||
|
faasdev.cn
|
||||||
|
fjctyiptv.cn
|
||||||
|
gdctyiptv.cn
|
||||||
|
gsctyiptv.cn
|
||||||
|
gsjtyiptv.cn
|
||||||
|
gzctyiptv.cn
|
||||||
|
jsctyiptv.cn
|
||||||
|
modelers.cn
|
||||||
|
scctyiptv.cn
|
||||||
|
snctyiptv.cn
|
||||||
|
ynctyiptv.cn
|
||||||
|
ynjtyiptv.cn
|
||||||
@@ -54,6 +54,7 @@ include:aws-cn
|
|||||||
include:baishancloud
|
include:baishancloud
|
||||||
include:bootcdn
|
include:bootcdn
|
||||||
include:cloudflare-cn
|
include:cloudflare-cn
|
||||||
|
include:ctyun
|
||||||
include:dwion
|
include:dwion
|
||||||
include:maocloud
|
include:maocloud
|
||||||
include:qingcloud
|
include:qingcloud
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ partnerad.l.google.com @ads
|
|||||||
urchin.com @ads
|
urchin.com @ads
|
||||||
|
|
||||||
full:analytics.google.com @ads
|
full:analytics.google.com @ads
|
||||||
full:fundingchoicesmessages.google.com @ads
|
# https://github.com/AdguardTeam/FiltersRegistry/pull/1154
|
||||||
|
# full:fundingchoicesmessages.google.com @ads
|
||||||
|
|
||||||
regexp:^adservice\.google\.([a-z]{2}|com?)(\.[a-z]{2})?$ @ads
|
regexp:^adservice\.google\.([a-z]{2}|com?)(\.[a-z]{2})?$ @ads
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
include:azure
|
include:azure
|
||||||
include:bing
|
include:bing
|
||||||
include:github
|
include:github
|
||||||
|
include:microsoft-ads
|
||||||
include:microsoft-dev
|
include:microsoft-dev
|
||||||
include:microsoft-pki
|
include:microsoft-pki
|
||||||
include:msn
|
include:msn
|
||||||
@@ -83,7 +84,6 @@ c-msedge.net
|
|||||||
centralvalidation.com
|
centralvalidation.com
|
||||||
ch9.ms
|
ch9.ms
|
||||||
charticulator.com
|
charticulator.com
|
||||||
clarity.ms @ads
|
|
||||||
cloudapp.net
|
cloudapp.net
|
||||||
cloudappsecurity.com
|
cloudappsecurity.com
|
||||||
cortanaanalytics.com
|
cortanaanalytics.com
|
||||||
@@ -147,7 +147,6 @@ microsoft-sbs-domains.com
|
|||||||
microsoft-smb.cn @cn
|
microsoft-smb.cn @cn
|
||||||
microsoft365.com
|
microsoft365.com
|
||||||
microsoftaccountguard.com
|
microsoftaccountguard.com
|
||||||
microsoftads.com @ads
|
|
||||||
microsoftadvertising.com
|
microsoftadvertising.com
|
||||||
microsoftadvertisingregionalawards.com
|
microsoftadvertisingregionalawards.com
|
||||||
microsoftaffiliates.com
|
microsoftaffiliates.com
|
||||||
@@ -189,7 +188,6 @@ morphcharts.com
|
|||||||
mpnevolution.com
|
mpnevolution.com
|
||||||
ms-studiosmedia.com
|
ms-studiosmedia.com
|
||||||
ms365surfaceoffer.com
|
ms365surfaceoffer.com
|
||||||
msads.net @ads
|
|
||||||
msauth.cn @cn
|
msauth.cn @cn
|
||||||
msauth.net
|
msauth.net
|
||||||
msauthimages.cn @cn
|
msauthimages.cn @cn
|
||||||
@@ -216,7 +214,6 @@ msra.cn @cn
|
|||||||
msturing.org
|
msturing.org
|
||||||
msudalosti.com
|
msudalosti.com
|
||||||
mymicrosoft.com
|
mymicrosoft.com
|
||||||
nelreports.net @ads
|
|
||||||
nextechafrica.net
|
nextechafrica.net
|
||||||
nxta.org
|
nxta.org
|
||||||
o365cn.com @cn
|
o365cn.com @cn
|
||||||
|
|||||||
6
data/microsoft-ads
Normal file
6
data/microsoft-ads
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
browser.events.data.msn.cn @ads
|
||||||
|
browser.events.data.msn.com @ads
|
||||||
|
clarity.ms @ads
|
||||||
|
microsoftads.com @ads
|
||||||
|
msads.net @ads
|
||||||
|
nelreports.net @ads
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
include:hoyoverse
|
include:hoyoverse
|
||||||
include:mihoyo-cn
|
include:mihoyo-cn
|
||||||
|
|
||||||
|
include:mihoyo-ads
|
||||||
|
|||||||
2
data/mihoyo-ads
Normal file
2
data/mihoyo-ads
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
log-upload-os.hoyoverse.com @ads
|
||||||
|
log-upload.mihoyo.com @ads
|
||||||
@@ -13,3 +13,6 @@ webtest.net
|
|||||||
full:www.speedtest.net.cdn.cloudflare.net
|
full:www.speedtest.net.cdn.cloudflare.net
|
||||||
|
|
||||||
include:ookla-speedtest-ads
|
include:ookla-speedtest-ads
|
||||||
|
|
||||||
|
# SpeedTest Node
|
||||||
|
ookla-speedtest-central.hgconair.hgc.com.hk # HGC Global Communications 香港環電
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
include:picacg-ads
|
||||||
|
|
||||||
bikaa.xyz
|
bikaa.xyz
|
||||||
bikac.xyz
|
bikac.xyz
|
||||||
bikaios.xyz
|
bikaios.xyz
|
||||||
@@ -8,3 +10,7 @@ picacn.xyz
|
|||||||
picacomic.com
|
picacomic.com
|
||||||
picacomic.xyz
|
picacomic.xyz
|
||||||
wikawika.xyz
|
wikawika.xyz
|
||||||
|
|
||||||
|
# Image Resource Domain like `img.diwodiwo.xyz` `s3.diwodiwo.xyz` `storage.diwodiwo.xyz` `storage-b.diwodiwo.xyz`
|
||||||
|
diwodiwo.xyz
|
||||||
|
|
||||||
|
|||||||
2
data/picacg-ads
Normal file
2
data/picacg-ads
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
full:ad-channel.diwodiwo.xyz @ads
|
||||||
|
full:ad-display.diwodiwo.xyz @ads
|
||||||
@@ -19,6 +19,7 @@ adsview.qq.com @ads
|
|||||||
adsview2.qq.com @ads
|
adsview2.qq.com @ads
|
||||||
adv.app.qq.com @ads
|
adv.app.qq.com @ads
|
||||||
adver.qq.com @ads
|
adver.qq.com @ads
|
||||||
|
badjs.weixinbridge.com @ads
|
||||||
beacon.cdn.qq.com @ads
|
beacon.cdn.qq.com @ads
|
||||||
beacon.qq.com @ads
|
beacon.qq.com @ads
|
||||||
beaconcdn.qq.com @ads
|
beaconcdn.qq.com @ads
|
||||||
|
|||||||
@@ -1,5 +1,25 @@
|
|||||||
|
aaid.umeng.com @ads
|
||||||
alog.umeng.com @ads
|
alog.umeng.com @ads
|
||||||
alog.umengcloud.com @ads
|
alog.umengcloud.com @ads
|
||||||
|
alogs.umeng.com @ads
|
||||||
|
alogus.umeng.com @ads
|
||||||
|
ar.umeng.com @ads
|
||||||
|
aspect-upush.umeng.com @ads
|
||||||
|
audid.umeng.com @ads
|
||||||
|
ccs.umeng.com @ads
|
||||||
|
cnlogs.umeng.com @ads
|
||||||
|
cnlogs.umengcloud.com @ads
|
||||||
|
# https://github.com/TG-Twilight/AWAvenue-Ads-Rule/issues/185
|
||||||
|
# errlog.umeng.com @ads
|
||||||
|
# errnewlog.umeng.com @ads
|
||||||
|
new-aaid.umeng.com @ads
|
||||||
|
new-aaid.umeng.com.gds.alibabadns.com @ads
|
||||||
|
oc.umeng.com @ads
|
||||||
|
plbslog.umeng.com @ads
|
||||||
|
resolve.umeng.com @ads
|
||||||
|
ulogs.umeng.com @ads
|
||||||
|
ulogs.umengcloud.com @ads
|
||||||
|
utoken.umeng.com @ads
|
||||||
|
|
||||||
# CNZZ
|
# CNZZ
|
||||||
w.cnzz.com @ads
|
w.cnzz.com @ads
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
|
include:zhihu-ads
|
||||||
|
|
||||||
zhihu.com
|
zhihu.com
|
||||||
zhimg.com
|
zhimg.com
|
||||||
|
|||||||
2
data/zhihu-ads
Normal file
2
data/zhihu-ads
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
crash2.zhihu.com @ads
|
||||||
|
zhihu-web-analytics.zhihu.com @ads
|
||||||
38
main.go
38
main.go
@@ -7,6 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -22,6 +23,14 @@ 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")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
RuleTypeDomain string = "domain"
|
||||||
|
RuleTypeFullDomain string = "full"
|
||||||
|
RuleTypeKeyword string = "keyword"
|
||||||
|
RuleTypeRegexp string = "regexp"
|
||||||
|
RuleTypeInclude string = "include"
|
||||||
|
)
|
||||||
|
|
||||||
type Entry struct {
|
type Entry struct {
|
||||||
Type string
|
Type string
|
||||||
Value string
|
Value string
|
||||||
@@ -64,30 +73,39 @@ func (l *ParsedList) toProto() (*router.GeoSite, error) {
|
|||||||
}
|
}
|
||||||
for _, entry := range l.Entry {
|
for _, entry := range l.Entry {
|
||||||
switch entry.Type {
|
switch entry.Type {
|
||||||
case "domain":
|
case RuleTypeDomain:
|
||||||
site.Domain = append(site.Domain, &router.Domain{
|
site.Domain = append(site.Domain, &router.Domain{
|
||||||
Type: router.Domain_RootDomain,
|
Type: router.Domain_RootDomain,
|
||||||
Value: entry.Value,
|
Value: entry.Value,
|
||||||
Attribute: entry.Attrs,
|
Attribute: entry.Attrs,
|
||||||
})
|
})
|
||||||
case "regexp":
|
|
||||||
|
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{
|
site.Domain = append(site.Domain, &router.Domain{
|
||||||
Type: router.Domain_Regex,
|
Type: router.Domain_Regex,
|
||||||
Value: entry.Value,
|
Value: entry.Value,
|
||||||
Attribute: entry.Attrs,
|
Attribute: entry.Attrs,
|
||||||
})
|
})
|
||||||
case "keyword":
|
|
||||||
|
case RuleTypeKeyword:
|
||||||
site.Domain = append(site.Domain, &router.Domain{
|
site.Domain = append(site.Domain, &router.Domain{
|
||||||
Type: router.Domain_Plain,
|
Type: router.Domain_Plain,
|
||||||
Value: entry.Value,
|
Value: entry.Value,
|
||||||
Attribute: entry.Attrs,
|
Attribute: entry.Attrs,
|
||||||
})
|
})
|
||||||
case "full":
|
|
||||||
|
case RuleTypeFullDomain:
|
||||||
site.Domain = append(site.Domain, &router.Domain{
|
site.Domain = append(site.Domain, &router.Domain{
|
||||||
Type: router.Domain_Full,
|
Type: router.Domain_Full,
|
||||||
Value: entry.Value,
|
Value: entry.Value,
|
||||||
Attribute: entry.Attrs,
|
Attribute: entry.Attrs,
|
||||||
})
|
})
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("unknown domain type: " + entry.Type)
|
return nil, errors.New("unknown domain type: " + entry.Type)
|
||||||
}
|
}
|
||||||
@@ -118,14 +136,20 @@ func removeComment(line string) string {
|
|||||||
func parseDomain(domain string, entry *Entry) error {
|
func parseDomain(domain string, entry *Entry) error {
|
||||||
kv := strings.Split(domain, ":")
|
kv := strings.Split(domain, ":")
|
||||||
if len(kv) == 1 {
|
if len(kv) == 1 {
|
||||||
entry.Type = "domain"
|
entry.Type = RuleTypeDomain
|
||||||
entry.Value = strings.ToLower(kv[0])
|
entry.Value = strings.ToLower(kv[0])
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(kv) == 2 {
|
if len(kv) == 2 {
|
||||||
entry.Type = strings.ToLower(kv[0])
|
entry.Type = strings.ToLower(kv[0])
|
||||||
entry.Value = strings.ToLower(kv[1])
|
|
||||||
|
if strings.EqualFold(entry.Type, RuleTypeRegexp) {
|
||||||
|
entry.Value = kv[1]
|
||||||
|
} else {
|
||||||
|
entry.Value = strings.ToLower(kv[1])
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,7 +279,7 @@ func ParseList(list *List, ref map[string]*List) (*ParsedList, error) {
|
|||||||
newEntryList := make([]Entry, 0, len(entryList))
|
newEntryList := make([]Entry, 0, len(entryList))
|
||||||
hasInclude := false
|
hasInclude := false
|
||||||
for _, entry := range entryList {
|
for _, entry := range entryList {
|
||||||
if entry.Type == "include" {
|
if entry.Type == RuleTypeInclude {
|
||||||
refName := strings.ToUpper(entry.Value)
|
refName := strings.ToUpper(entry.Value)
|
||||||
if entry.Attrs != nil {
|
if entry.Attrs != nil {
|
||||||
for _, attr := range entry.Attrs {
|
for _, attr := range entry.Attrs {
|
||||||
|
|||||||
Reference in New Issue
Block a user