Compare commits

...

3 Commits

Author SHA1 Message Date
风扇滑翔翼
93bfcfd142 Feat: check regexp before build (#3064)
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
2025-12-16 23:40:25 +08:00
DeepChirp
cbe19f0562 picacg-ads: split from picacg 2025-12-16 21:42:59 +08:00
DeepChirp
ea99bef4a2 google-ads: comment out problematic rule 2025-12-16 21:42:59 +08:00
5 changed files with 13 additions and 4 deletions

View File

@@ -38,6 +38,7 @@ include:newrelic-ads
include:ogury-ads
include:ookla-speedtest-ads
include:openx-ads
include:picacg-ads
include:pocoiq-ads
include:pubmatic-ads
include:qihoo360-ads

View File

@@ -49,6 +49,7 @@ partnerad.l.google.com @ads
urchin.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

View File

@@ -1,3 +1,5 @@
include:picacg-ads
bikaa.xyz
bikac.xyz
bikaios.xyz
@@ -10,8 +12,5 @@ picacomic.xyz
wikawika.xyz
# Image Resource Domain like `img.diwodiwo.xyz` `s3.diwodiwo.xyz` `storage.diwodiwo.xyz` `storage-b.diwodiwo.xyz`
ad-channel.diwodiwo.xyz @ads
ad-display.diwodiwo.xyz @ads
diwodiwo.xyz

2
data/picacg-ads Normal file
View File

@@ -0,0 +1,2 @@
full:ad-channel.diwodiwo.xyz @ads
full:ad-display.diwodiwo.xyz @ads

View File

@@ -7,6 +7,7 @@ import (
"fmt"
"os"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
@@ -71,6 +72,11 @@ func (l *ParsedList) toProto() (*router.GeoSite, error) {
Attribute: entry.Attrs,
})
case "regexp":
// 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,