From 3c64ae273157e14f811d5acacbc2ae2ae8bc8046 Mon Sep 17 00:00:00 2001 From: Imre Kristoffer Eilertsen Date: Fri, 14 Oct 2022 18:57:11 +0200 Subject: [PATCH] Fix #661 --- .../NordicFiltersPiHole.txt | 36 +++++++++---------- .../XYZPrepareFilters.py | 14 +++++++- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersPiHole.txt b/NorwegianExperimentalList alternate versions/NordicFiltersPiHole.txt index 9219ff2b0..d75ded677 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersPiHole.txt +++ b/NorwegianExperimentalList alternate versions/NordicFiltersPiHole.txt @@ -2,7 +2,7 @@ # Translated title: Dandelion Sprout's Nordic Filters (for Pi-hole) # Version: 30August2022v1-Alpha # Description: This is a slimmer version of "Dandelion Sprout's Nordic Filters", intended for users of software tools that doesn't support adblocker syntaxes. It chiefly targets scams, malware and adverts, on Norwegian, Danish, Icelandic and Faroese websites. -# Platform notes: This list version is intended for those who make use of the Regex functionality in Pi-Hole. +# Platform notes: This list version is intended for those who make use of the Regex functionality in Pi-Hole. It is strongly recommended to also add the whitelist at https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianExperimentalList%20alternate%20versions/NordicFiltersDomainsAllowlist.txt as a whitelist. # For mere informasjon og detaljer om denne listen og om andre lister jeg har laget, gå til https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md#norsk # For more information and details about this list and other lists of mine, go to https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md#english 102.112.2o7.net @@ -472,23 +472,23 @@ y6.no (.*\.)?vevlysingar\.*\..*$ (.*\.)?mobilannonce\..*\.dk$ -# ——— Centralised whitelist section ——— -# ——— By default, the entries below will only work without modification in 'personalDNSBlocker'. For a whitelist suitable for e.g. Pi-hole, Blokada and DNS66, check out https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianExperimentalList%20alternate%20versions/NordicFiltersDomainsAllowlist.txt ——— -!5d404.v.fwmrm.net -!elkjop.no.edgekey.net -!dnb.no.edgekey.net -!skatteetaten.no.cdn.cloudflare.net -!norwegian.com.cdn.cloudflare.net -!vg.no.cdn.cloudflare.net -!ad.dep.no -!ad.hem.no -!ads.mst.dk -!isdownorblocked.com -!annonser.gess.no -!sumo.cdn.tv2.no -!stillingledig.*.no -!*.cas.ms -!*.admin-mcas.ms + + + + + + + + + + + + + + + + + # ——— Dummy entry used to give myself credit, for when this list is used in large compilation hosts-type files (Although they are fully allowed by my licence to use this list, it'd be nice for me and end-users to see where it's being used, as a few of them do not credit their sources) ——— if-a-large-hosts-file-contains-this-entry-then-it.uses-dandelion-sprouts-nordic-domains-as-a-source-list.data diff --git a/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py b/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py index 6c99e362a..2903032fc 100644 --- a/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py +++ b/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py @@ -3306,7 +3306,7 @@ def prepare_pihole(lines) -> str: line = re.sub( r"# Platform notes:.*", - "# Platform notes: This list version is intended for those who make use of the Regex functionality in Pi-Hole.", + "# Platform notes: This list version is intended for those who make use of the Regex functionality in Pi-Hole. It is strongly recommended to also add the whitelist at https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianExperimentalList%20alternate%20versions/NordicFiltersDomainsAllowlist.txt as a whitelist.", line ) @@ -3394,6 +3394,18 @@ def prepare_pihole(lines) -> str: line ) + line = re.sub( + r"^![a-z0-9*].*", + r"", + line + ) + + line = re.sub( + r"^# ——— (Centralised whitelist section|By default, the entries below will only).*", + r"", + line + ) + text += line + '\r\n' return text