From e6ebb8efef4430c48b06469ba566349bba3d9856 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Thu, 18 Aug 2022 14:51:28 +0300 Subject: [PATCH] filtering: fmt --- CHANGELOG.md | 5 +++ internal/filtering/blocked.go | 83 +++++++++++++++++++++++++---------- 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4ad05b4..b92e14c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,11 +20,16 @@ and this project adheres to - Weaker cipher suites that use the CBC (cipher block chaining) mode of operation have been disabled ([#2993]). +### Added + +- Bilibili service blocking ([#4795]). + ### Deprecated - Go 1.18 support. v0.109.0 will require at least Go 1.19 to build. [#2993]: https://github.com/AdguardTeam/AdGuardHome/issues/2993 +[#4795]: https://github.com/AdguardTeam/AdGuardHome/issues/4795 diff --git a/internal/filtering/blocked.go b/internal/filtering/blocked.go index 89531a22..665b62d4 100644 --- a/internal/filtering/blocked.go +++ b/internal/filtering/blocked.go @@ -20,8 +20,11 @@ type svc struct { // client/src/helpers/constants.js // client/src/components/ui/Icons.js var serviceRulesArray = []svc{{ - name: "whatsapp", - rules: []string{"||whatsapp.net^", "||whatsapp.com^"}, + name: "whatsapp", + rules: []string{ + "||whatsapp.com^", + "||whatsapp.net^", + }, }, { name: "facebook", rules: []string{ @@ -38,8 +41,13 @@ var serviceRulesArray = []svc{{ "||fb.watch^", }, }, { - name: "twitter", - rules: []string{"||twitter.com^", "||twttr.com^", "||t.co^", "||twimg.com^"}, + name: "twitter", + rules: []string{ + "||t.co^", + "||twimg.com^", + "||twitter.com^", + "||twttr.com^", + }, }, { name: "youtube", rules: []string{ @@ -53,8 +61,13 @@ var serviceRulesArray = []svc{{ "||ytimg.com^", }, }, { - name: "twitch", - rules: []string{"||twitch.tv^", "||ttvnw.net^", "||jtvnw.net^", "||twitchcdn.net^"}, + name: "twitch", + rules: []string{ + "||jtvnw.net^", + "||ttvnw.net^", + "||twitch.tv^", + "||twitchcdn.net^", + }, }, { name: "netflix", rules: []string{ @@ -220,17 +233,28 @@ var serviceRulesArray = []svc{{ "||douyincdn.com^", }, }, { - name: "vimeo", - rules: []string{"||vimeo.com^", "||vimeocdn.com^", "*vod-adaptive.akamaized.net^"}, + name: "vimeo", + rules: []string{ + "*vod-adaptive.akamaized.net^", + "||vimeo.com^", + "||vimeocdn.com^", + }, }, { - name: "pinterest", - rules: []string{"||pinterest.*^", "||pinimg.com^"}, + name: "pinterest", + rules: []string{ + "||pinimg.com^", + "||pinterest.*^", + }, }, { name: "imgur", rules: []string{"||imgur.com^"}, }, { - name: "dailymotion", - rules: []string{"||dailymotion.com^", "||dm-event.net^", "||dmcdn.net^"}, + name: "dailymotion", + rules: []string{ + "||dailymotion.com^", + "||dm-event.net^", + "||dmcdn.net^", + }, }, { name: "qq", rules: []string{ @@ -244,23 +268,34 @@ var serviceRulesArray = []svc{{ name: "wechat", rules: []string{ "||wechat.com^", - "||wx.qq.com^", - "||weixin.qq.com^", "||weixin.qq.com.cn^", + "||weixin.qq.com^", "||weixinbridge.com^", + "||wx.qq.com^", }, }, { name: "viber", rules: []string{"||viber.com^"}, }, { - name: "weibo", - rules: []string{"||weibo.com^", "||weibo.cn^", "||weibocdn.com^"}, + name: "weibo", + rules: []string{ + "||weibo.cn^", + "||weibo.com^", + "||weibocdn.com^", + }, }, { - name: "9gag", - rules: []string{"||9cache.com^", "||9gag.com^"}, + name: "9gag", + rules: []string{ + "||9cache.com^", + "||9gag.com^", + }, }, { - name: "telegram", - rules: []string{"||t.me^", "||telegram.me^", "||telegram.org^"}, + name: "telegram", + rules: []string{ + "||t.me^", + "||telegram.me^", + "||telegram.org^", + }, }, { name: "disneyplus", rules: []string{ @@ -297,11 +332,11 @@ var serviceRulesArray = []svc{{ }, { name: "bilibili", rules: []string{ - "||bilibili.com^", - "||bilivideo.com^", - "||bilivideo.cn^", - "||biligame.com^", "||biliapi.net^", + "||bilibili.com^", + "||biligame.com^", + "||bilivideo.cn^", + "||bilivideo.com^", "||dreamcast.hk^", "||hdslb.com^", },