From 144e65076aaf7a4d5077975375a5840b22735b90 Mon Sep 17 00:00:00 2001 From: Imre Kristoffer Eilertsen Date: Sun, 19 May 2019 00:31:27 +0200 Subject: [PATCH] Update nordic_prepare_filters.py --- .../nordic_prepare_filters.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/NorwegianExperimentalList alternate versions/nordic_prepare_filters.py b/NorwegianExperimentalList alternate versions/nordic_prepare_filters.py index 8e8d7127f..588218191 100644 --- a/NorwegianExperimentalList alternate versions/nordic_prepare_filters.py +++ b/NorwegianExperimentalList alternate versions/nordic_prepare_filters.py @@ -1,14 +1,14 @@ import requests import re -SOURCES = ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianList.txt'] +SOURCES = ['https://gitlab.com/DandelionSprout/adfilt/raw/master/NorwegianList.txt'] UNSUPPORTED_ABP = ['$document', '$important', ',important' '$redirect=', ',redirect=', ':style', '##+js', '.*#' , ':xpath', ':matches-css', 'dk,no##'] UNSUPPORTED_TPL = ['##', '#@#', '#?#', r'\.no\.$'] -OUTPUT = 'filter.txt' +OUTPUT = 'xyzzyx.txt' OUTPUT_AG = 'NordicFiltersAdGuard.txt' OUTPUT_ABP = 'NordicFiltersABP.txt' OUTPUT_TPL = 'DandelionSproutsNorskeFiltre.tpl' @@ -59,6 +59,12 @@ def prepare_ag(lines) -> str: line ) + line = re.sub( + r"! Redirect:.*", + "", + line + ) + text += line + '\r\n' return text