diff --git a/NorwegianExperimentalList alternate versions/DandelionSproutsNorskeFiltre.tpl b/NorwegianExperimentalList alternate versions/DandelionSproutsNorskeFiltre.tpl index 17e431450..e85367842 100644 --- a/NorwegianExperimentalList alternate versions/DandelionSproutsNorskeFiltre.tpl +++ b/NorwegianExperimentalList alternate versions/DandelionSproutsNorskeFiltre.tpl @@ -1,5 +1,5 @@ msFilterList -# Version: 10June2020v3-Alpha +# Version: 12June2020v1-Alpha # Title: ๐Ÿ”๏ธ Dandelion Sprouts nordiske filtre for ryddigere nettsider # Translated title: Dandelion Sprout's Nordic filters for tidier websites : expires = 1 diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersABP-Eyeo.txt b/NorwegianExperimentalList alternate versions/NordicFiltersABP-Eyeo.txt index 1803593c6..852f474e8 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersABP-Eyeo.txt +++ b/NorwegianExperimentalList alternate versions/NordicFiltersABP-Eyeo.txt @@ -1,5 +1,5 @@ [Adblock Plus 3.4] -! Version: 100620203 +! Version: 120620201 ! Title: ๐Ÿ”๏ธ Dandelion Sprouts vestnordiske filtre for ryddigere nettsider (for Adblock Plus - Mรธter Eyeo sine regler) ! Translated title: Dandelion Sprout's West Nordic filters for tidier websites (for Adblock Plus with Eyeo compliance) ! Expires: 12 hours diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersABP.txt b/NorwegianExperimentalList alternate versions/NordicFiltersABP.txt index 899369dae..85b8bda97 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersABP.txt +++ b/NorwegianExperimentalList alternate versions/NordicFiltersABP.txt @@ -1,5 +1,5 @@ [Adblock Plus 3.4] -! Version: 100620203 +! Version: 120620201 ! Title: ๐Ÿ”๏ธ Dandelion Sprouts vestnordiske filtre for ryddigere nettsider (for AdBlock og Adblock Plus) ! Translated title: Dandelion Sprout's West Nordic filters for tidier websites (for AdBlock and Adblock Plus) ! Expires: 12 hours diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersAdGuard.txt b/NorwegianExperimentalList alternate versions/NordicFiltersAdGuard.txt index df9525800..7378c7532 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersAdGuard.txt +++ b/NorwegianExperimentalList alternate versions/NordicFiltersAdGuard.txt @@ -1,4 +1,4 @@ -! Version: 10June2020v3 +! Version: 12June2020v1 ! Title: ๐Ÿ”๏ธ Dandelion Sprouts nordiske filtre for ryddigere nettsider (for AdGuard) ! Translated title: Dandelion Sprout's Nordic filters for tidier websites (for AdGuard) ! Expires: 12 hours @@ -916,9 +916,7 @@ krom.is#@#.share-container !#endif -!#if !adguard -!#include NorwegianExperimentalList%20alternate%20versions/AntiAdblockEntries.txt -!#endif +!#include AntiAdblockEntries.txt ! ๐Ÿ‡ณ๐Ÿ‡ด: โ€”โ€”โ€” Forsรธker รฅ fรฅ nettleseren til รฅ laste inn filer i HTTPS, dersom nettstedet ikke automatisk omdirigerer HTTP til dens HTTPS-versjon โ€”โ€”โ€” @@ -1361,44 +1359,3 @@ finans.dk##.baPosition ||storustovu.dk^ !+ NOT_OPTIMIZED ||campingnews.dk^ -! ๐Ÿ‡ณ๐Ÿ‡ด/๐Ÿ‡ฉ๐Ÿ‡ฐ: โ€”โ€”โ€” Anti-anti-reklameblokkering โ€”โ€”โ€” -! ๐Ÿ‡ฎ๐Ÿ‡ธ: โ€”โ€”โ€” And-and-auglรฝsingshindrun โ€”โ€”โ€” -! ๐Ÿ‡ฌ๐Ÿ‡ง: โ€”โ€”โ€” Anti-anti-adblocking โ€”โ€”โ€” -! Last updated: 10June2020v1-Extension -gratiskostplaner.dk##+js(aopw, KillAdBlock) -aftenposten.no##div[style*="width: 10"][style*="z-index: 2147"] -csp.screen9.com#@#.adsbox -dagensbyggeri.dk##+js(std, (), 2500) -eurosport.*##+js(aeld, contextmenu) -godt.no##.adblock-info-box -gratisspil.dk##+js(aopw, AdBlockerInfo) -langaa-guiden.dk,madforfattigroeve.dk##div[class][style*="z-index: 9999999; opacity"] -langaa-guiden.dk,madforfattigroeve.dk##div[class][style^="z-index: 999999; background: rgba"] -minmote.no,godt.no##.adblock-info -techstart.dk##+js(set, adblock, false) -tv2.no##+js(acis, adblockDetector) -vg.no##+js(aeld, load, concat) -tipsbladet.dk##.js-isblured:style(-webkit-filter: none !important; filter: none !important) -tipsbladet.dk###js-promo-welcome -abcnyheter.no##div[style^="bottom: 0px;"] -||aftenposten.no/seksjon/dist/ads-$script -||dni-adops-proxy-prod-adopsmediaconverter.mercury.dnitv.com/$media,redirect=noopmp3-0.1s,domain=dplay.* -||elderlyscissors.com^ -||imasdk.googleapis.com/pal/sdkloader/pal.js$script,redirect=noopjs,domain=dplay.* -||vg.no/cnp-assets/src/sites/vg/components/AdblockModal$script,~third-party -@@.dk/assets/templates/*/ads.png$image,domain=maskinbladet.dk|agrar-plus.dk|fritidsmarkedet.dk|dagensbyggeri.dk|maskinteknik.dk|gronteknik.dk -@@/js/ads.js$~third-party,domain=tvkampen.com|tvsporten.dk -@@||bondebladet.screen9.tv^$generichide -@@||eurosport.*^$generichide -@@||fwmrm.net/ad/$script,domain=dplay.* -@@||sixscissors.com^$third-party,domain=itavisen.no -@@||www.tv2.no/s/js/ads.js$script,~third-party -gamereactor.*##+js(set, adblockEnabled, noopFunc) -gamereactor.*##+js(set, trackAdblock, noopFunc) -!#if !ext_ublock -@@||bildeler.name$generichide -@@||reservedele.name$generichide -!#endif -!#if env_firefox -gamereactor.*##^script[onError="adblockEnabled()"] -!#endif diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersBrave.txt b/NorwegianExperimentalList alternate versions/NordicFiltersBrave.txt index cf342cf56..1a1991b12 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersBrave.txt +++ b/NorwegianExperimentalList alternate versions/NordicFiltersBrave.txt @@ -1,5 +1,5 @@ [Adblock Plus 3.4] -! Version: 10June2020v3-Alpha +! Version: 12June2020v1-Alpha ! Title: ๐Ÿ”๏ธ Dandelion Sprouts nordiske filtre for ryddigere nettsider (for Brave Browser) ! Translated title: Dandelion Sprout's Nordic filters for tidier websites (for Brave Browser) ! Expires: 12 hours diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersPrivacy.txt b/NorwegianExperimentalList alternate versions/NordicFiltersPrivacy.txt index cf2e8b45b..71e2c10e6 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersPrivacy.txt +++ b/NorwegianExperimentalList alternate versions/NordicFiltersPrivacy.txt @@ -1,4 +1,4 @@ -! Version: 10June2020v3 +! Version: 12June2020v1 ! Title: ๐Ÿ”๏ธ Dandelion Sprouts nordiske filtre for ryddigere nettsider (uten sporerhvitelisting) ! Translated title: Dandelion Sprout's Nordic filters for tidier websites (without tracker whitelistings) ! Expires: 12 hours @@ -916,9 +916,7 @@ krom.is#@#.share-container !#endif -!#if !adguard !#include NorwegianExperimentalList%20alternate%20versions/AntiAdblockEntries.txt -!#endif ! ๐Ÿ‡ณ๐Ÿ‡ด: โ€”โ€”โ€” Forsรธker รฅ fรฅ nettleseren til รฅ laste inn filer i HTTPS, dersom nettstedet ikke automatisk omdirigerer HTTP til dens HTTPS-versjon โ€”โ€”โ€” diff --git a/NorwegianExperimentalList alternate versions/NordicFiltersPrivoxy.action b/NorwegianExperimentalList alternate versions/NordicFiltersPrivoxy.action index 0828afd81..c3c6c488f 100644 --- a/NorwegianExperimentalList alternate versions/NordicFiltersPrivoxy.action +++ b/NorwegianExperimentalList alternate versions/NordicFiltersPrivoxy.action @@ -1,4 +1,4 @@ -# Version: 10June2020v3-Alpha +# Version: 12June2020v1-Alpha # Title: ๐Ÿ”๏ธ Dandelion Sprouts nordiske filtre for ryddigere nettsider (for Privoxy) # Translated title: Dandelion Sprout's Nordic filters for tidier websites (for Privoxy) # Expires: 12 hours @@ -301,8 +301,6 @@ contentMarketing # # # -# -# # ๐Ÿ‡ณ๐Ÿ‡ด: โ€”โ€”โ€” Forsรธker รฅ fรฅ nettleseren til รฅ laste inn filer i HTTPS, dersom nettstedet ikke automatisk omdirigerer HTTP til dens HTTPS-versjon โ€”โ€”โ€” {+block{โ€”โ€”โ€” 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. diff --git a/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py b/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py index c7c3d74db..ede2a6288 100644 --- a/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py +++ b/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py @@ -10,7 +10,6 @@ UNSUPPORTED_PRIVOXY = ['##', '#@#', '#?#', '@@', '!#'] UNSUPPORTED_BRAVE = ['##', '#@#', '#?#', '!#', '!+', '$csp', '$generichide', '$elemhide', '$specificblock', '$redirect', ',redirect', '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'] OUTPUT = 'xyzzyx.txt' -OUTPUT_AG = 'NordicFiltersAdGuard.txt' OUTPUT_ABP = 'NordicFiltersABP.txt' OUTPUT_TPL = 'DandelionSproutsNorskeFiltre.tpl' OUTPUT_PRIVOXY = 'NordicFiltersPrivoxy.action' @@ -25,217 +24,6 @@ def download_filters() -> str: text += r.text return text -# โ€”โ€”โ€” AdGuard version โ€”โ€”โ€” - -# function that prepares the filter list for AdGuard -def prepare_ag(lines) -> str: - text = '' - - for line in lines: - - # until this is done: https://github.com/AdguardTeam/CoreLibs/issues/152 - line = re.sub( - r"([\$,])doc.*", - r"\1empty,important", - line - ) - - line = re.sub( - r"(itle:.*Dandelion Sprout.*)", - r"\1 (for AdGuard)", - line - ) - - line = re.sub( - r"! Version: [0-9]{4}.*", - "", - line - ) - - line = re.sub( - "\[Adblock Plus 3.4\]", - "[AdGuard โ‰ฅ7.2]", - line - ) - - line = re.sub( - r"! Redirect:.*", - "", - line - ) - - line = re.sub( - r"([$,])xhr", - r"\1xmlhttprequest", - line - ) - - line = re.sub( - r"([$,~])3p", - r"\1third-party", - line - ) - - line = re.sub( - r"([$,])1p", - r"\1~third-party", - line - ) - - line = re.sub( - "redirect=noopmp4-1s", - "mp4", - line - ) - - line = re.sub( - r"^!.*PFBLOCKERNG.*", - r"", - line - ) - - line = re.sub( - r"^\|\|(([1-2]?[0-9]?[0-9]\.?){4})\^\$.*", - r"\1$network", - line - ) - - line = re.sub( - r"^\|\|(([1-2]?[0-9]?[0-9]\.?){4})\^", - r"\1$network", - line - ) - - line = re.sub( - r"([a-z*])#[?]?#(.*):(upward|nth-ancestor)\(1\)", - r"\1#?#*:has(> \2)", - line - ) - - line = re.sub( - r"([a-z*])#[?]?#(.*):(upward|nth-ancestor)\(2\)", - r"\1#?#*:has(> * > \2)", - line - ) - - line = re.sub( - r"([a-z*])#[?]?#(.*):(upward|nth-ancestor)\(3\)", - r"\1#?#*:has(> * > * > \2)", - line - ) - - line = re.sub( - 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)", - 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"has\(:scope >", - r"has(>", - line - ) - - line = re.sub( - r":-abp-has\(", - r":has(", - line - ) - - line = re.sub( - r":-abp-contains\(", - r":has-text(", - line - ) - - line = re.sub( - r"domain=dplay\.no\|dplay\.dk", - r"domain=dplay.*", - line - ) - - line = re.sub( - r"domain=auth.dplay\.no\|auth.dplay\.dk", - r"domain=auth.dplay.*", - line - ) - - line = re.sub( - r"domain=gamereactor\.no\|gamereactor\.dk", - r"domain=gamereactor.*", - line - ) - - line = re.sub( - r"\|gamereactor\.no\|gamereactor\.dk", - r"|gamereactor.*", - line - ) - - line = re.sub( - r"domain=viafree\.no\|viafree\.dk", - r"domain=viafree.*", - line - ) - - line = re.sub( - r"domain=eniro.se\|eniro\.no\|eniro\.dk", - r"domain=eniro.*", - line - ) - - line = re.sub( - r"domain=eurosport\.no\|eurosport\.dk", - r"domain=eurosport.*", - line - ) - - line = re.sub( - r"\|proff.se\|proff\.no\|proff\.dk", - r"|proff.*", - line - ) - - text += line + '\r\n' - - return text - # โ€”โ€”โ€” Adblock Plus version โ€”โ€”โ€” def is_supported_abp(line) -> bool: @@ -1423,7 +1211,6 @@ if __name__ == "__main__": lines = text.splitlines(False) print('Total number of rules: ' + str(len(lines))) - ag_filter = prepare_ag(lines) abp_filter = prepare_abp(lines) tpl_filter = prepare_tpl(lines) privoxy_filter = prepare_privoxy(lines) @@ -1433,9 +1220,6 @@ if __name__ == "__main__": with open(OUTPUT, "w") as text_file: text_file.write(text) - with open(OUTPUT_AG, "w") as text_file: - text_file.write(ag_filter) - with open(OUTPUT_ABP, "w") as text_file: text_file.write(abp_filter) @@ -1466,6 +1250,7 @@ UNSUPPORTED_ABP = ['$important', ',important', '$redirect=', ',redirect=', OUTPUT = 'xyzzyxeyeo.txt' OUTPUT_ABP = 'NordicFiltersABP-Eyeo.txt' +OUTPUT_AG = 'NordicFiltersAdGuard.txt' # function that downloads the filter list def download_filters() -> str: @@ -1906,6 +1691,223 @@ def prepare_abp(lines) -> str: return text +# โ€”โ€”โ€” AdGuard version โ€”โ€”โ€” + +# function that prepares the filter list for AdGuard +def prepare_ag(lines) -> str: + text = '' + + for line in lines: + + # until this is done: https://github.com/AdguardTeam/CoreLibs/issues/152 + line = re.sub( + r"([\$,])doc.*", + r"\1empty,important", + line + ) + + line = re.sub( + r"(itle:.*Dandelion Sprout.*)", + r"\1 (for AdGuard)", + line + ) + + line = re.sub( + r"! Version: [0-9]{4}.*", + "", + line + ) + + line = re.sub( + "\[Adblock Plus 3.4\]", + "[AdGuard โ‰ฅ7.2]", + line + ) + + line = re.sub( + r"! Redirect:.*", + "", + line + ) + + line = re.sub( + r"([$,])xhr", + r"\1xmlhttprequest", + line + ) + + line = re.sub( + r"([$,~])3p", + r"\1third-party", + line + ) + + line = re.sub( + r"([$,])1p", + r"\1~third-party", + line + ) + + line = re.sub( + "redirect=noopmp4-1s", + "mp4", + line + ) + + line = re.sub( + r"^!.*PFBLOCKERNG.*", + r"", + line + ) + + line = re.sub( + r"^\|\|(([1-2]?[0-9]?[0-9]\.?){4})\^\$.*", + r"\1$network", + line + ) + + line = re.sub( + r"^\|\|(([1-2]?[0-9]?[0-9]\.?){4})\^", + r"\1$network", + line + ) + + line = re.sub( + r"([a-z*])#[?]?#(.*):(upward|nth-ancestor)\(1\)", + r"\1#?#*:has(> \2)", + line + ) + + line = re.sub( + r"([a-z*])#[?]?#(.*):(upward|nth-ancestor)\(2\)", + r"\1#?#*:has(> * > \2)", + line + ) + + line = re.sub( + r"([a-z*])#[?]?#(.*):(upward|nth-ancestor)\(3\)", + r"\1#?#*:has(> * > * > \2)", + line + ) + + line = re.sub( + 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)", + 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"has\(:scope >", + r"has(>", + line + ) + + line = re.sub( + r":-abp-has\(", + r":has(", + line + ) + + line = re.sub( + r":-abp-contains\(", + r":has-text(", + line + ) + + line = re.sub( + r"domain=dplay\.no\|dplay\.dk", + r"domain=dplay.*", + line + ) + + line = re.sub( + r"domain=auth.dplay\.no\|auth.dplay\.dk", + r"domain=auth.dplay.*", + line + ) + + line = re.sub( + r"domain=gamereactor\.no\|gamereactor\.dk", + r"domain=gamereactor.*", + line + ) + + line = re.sub( + r"\|gamereactor\.no\|gamereactor\.dk", + r"|gamereactor.*", + line + ) + + line = re.sub( + r"domain=viafree\.no\|viafree\.dk", + r"domain=viafree.*", + line + ) + + line = re.sub( + r"domain=eniro.se\|eniro\.no\|eniro\.dk", + r"domain=eniro.*", + line + ) + + line = re.sub( + r"domain=eurosport\.no\|eurosport\.dk", + r"domain=eurosport.*", + line + ) + + line = re.sub( + r"\|proff.se\|proff\.no\|proff\.dk", + r"|proff.*", + line + ) + + line = re.sub( + r"!#include NorwegianExperimentalList%20alternate%20versions/AntiAdblockEntries\.txt", + r"!#include AntiAdblockEntries.txt", + line + ) + + text += line + '\r\n' + + return text + if __name__ == "__main__": print('Starting the script') text = download_filters() @@ -1913,6 +1915,7 @@ if __name__ == "__main__": print('Total number of rules: ' + str(len(lines))) abp_filter = prepare_abp(lines) + ag_filter = prepare_ag(lines) with open(OUTPUT, "w") as text_file: text_file.write(text) @@ -1920,7 +1923,10 @@ if __name__ == "__main__": with open(OUTPUT_ABP, "w") as text_file: text_file.write(abp_filter) - print('The Eyeo list version has been generated.') + with open(OUTPUT_AG, "w") as text_file: + text_file.write(ag_filter) + + print('The Eyeo and AdGuard list versions have been generated.')