Imre Eilertsen
2025-07-13 08:42:37 +02:00
committed by GitHub
parent 2ccd54b531
commit dce1a7b2ff
10 changed files with 224 additions and 283 deletions
@@ -1,7 +1,7 @@
msFilterList
# Title: 🏔️ Dandelion Sprouts nordiske filtre for ryddigere nettsider
# Title 🇬🇧: Dandelion Sprout's Nordic filters for tidier websites
# Last modified: 09July2025v1-Deprecated
# Last modified: 13July2025v1-Deprecated
: expires = 18 hours
# Lisens Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
# Homepage: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md
@@ -707,6 +707,9 @@ msFilterList
# ★★★ Caused by «Peter Lowe's Ad and tracking server list» ★★★
# ★★★ Caused by «Dan Pollock's hosts file» ★★★
# ★★★ Caused by «AdGuard Cookie Notices filter» ★★★
# ★★★ 🇳🇴:Forårsaket av «AdGuards spionvarefilter» ★★★
# ★★★ 🇬🇧:Caused by «AdGuard Tracking Protection Filter» ★★★
# https://github.com/AdguardTeam/AdguardFilters/issues/209205
!
# 🇳🇴 🇩🇰:Anti-'CPU-massakrering'
# 🇮🇸:And-örgjörvislatrun
@@ -1,6 +1,6 @@
! Title: 🏔️ Dandelion Sprouts nordiske filtre for ryddigere nettsider (for «uBlock Origin Legacy»)
! Title 🇬🇧: Dandelion Sprout's Nordic filters for tidier websites (for «uBlock Origin Legacy»)
! Last modified: 09July2025v1-Beta
! Last modified: 13July2025v1-Beta
! Expires: 18 hours
! Lisens / Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
! Homepage: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md
@@ -2402,6 +2402,10 @@ telenor.no##.global-overlay-background
@@://nhn.dk^$1p
! ★★★ Caused by «AdGuard Cookie Notices filter» ★★★
@@||glassoginterior.no/css/modules/consent.css^
! ★★★ 🇳🇴:Forårsaket av «AdGuards spionvarefilter» ★★★
! ★★★ 🇬🇧:Caused by «AdGuard Tracking Protection Filter» ★★★
! https://github.com/AdguardTeam/AdguardFilters/issues/209205
@@||tv2.no/*/snowplow/*$script
!
@@ -1,6 +1,6 @@
! Title: 🏔️ Dandelion Sprouts nordiske filtre for ryddigere nettsider (uMatrix-regler til å benytte sammen med domeneversjonen)
! Title 🇬🇧: Dandelion Sprout's Nordic filters for tidier websites (uMatrix rules to use together with the raw domains version)
! Last modified: 09July2025v1-Alpha
! Last modified: 13July2025v1-Alpha
! Lisens / Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
! Homepage: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md
! 🇳🇴:Denne listen dekker nettsteder for Norge, Danmark, Island, Færøyene, Grønland, Schleswig-Holsteins danske minoritet, og samebefolkningen. For mere informasjon, detaljer, hjelpemidler, og andre lister jeg har laget, gå til https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md#norsk
@@ -136,6 +136,8 @@ ekstrabladet.dk sp-prod.net xhr allow
@@://mettelindberg.dk^$1p
@@://nhn.dk^$1p
! ★★★ Caused by «AdGuard Cookie Notices filter» ★★★
! ★★★ 🇳🇴:Forårsaket av «AdGuards spionvarefilter» ★★★
! ★★★ 🇬🇧:Caused by «AdGuard Tracking Protection Filter» ★★★
!
! 🇳🇴/🇩🇰:Anti-'CPU-massakrering'
! 🇮🇸:And-örgjörvislatrun
@@ -1,7 +1,7 @@
[Adblock Plus 3.13]
! Title: 🏔️ Dandelion Sprouts helnordiske filtre (Møter ABPs inkluderingsregler — Firefox ≥121, Chrom* ≥105)
! Title 🇬🇧: Dandelion Sprout's All-Nordic filters (With ABP inclusion compliance — Firefox ≥121, Chrom* ≥105)
! Version: 090720251
! Version: 130720251
! Expires: 18 hours
! Lisens / Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
! Homepage: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md
@@ -2315,6 +2315,10 @@ sosialurin.fo#@#.ads-banner
@@://nhn.dk^$~third-party
! ★★★ Caused by «AdGuard Cookie Notices filter» ★★★
@@||glassoginterior.no/css/modules/consent.css^
! ★★★ 🇳🇴:Forårsaket av «AdGuards spionvarefilter» ★★★
! ★★★ 🇬🇧:Caused by «AdGuard Tracking Protection Filter» ★★★
! https://github.com/AdguardTeam/AdguardFilters/issues/209205
@@||tv2.no/*/snowplow/*$script
@@ -6679,7 +6683,7 @@ dn.se##.bad--insider-tall
! Title: Adblock List for Finland
! Description: Finnish adblock list
! Expires: 4 days
! Last modified: Tue, 08 Jul 2025 17:14:23 +0300
! Last modified: Thu, 10 Jul 2025 11:15:26 +0300
! Finnish section's homepage: https://github.com/finnish-easylist-addition/finnish-easylist-addition
! License: https://unlicense.org/
! Raportoi mainoksenestoon liittyvistä ongelmista tai estämättömistä mainoksista täällä / Please report adblocking related issues or unblocked ads at:
@@ -7217,6 +7221,7 @@ karjalainen.fi##a[href$="ttps://punamustamedia.portal.worldoftulo.com/v2/shop/dt
karjalainen.fi#?#.breaking-news-container:has-text(mainos:)
karjalainen.fi#?#.card-container:has-text(Mainos alkaa)
karjalainen.fi,sammysatv.com##center
kaukokaipuumatkablogi.net#?#.row-container:has-text(MAINOS)
kauppalehti.fi###coral-talk + div[class]:has(a[href^="https://www.kauppalehti.fi/kumppanisisallot/"])
kauppalehti.fi##div[class][width]:has(> .ad)
kauppalehti.fi#?#main:not(> h2:has-text(Kumppanisisältöä)) [class][data-test] ~ div[class]:has(> a[href^="https://www.kauppalehti.fi/kumppanisisallot/"])
@@ -7684,6 +7689,10 @@ tori.fi###footer_partner_links
tori.fi##div#banner_panorama_topmost
tori.fi##div#panorama_top
tori.fi##div#panorama_topmost
totalvene.fi##.banner-content:has([data-ad-client])
totalvene.fi##.moduletable:has(.advert)
totalvene.fi##.videoparaati
totalvene.fi#?#.banner-group-header:has-text(Mainos)
traktorpool.fi##.billboard
treykalenteri.fi##.promotion-image
ts.fi##.tsv3-c-common-forum-threadviewer__messages__item:has(.smartad)
@@ -7953,6 +7962,7 @@ _300x300_*.mp4$media,domain=futisfani.com|kiekkofani.com|penkkiurheilu.com|uutis
||tiketti.fi/tiedostot/*/Tiketti*_Paraati_$image,domain=tiketti.fi
||tohtorille.fi/Content/img/op-banners/$image
||tori.fi/*banner$domain=moottori.fi
||totalvene.fi/images/banners/$image,media,domain=totalvene.fi
||ts.fi/adframe.js$script,domain=ts.fi
||urbaanisanakirja.com/static/img/portsaad.png$image
||vauva.fi/modules/custom/vauva_cts/modules/vauva_cts_native/js/vauva_cts_native.js$script,domain=vauva.fi
@@ -8033,6 +8043,7 @@ murha.info#@#.adsbygoogle
||freewheel-jitt.sanoma.fi^$media,rewrite=abp-resource:blank-mp3,domain=ruutu.fi
||nelonenmedia-pmd-ads-*.nm-stream.nelonenmedia.fi^$media,rewrite=abp-resource:blank-mp3,domain=ruutu.fi|supla.fi
||sanoma-prod.integration-x.com^$media,rewrite=abp-resource:blank-mp3,domain=ruutu.fi
/adverts/*.mp4$media,rewrite=abp-resource:blank-mp3,domain=totalvene.fi
! appears when blocking ads:
||mobiili.fi/wp-content/themes/mobiilitheme/images/small-loading.gif
@@ -1,7 +1,7 @@
[Adblock Plus 3.13]
! Title: 🏔️ Dandelion Sprouts vestnordiske filtre for ryddigere nettsider (for AdBlock og Adblock Plus)
! Title 🇬🇧: Dandelion Sprout's West Nordic filters for tidier websites (for AdBlock and Adblock Plus)
! Version: 090720251
! Version: 130720251
! Expires: 18 hours
! Lisens / Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
! Homepage: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md
@@ -2330,6 +2330,10 @@ telenor.no##.global-overlay-background
@@://nhn.dk^$~third-party
! ★★★ Caused by «AdGuard Cookie Notices filter» ★★★
@@||glassoginterior.no/css/modules/consent.css^
! ★★★ 🇳🇴:Forårsaket av «AdGuards spionvarefilter» ★★★
! ★★★ 🇬🇧:Caused by «AdGuard Tracking Protection Filter» ★★★
! https://github.com/AdguardTeam/AdguardFilters/issues/209205
@@||tv2.no/*/snowplow/*$script
@@ -1,6 +1,6 @@
itle: 🏔️ Dandelion Sprouts nordiske filtre for ryddigere nettsider (for AdGuard)
! Title 🇬🇧: Dandelion Sprout's Nordic filters for tidier websites
! Last modified: 09July2025v1
! Last modified: 13July2025v1
! Expires: 18 hours
! Lisens / Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
! Homepage: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md
@@ -2415,6 +2415,10 @@ telenor.no##.global-overlay-background
@@://nhn.dk^$~third-party
! ★★★ Caused by «AdGuard Cookie Notices filter» ★★★
@@||glassoginterior.no/css/modules/consent.css^
! ★★★ 🇳🇴:Forårsaket av «AdGuards spionvarefilter» ★★★
! ★★★ 🇬🇧:Caused by «AdGuard Tracking Protection Filter» ★★★
! https://github.com/AdguardTeam/AdguardFilters/issues/209205
@@||tv2.no/*/snowplow/*$script
@@ -3543,7 +3547,7 @@ gamereactor.*##+js(set, adblockEnabled, noopFunc)
gamereactor.*##+js(set, trackAdblock, noopFunc)
gamereactor.*##+js(acis, AdsReloadConfig)
!#if env_firefox
gamereactor.*##^script[onError="adblockEnabled()"]
gamereactor.*$$script[onError="adblockEnabled()"]
!#endif
! Also fixed in "uBlock Filters - Privacy", but is added to this list as well, because it serves to remove AAAB notices on various pages (especially when "uBlock Filters" is turned on).
||googletagmanager.com/gtm.js^$domain=dk|bornholm.nu
@@ -773,114 +773,114 @@ sporposten.today
# ——— Anti-phishing filters for tools that support wildcards, are below this line. ———
# ——— Don't be worried if you see entries that resemble major Nordic websites; those are wildcard entries for use with e.g. Samsung Knox, that attempts to stop phishing sites that have stolen the website brands in question. ———
(.*\.)?vg\.no\..*$
(.*\.)?elkjop\.no\..*$
(.*\.)?coop\.no\..*$
(.*\.)?shell\.no\..*$
(.*\.)?finn\.no\..*$
(.*\.)?dnb\.no\..*$
(.*\.)?sparebank1\.no\..*$
(.*\.)?nordea\.no\..*$
(.*\.)?sbanken\.no\..*$
(.*\.)?danskebank\.no\..*$
(.*\.)?komplett\.no\..*$
(.*\.)?nordnet\.no\..*$
(.*\.)?skatteetaten\.no\..*$
(.*\.)?norwegian\.com\..*$
(.*\.)?flysas-no\..*$
(.*\.)?tusenfryd-com\..*$
(.*\.)?*\.gratis-reisebilletter\..*$
(.*\.)?paypal\..*\.no$
(.*\.)?kiwi\.com-*$
(.*\.)?kongeparken\.com-*$
(.*\.)?vipps-sikkerhet\..*$
(.*\.)?getmail-no\..*$
(.*\.)?legoland\.com-^.*\..*$
(.*\.)?faarup\.com-^.*\..*$
(.*\.)?djurs\.com-^.*\..*$
(.*\.)?appleid\..*\.no$
(.*\.)?itunesconnect-.*\.no$
(.*\.)?fintechnow.*\.buzz$
(.*\.)?wealthnews.*\.xyz$
(.*\.)?euronews.*\.buzz$
(.*\.)?softwaredaily.*\.monster$
(.*\.)?stalknews.*\.buzz$
(.*\.)?goldupdates.*\.xyz$
^(.*\.)?vg\.no\..*$
^(.*\.)?elkjop\.no\..*$
^(.*\.)?coop\.no\..*$
^(.*\.)?shell\.no\..*$
^(.*\.)?finn\.no\..*$
^(.*\.)?dnb\.no\..*$
^(.*\.)?sparebank1\.no\..*$
^(.*\.)?nordea\.no\..*$
^(.*\.)?sbanken\.no\..*$
^(.*\.)?danskebank\.no\..*$
^(.*\.)?komplett\.no\..*$
^(.*\.)?nordnet\.no\..*$
^(.*\.)?skatteetaten\.no\..*$
^(.*\.)?norwegian\.com\..*$
^(.*\.)?flysas-no\..*$
^(.*\.)?tusenfryd-com\..*$
^(.*\.)?*\.gratis-reisebilletter\..*$
^(.*\.)?paypal\..*\.no$
^(.*\.)?kiwi\.com-*$
^(.*\.)?kongeparken\.com-*$
^(.*\.)?vipps-sikkerhet\..*$
^(.*\.)?getmail-no\..*$
^(.*\.)?^(.*\.)?legoland\.com-^.*\..*$
^(.*\.)?^(.*\.)?faarup\.com-^.*\..*$
^(.*\.)?^(.*\.)?djurs\.com-^.*\..*$
^(.*\.)?appleid\..*\.no$
^(.*\.)?itunesconnect-.*\.no$
^(.*\.)?fintechnow.*\.buzz$
^(.*\.)?wealthnews.*\.xyz$
^(.*\.)?euronews.*\.buzz$
^(.*\.)?softwaredaily.*\.monster$
^(.*\.)?stalknews.*\.buzz$
^(.*\.)?goldupdates.*\.xyz$
^.*\.vidcopa\.me$
(.*\.)?sikre-vipps-konto\..*$
(.*\.)?dnb\.no-*$
(.*\.)?norge\..*\.icu$
(.*\.)?signup-.*vpns\.com$
(.*\.)?telenors\..*\.cx$
(.*\.)?-sparebank1\..*\.net$
^(.*\.)?sikre-vipps-konto\..*$
^(.*\.)?dnb\.no-*$
^(.*\.)?norge\..*\.icu$
^(.*\.)?signup-.*vpns\.com$
^(.*\.)?telenors\..*\.cx$
^(.*\.)?-sparebank1\..*\.net$
^[a-z]{10,12}\.easy\.co$
(.*\.)?bankid-sperret\..*$
.*norgeskosalg\.*
.*-norge\.co\.no
.*skodanmark\.com
.*danmarkdk\.com
.*norge-salg\.com
.*norgesalg\.com
.*norgesalgs\.com
.*salgnorge\.com
.*skodanmarks\.*
.*skodktilbud\.*
.*skonorgeeu\.com
.*sneakersdkshop\.com
.*sneakersnorgeshop\.*
hokaoneone.*$
.*-norgesalg\.com
.*danmarks\.com
.*norgno\.com
.*norges\.com
.*norgebutikk\.com
.*norgestore\.com
.*norge-no\.com
.*norgestores\.com
.*skobutikks\.com
.*butikksoslo\.com
(.*\.)?no-oppdatere\..*$
(.*\.)?post-nord-levering\..*$
(.*\.)?post-nord-receiving\..*$
(.*\.)?posten-nno\..*$
(.*\.)?posten-tracks\..*$
(.*\.)?postenn-no\..*$
(.*\.)?postnord-all\..*$
(.*\.)?postnord-confirmation\..*$
(.*\.)?postnord-delay\..*$
postnord-order-.*$
(.*\.)?postnord-paket\..*$
(.*\.)?postnord-pay\..*$
(.*\.)?postnord-post\..*$
(.*\.)?postnord-se-delivery\..*$
(.*\.)?postnord-step\..*$
(.*\.)?postnord-step1\..*$
(.*\.)?postnord-tk\..*$
(.*\.)?postnord-tracks\..*$
(.*\.)?postnorde-swe\..*$
(.*\.)?postnordexpress\..*$
postnordexpressdelivery-.*$
(.*\.)?postnordspara\..*$
postnorg-dk.*$
^(.*\.)?bankid-sperret\..*$
^.*norgeskosalg\.*$
^.*-norge\.co\.no$
^.*skodanmark\.com$
^.*danmarkdk\.com$
^.*norge-salg\.com$
^.*norgesalg\.com$
^.*norgesalgs\.com$
^.*salgnorge\.com$
^.*skodanmarks\.*$
^.*skodktilbud\.*$
^.*skonorgeeu\.com$
^.*sneakersdkshop\.com$
^.*sneakersnorgeshop\.*$
^hokaoneone.*$
^.*-norgesalg\.com$
^.*danmarks\.com$
^.*norgno\.com$
^.*norges\.com$
^.*norgebutikk\.com$
^.*norgestore\.com$
^.*norge-no\.com$
^.*norgestores\.com$
^.*skobutikks\.com$
^.*butikksoslo\.com$
^(.*\.)?no-oppdatere\..*$
^(.*\.)?post-nord-levering\..*$
^(.*\.)?post-nord-receiving\..*$
^(.*\.)?posten-nno\..*$
^(.*\.)?posten-tracks\..*$
^(.*\.)?postenn-no\..*$
^(.*\.)?postnord-all\..*$
^(.*\.)?postnord-confirmation\..*$
^(.*\.)?postnord-delay\..*$
^postnord-order-.*$
^(.*\.)?postnord-paket\..*$
^(.*\.)?postnord-pay\..*$
^(.*\.)?postnord-post\..*$
^(.*\.)?postnord-se-delivery\..*$
^(.*\.)?postnord-step\..*$
^(.*\.)?postnord-step1\..*$
^(.*\.)?postnord-tk\..*$
^(.*\.)?postnord-tracks\..*$
^(.*\.)?postnorde-swe\..*$
^(.*\.)?postnordexpress\..*$
^postnordexpressdelivery-.*$
^(.*\.)?postnordspara\..*$
^postnorg-dk.*$
# ——— Anti-ad filters for tools that support wildcards, are below this line. ———
(.*\.)?annonse\..*\.no$
(.*\.)?ad\..*\.no$
(.*\.)?ad1\..*\.no$
(.*\.)?ad1\..*\.dk$
(.*\.)?ads\..*\.no$
(.*\.)?ads\..*\.dk$
(.*\.)?ads\..*\.is$
(.*\.)?adserver\..*\.dk$
(.*\.)?annonser\..*\.no$
(.*\.)?banner\..*\.no$
(.*\.)?helios\..*\.no$
(.*\.)?advert\..*\.no$
(.*\.)?advertisement\..*\.no$
(.*\.)?auglysingar\..*\.is$
(.*\.)?vefbordar\..*\.is$
(.*\.)?vevlysingar\.*\..*$
(.*\.)?mobilannonce\..*\.dk$
^(.*\.)?annonse\..*\.no$
^(.*\.)?ad\..*\.no$
^(.*\.)?ad1\..*\.no$
^(.*\.)?ad1\..*\.dk$
^(.*\.)?ads\..*\.no$
^(.*\.)?ads\..*\.dk$
^(.*\.)?ads\..*\.is$
^(.*\.)?adserver\..*\.dk$
^(.*\.)?annonser\..*\.no$
^(.*\.)?banner\..*\.no$
^(.*\.)?helios\..*\.no$
^(.*\.)?advert\..*\.no$
^(.*\.)?advertisement\..*\.no$
^(.*\.)?auglysingar\..*\.is$
^(.*\.)?vefbordar\..*\.is$
^(.*\.)?vevlysingar\.*\..*$
^(.*\.)?mobilannonce\..*\.dk$
@@ -1,6 +1,6 @@
! Title: 🏔️ Dandelion Sprouts nordiske filtre for ryddigere nettsider (uten sporerhvitelisting)
! Title 🇬🇧: Dandelion Sprout's Nordic filters for tidier websites (without tracker whitelistings)
! Last modified: 09July2025v1
! Last modified: 13July2025v1
! Expires: 18 hours
! Lisens / Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
! Homepage: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md
@@ -2401,6 +2401,10 @@ telenor.no##.global-overlay-background
@@://nhn.dk^$1p
! ★★★ Caused by «AdGuard Cookie Notices filter» ★★★
@@||glassoginterior.no/css/modules/consent.css^
! ★★★ 🇳🇴:Forårsaket av «AdGuards spionvarefilter» ★★★
! ★★★ 🇬🇧:Caused by «AdGuard Tracking Protection Filter» ★★★
! https://github.com/AdguardTeam/AdguardFilters/issues/209205
@@||tv2.no/*/snowplow/*$script
!
@@ -1,6 +1,6 @@
# Title: 🏔️ Dandelion Sprouts nordiske filtre for ryddigere nettsider (for Privoxy)
# Title 🇬🇧: Dandelion Sprout's Nordic filters for tidier websites (for Privoxy)
# Last modified: 09July2025v1-Deprecated
# Last modified: 13July2025v1-Deprecated
# Lisens / Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
# Homepage: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md
# 🇳🇴:Denne listen dekker nettsteder for Norge, Danmark, Island, Færøyene, Grønland, Schleswig-Holsteins danske minoritet, og samebefolkningen. For mere informasjon, detaljer, hjelpemidler, og andre lister jeg har laget, gå til https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md#norsk
@@ -1027,6 +1027,11 @@
# ★★★ Caused by «AdGuard Cookie Notices filter» ★★★
{-block}
.glassoginterior.no/css/modules/consent.css
# ★★★ 🇳🇴:Forårsaket av «AdGuards spionvarefilter» ★★★
# ★★★ 🇬🇧:Caused by «AdGuard Tracking Protection Filter» ★★★
{+block{https://github.com/AdguardTeam/AdguardFilters/issues/209205}}
{-block}
.tv2.no/*/snowplow/*
# 🇳🇴/🇩🇰:Anti-'CPU-massakrering'
# 🇮🇸:And-örgjörvislatrun
# 🇬🇧:Anti-'CPU slaughtering'
@@ -36,7 +36,7 @@ def prepare_ag(lines) -> str:
for line in lines:
line = re.sub(
r"(itle:.*Dandelion Sprout.*)",
r"^.*(itle:.*Dandelion Sprout.*)",
r"\1 (for AdGuard)",
line
)
@@ -48,8 +48,8 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r"\$all\$network$",
r"$network",
r"^(.*)\$all\$network$",
r"\1$network",
line
)
@@ -66,19 +66,19 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r"([$,])xhr",
r"\1xmlhttprequest",
r"^(.*[$,])xhr(.*)$",
r"\1xmlhttprequest\2",
line
)
line = re.sub(
r"([$,~])3p",
r"^(.*[$,~])3p",
r"\1third-party",
line
)
line = re.sub(
r"([$,])1p",
r"^(.*[$,])1p",
r"\1~third-party",
line
)
@@ -95,12 +95,6 @@ def prepare_ag(lines) -> str:
line
)
line = re.sub(
r"has\(:scope >",
r"has(>",
line
)
line = re.sub(
":-abp-has\(",
":has(",
@@ -126,26 +120,14 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r"##\^script:has-text\((.*)\)",
r"$$script[\1]",
r"^(.*)\$~doc$",
r"\1",
line
)
line = re.sub(
r"##\^script\[(.*)\]",
r"$$script[\1]",
line
)
line = re.sub(
r"\$~doc$",
r"",
line
)
line = re.sub(
r"\$doc(,|$)",
r"$document\1",
r"^(.*)\$doc(,|$)",
r"\1$document\2",
line
)
@@ -168,29 +150,11 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r"(#\??#)body(:| )",
r"^(.*#\??#)body(:| )",
r"\1html[lang] > body\2",
line
)
line = re.sub(
r",~inline-font,~inline-script$",
r"",
line
)
line = re.sub(
r",~inline-script,~inline-font$",
r"",
line
)
line = re.sub(
r",~inline-font$",
r"",
line
)
line = re.sub(
r"^\$[a-z0-9-]{1,}$",
r"",
@@ -217,13 +181,13 @@ def prepare_ag(lines) -> str:
# Trying to make https://github.com/AdguardTeam/FiltersRegistry/blob/master/filters/ThirdParty/filter_249_NorwegianList/diff.txt shorter
line = re.sub(
r"([$,])frame(,|$)",
r"^(.*[$,])frame(,|$)",
r"\1subdocument\2",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):style\((.*)\)$",
r"^(.*[a-z*])#\??#(.*):style\((.*)\)$",
r"\1#$#\2 { \3 }",
line
)
@@ -235,8 +199,8 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r"\.\.\*\$",
r".*$",
r"^(.*)\.\.\*\$",
r"\1.*$",
line
)
@@ -247,8 +211,8 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r",~inline-font$",
r"",
r"^(.*),~inline-font$",
r"\1",
line
)
@@ -259,8 +223,8 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r"\$1p$",
r"$~third-party",
r"^(.*)\$1p$",
r"\1$~third-party",
line
)
@@ -282,6 +246,12 @@ def prepare_ag(lines) -> str:
line
)
line = re.sub(
r"^(.*)##\^script\[(.*)\]",
r"\1$$script[\2]",
line
)
text += line + '\n'
return text
@@ -304,8 +274,8 @@ def prepare_abp(lines) -> str:
# remove $document modifier from the rule
line = re.sub(
r"\$doc.*$",
"",
r"^(.*)\$doc.*$",
r"\1",
line
)
@@ -3818,43 +3788,43 @@ def prepare_pihole(lines) -> str:
line = re.sub(
r"^([a-z0-9].*)\.(.*)\.\*",
r"(.*\.)?\1\\.\2\\..*$",
r"^(.*\.)?\1\\.\2\\..*$",
line
)
line = re.sub(
r"^([a-z0-9].*)\.\*$",
r"(.*\.)?\1\\..*$",
r"^(.*\.)?\1\\..*$",
line
)
line = re.sub(
r"^(.*)\.(.*)-\*",
r"(.*\.)?\1\\.\2-*$",
r"^(.*\.)?\1\\.\2-*$",
line
)
line = re.sub(
r"^([a-z0-9].*)\.\*\.(.*)$",
r"(.*\.)?\1\\..*\\.\2$",
r"^(.*\.)?\1\\..*\\.\2$",
line
)
line = re.sub(
r"^\*\.(.*)\.\*",
r"(.*\.)?*\\.\1\\..*$",
r"^(.*\.)?*\\.\1\\..*$",
line
)
line = re.sub(
r"^([a-z0-9].*)\*\.(.*)$",
r"(.*\.)?\1.*\\.\2$",
r"^(.*\.)?\1.*\\.\2$",
line
)
line = re.sub(
r"(\(\.\*\\\.\)\?){2}",
r"(.*\.)?",
r"^(.*\.)?",
line
)
@@ -3872,13 +3842,13 @@ def prepare_pihole(lines) -> str:
line = re.sub(
r"^([a-z0-9-]{1,})\*([a-z0-9-]{1,})\.([a-z]{2,17})$",
r"(.*\\.)?\1.*\2\\.\3$",
r"^(.*\\.)?\1.*\2\\.\3$",
line
)
line = re.sub(
r"^\*(-[a-z0-9]{1,})\.\*\.([a-z]{2,17})$",
r"(.*\\.)?\1\\..*\\.\2$",
r"^(.*\\.)?\1\\..*\\.\2$",
line
)
@@ -3954,6 +3924,30 @@ def prepare_pihole(lines) -> str:
line
)
line = re.sub(
r"^\.\*",
r"^.*",
line
)
line = re.sub(
r"^(\^.*[a-z])$",
r"\1$",
line
)
line = re.sub(
r"\.\*$",
r".*$",
line
)
line = re.sub(
r"^([a-z].*\.\*\$)$",
r"^\1",
line
)
text += line + '\n'
return text
@@ -4795,7 +4789,7 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r"\[Adblock Plus 3\..*$",
r"^\[Adblock Plus 3\..*$",
r"",
line
)
@@ -4806,18 +4800,6 @@ def prepare_ag(lines) -> str:
line
)
line = re.sub(
r"=~ Warning.*$",
"",
line
)
line = re.sub(
r"\|~ Warning.*$",
"",
line
)
line = re.sub(
r"^\*?\$(all,|doc,3p,|document,third-party)?ipaddress=(.*)$",
r"!+ PLATFORM(windows, mac, android, cli)\n\2$network",
@@ -4849,73 +4831,37 @@ def prepare_ag(lines) -> str:
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(1\)",
r"^([a-z*])#\??#(.*):(upward|nth-ancestor)\(1\)",
r"\1##*:has(> \2)",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(2\)",
r"^([a-z*])#\??#(.*):(upward|nth-ancestor)\(2\)",
r"\1##*:has(> * > \2)",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(3\)",
r"^([a-z*])#\??#(.*):(upward|nth-ancestor)\(3\)",
r"\1##*:has(> * > * > \2)",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(4\)",
r"^([a-z*])#\??#(.*):(upward|nth-ancestor)\(4\)",
r"\1##*:has(> * > * > * > \2)",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(5\)",
r"\1##*:has(> * > * > * > * > \2)",
r"^(.*)\$doc(,.*)?$",
r"\1$document\2",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(6\)",
r"\1##*:has(> * > * > * > * > * > \2)",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(7\)",
r"\1##*:has(> * > * > * > * > * > * > \2)",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(8\)",
r"\1##*:has(> * > * > * > * > * > * > * > \2)",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(9\)",
r"\1##*:has(> * > * > * > * > * > * > * > * > \2)",
line
)
line = re.sub(
r"([a-z*])#\??#(.*):(upward|nth-ancestor)\(10\)",
r"\1##*:has(> * > * > * > * > * > * > * > * > * > \2)",
line
)
line = re.sub(
r"\$doc(,|$)",
r"$document\1",
line
)
line = re.sub(
r"(#\??#)body(:| )",
r"^(.*#\??#)body(:| )",
r"\1html[lang] > body\2",
line
)
@@ -4932,36 +4878,6 @@ def prepare_ag(lines) -> str:
line
)
line = re.sub(
r",~inline-font,~inline-script$",
r"",
line
)
line = re.sub(
r",~inline-script,~inline-font$",
r"",
line
)
line = re.sub(
r",~inline-font$",
r"",
line
)
line = re.sub(
",~inline-font,~inline-script,~domain=",
",~domain=",
line
)
line = re.sub(
",~inline-font,~domain=",
",~domain=",
line
)
line = re.sub(
r"^\|\|amazonaws\.com(\^)?($|\$[ac-z,-]{1,}$).*$",
r"",
@@ -4986,12 +4902,6 @@ def prepare_ag(lines) -> str:
line
)
line = re.sub(
r",~inline-script$",
r"",
line
)
line = re.sub(
r"^.*\$dnstype.*$",
r"",
@@ -5000,14 +4910,8 @@ def prepare_ag(lines) -> str:
# Need to make https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/ThirdParty/filter_250_DandelionSproutAnnoyances/diff.txt shorter, so I can more easily find actual syntax errors.
line = re.sub(
r"\$doc$",
r"$document",
line
)
line = re.sub(
r",~inline-font$",
r"",
r"^(.*)\$doc$",
r"\1$document",
line
)
@@ -7014,7 +6918,7 @@ if __name__ == "__main__":
import requests
import re
SOURCES = ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Anti-F%D1%96%D0%9C%20List.txt']
SOURCES = ['https://raw.githubusercontent.com/DandelionSprout/adfilt2/main/Anti-F%D1%96%D0%9C%20List.txt']
UNSUPPORTED_DOMAINS = ['/', '##', '#.', '#@', '#?', '!#', '[', '!']
@@ -7072,7 +6976,7 @@ def prepare_domains(lines) -> str:
)
line = re.sub(
r"^!(.*:)",
r"^!(.*:.*)$",
r"#\1",
line
)