From 3ae4edb4db5426e4f99cb793c83c889a192afcec Mon Sep 17 00:00:00 2001 From: Imre Kristoffer Eilertsen Date: Fri, 21 Aug 2020 05:43:01 +0200 Subject: [PATCH] Add files via upload --- .../NordicFiltersABP-Inclusion.txt | 9 +++--- .../NordicFiltersABP.txt | 9 +++--- .../XYZPrepareFilters.py | 28 +++++++++++++++++-- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersABP-Inclusion.txt b/NorwegianExperimentalList alternate versions/NordicFiltersABP-Inclusion.txt index 149f2e638..e0f0a90c9 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersABP-Inclusion.txt +++ b/NorwegianExperimentalList alternate versions/NordicFiltersABP-Inclusion.txt @@ -1157,11 +1157,10 @@ danishfamilysearch.dk#@#iframe[width="300"][height="250"] ! ! -! 🇳🇴: ——— Forsøker å få nettleseren til å laste inn filer i HTTPS, dersom nettstedet ikke automatisk omdirigerer HTTP til dens HTTPS-versjon ——— -! 🇬🇧: ——— Tries to make the web browser load files in HTTPS, if the website itself doesn't automatically redirect from HTTP to its HTTPS version ——— -! Credit to https://raw.githubusercontent.com/Cybo1927/Hosts/master/Anti/Anti%2520Third-Party%2520HTTP for showing me the existence of this particular CSP command. -! Though in all fairness, you'd get better results from using https://github.com/ilGur1132/Smart-HTTPS as your main solution for these kinds of HTTPS upgrades. -$csp=upgrade-insecure-requests,domain=skessuhorn.is|sporttv.is|bobilverden.no|win-xp.no + + + + ! 🇳🇴: Anti-'CPU-massakrering' ! 🇮🇸: And-örgjörvislatrun diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersABP.txt b/NorwegianExperimentalList alternate versions/NordicFiltersABP.txt index 059cb7b24..72cbbfcdd 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersABP.txt +++ b/NorwegianExperimentalList alternate versions/NordicFiltersABP.txt @@ -1171,11 +1171,10 @@ danishfamilysearch.dk#@#iframe[width="300"][height="250"] !#include NorwegianExperimentalList%20alternate%20versions/AntiAdblockEntries.txt ! -! 🇳🇴: ——— Forsøker å få nettleseren til å laste inn filer i HTTPS, dersom nettstedet ikke automatisk omdirigerer HTTP til dens HTTPS-versjon ——— -! 🇬🇧: ——— Tries to make the web browser load files in HTTPS, if the website itself doesn't automatically redirect from HTTP to its HTTPS version ——— -! Credit to https://raw.githubusercontent.com/Cybo1927/Hosts/master/Anti/Anti%2520Third-Party%2520HTTP for showing me the existence of this particular CSP command. -! Though in all fairness, you'd get better results from using https://github.com/ilGur1132/Smart-HTTPS as your main solution for these kinds of HTTPS upgrades. -$csp=upgrade-insecure-requests,domain=skessuhorn.is|sporttv.is|bobilverden.no|win-xp.no + + + + ! 🇳🇴: Anti-'CPU-massakrering' ! 🇮🇸: And-örgjörvislatrun diff --git a/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py b/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py index 0e93ffaae..eaff0854a 100644 --- a/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py +++ b/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py @@ -4,7 +4,7 @@ import re SOURCES = ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianList.txt', 'https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianExperimentalList%20alternate%20versions/AntiAdblockEntries.txt'] UNSUPPORTED_ABP = ['$important', ',important', '$redirect=', ',redirect=', - ':style', '##+js', '.*#' , 'dk,no##', '!#if', '!#endif', '!+ ', '##^', '$$', '$app'] + ':style', '##+js', '.*#' , 'dk,no##', '!#if', '!#endif', '!+ ', '##^', '$$', '$app', '$csp=upgrade-insecure-requests'] UNSUPPORTED_TPL = ['##', '#@#', '#?#', r'\.no\.$'] UNSUPPORTED_PRIVOXY = ['##', '#@#', '#?#', '!#', '$$', '$redirect', ',redirect', '$generichide', 'Expires:'] UNSUPPORTED_BRAVE = ['#@#', '#?#', 'emty.gif', '1pix.gif', '730.no/banner/', 'gaysir.no/rek/', '85.17.76.181', 'youtube.jpg', 'instagram', 'cookieinformation', 'Social Blocking', '/admark_', 'PFBLOCKERNG', 'boks', 'rammar', ' spaces', 'services.api.no', 'Viatrumf', 'Internet Explorer', 'Elkjøp', ' elding.fo', ' background', 'baggrund', 'EasyList —', 'baksýn', '!+ NOT_OPTIMIZED', '$$'] @@ -698,6 +698,18 @@ def prepare_abp(lines) -> str: line ) + line = re.sub( + r"^! .*HTTPS(,| ).*", + r"", + line + ) + + line = re.sub( + r"^! .* CSP .*", + r"", + line + ) + if is_supported_abp(line): text += line + '\r\n' @@ -1605,7 +1617,7 @@ import re SOURCES = ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianList.txt'] UNSUPPORTED_ABP = ['$important', ',important', '$redirect=', ',redirect=', - ':style', '##+js', '.*#' , 'dk,no##', '!#if', '!#endif', '!+ ', '##^', '!#i', '$app', ':not(:-abp-'] + ':style', '##+js', '.*#' , 'dk,no##', '!#if', '!#endif', '!+ ', '##^', '!#i', '$app', ':not(:-abp-', '$csp=upgrade-insecure-requests'] OUTPUT = 'xyzzyxeyeo.txt' OUTPUT_ABP = 'NordicFiltersABP-Inclusion.txt' @@ -2152,6 +2164,18 @@ def prepare_abp(lines) -> str: line ) + line = re.sub( + r"^! .*HTTPS(,| ).*", + r"", + line + ) + + line = re.sub( + r"^! .* CSP .*", + r"", + line + ) + if is_supported_abp(line): text += line + '\r\n'