Add files via upload

This commit is contained in:
Imre Kristoffer Eilertsen
2020-07-04 23:11:55 +02:00
committed by GitHub
parent 26bbc5cc6c
commit 06b0105545
8 changed files with 237 additions and 170 deletions
@@ -561,7 +561,7 @@ msFilterList
# 🇳🇴 🇩🇰: ——— Anti-anti-reklameblokkering ———
# 🇮🇸: ——— And-and-auglýsingshindrun ———
# 🇬🇧: ——— Anti-anti-adblocking ———
# Last updated: 10June2020v1-Extension
# Last updated: 04July2020v1-Extension
-d aftenposten.no ads-
-d dni-adops-proxy-prod-adopsmediaconverter.mercury.dnitv.com
-d elderlyscissors.com
@@ -571,3 +571,4 @@ msFilterList
+d sixscissors.com
+d bildeler.name
+d reservedele.name
- gamereactor.*
@@ -1,6 +1,6 @@
[Adblock Plus 3.4]
! Version: 020720204
! Title: 🏔️ Dandelion Sprouts vestnordiske filtre for ryddigere nettsider (for Adblock Plus - Møter ABP sine inkluderingregler)
! Title: 🏔️ Dandelion Sprouts vestnordiske filtre for ryddigere nettsider (for Adblock Plus - Møter ABP sine inkluderingsregler)
! Translated title: Dandelion Sprout's West Nordic filters for tidier websites (for Adblock Plus with ABP inclusion compliance)
! Expires: 12 hours
! Lisens / Licence: https://github.com/DandelionSprout/adfilt/blob/master/LICENSE.md
@@ -1339,7 +1339,7 @@ finans.dk##.baPosition
! 🇳🇴/🇩🇰: ——— Anti-anti-reklameblokkering ———
! 🇮🇸: ——— And-and-auglýsingshindrun ———
! 🇬🇧: ——— Anti-anti-adblocking ———
! Last updated: 10June2020v1-Extension
! Last updated: 04July2020v1-Extension
gratiskostplaner.dk#$#abort-on-property-write KillAdBlock
aftenposten.no##div[style*="width: 10"][style*="z-index: 2147"]
csp.screen9.com#@#.adsbox
@@ -1365,3 +1365,4 @@ abcnyheter.no##div[style^="bottom: 0px;"]
@@||www.tv2.no/s/js/ads.js$script,~third-party
@@||bildeler.name$generichide
@@||reservedele.name$generichide
gamereactor.*$$script[onError="adblockEnabled()"]
@@ -948,7 +948,7 @@ krom.is#@#.share-container
!#endif
!
!#include AntiAdblockEntries.txt
!
! 🇳🇴: ——— Forsøker å få nettleseren til å laste inn filer i HTTPS, dersom nettstedet ikke automatisk omdirigerer HTTP til dens HTTPS-versjon ———
@@ -1388,3 +1388,47 @@ finans.dk##.baPosition
||storustovu.dk^
!+ NOT_OPTIMIZED
||campingnews.dk^
! 🇳🇴/🇩🇰: ——— Anti-anti-reklameblokkering ———
! 🇮🇸: ——— And-and-auglýsingshindrun ———
! 🇬🇧: ——— Anti-anti-adblocking ———
! Last updated: 04July2020v1-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
!#if !ext_ublock
gamereactor.*$$script[onError="adblockEnabled()"]
!#endif
@@ -632,7 +632,7 @@ gamereactor.*##+js(nano-stb)
! 🇳🇴/🇩🇰: ——— Anti-anti-reklameblokkering ———
! 🇮🇸: ——— And-and-auglýsingshindrun ———
! 🇬🇧: ——— Anti-anti-adblocking ———
! Last updated: 10June2020v1-Extension
! Last updated: 04July2020v1-Extension
gratiskostplaner.dk##+js(aopw, KillAdBlock)
dagensbyggeri.dk##+js(std, (), 2500)
eurosport.*##+js(aeld, contextmenu)
@@ -660,3 +660,6 @@ gamereactor.*##+js(set, trackAdblock, noopFunc)
!#endif
!#if env_firefox
!#endif
!#if !ext_ublock
gamereactor.*$$script[onError="adblockEnabled()"]
!#endif
@@ -1391,7 +1391,7 @@ finans.dk##.baPosition
! 🇳🇴/🇩🇰: ——— Anti-anti-reklameblokkering ———
! 🇮🇸: ——— And-and-auglýsingshindrun ———
! 🇬🇧: ——— Anti-anti-adblocking ———
! Last updated: 10June2020v1-Extension
! Last updated: 04July2020v1-Extension
gratiskostplaner.dk##+js(aopw, KillAdBlock)
aftenposten.no##div[style*="width: 10"][style*="z-index: 2147"]
csp.screen9.com#@#.adsbox
@@ -1429,3 +1429,6 @@ gamereactor.*##+js(set, trackAdblock, noopFunc)
!#if env_firefox
gamereactor.*##^script[onError="adblockEnabled()"]
!#endif
!#if !ext_ublock
gamereactor.*$$script[onError="adblockEnabled()"]
!#endif
@@ -657,7 +657,7 @@ contentMarketing
# 🇳🇴/🇩🇰: ——— Anti-anti-reklameblokkering ———
# 🇮🇸: ——— And-and-auglýsingshindrun ———
{+block{——— Anti-anti-adblocking ———}}
# Last updated: 10June2020v1-Extension
# Last updated: 04July2020v1-Extension
.aftenposten.no/seksjon/dist/ads-
.dni-adops-proxy-prod-adopsmediaconverter.mercury.dnitv.com/
.elderlyscissors.com
@@ -667,3 +667,6 @@ contentMarketing
#
#
#
#
gamereactor.*
#
@@ -10,6 +10,7 @@ UNSUPPORTED_PRIVOXY = ['##', '#@#', '#?#', '@@', '!#']
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']
OUTPUT = 'xyzzyx.txt'
OUTPUT_AG = 'NordicFiltersAdGuard.txt'
OUTPUT_ABP = 'NordicFiltersABP.txt'
OUTPUT_TPL = 'DandelionSproutsNorskeFiltre.tpl'
OUTPUT_PRIVOXY = 'NordicFiltersPrivoxy.action'
@@ -24,6 +25,175 @@ 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"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"",
line
)
line = re.sub(
r"##\^script:has-text\((.*)\)",
r"$$script[\1]",
line
)
line = re.sub(
r"##\^script\[(.*)\]",
r"$$script[\1]",
line
)
text += line + '\r\n'
return text
# ——— Adblock Plus version ———
def is_supported_abp(line) -> bool:
@@ -1139,6 +1309,7 @@ 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)
@@ -1148,6 +1319,9 @@ 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)
@@ -1178,7 +1352,6 @@ UNSUPPORTED_ABP = ['$important', ',important', '$redirect=', ',redirect=',
OUTPUT = 'xyzzyxeyeo.txt'
OUTPUT_ABP = 'NordicFiltersABP-Inclusion.txt'
OUTPUT_AG = 'NordicFiltersAdGuard.txt'
# function that downloads the filter list
def download_filters() -> str:
@@ -1226,7 +1399,7 @@ def prepare_abp(lines) -> str:
line = re.sub(
"Dandelion Sprouts nordiske filtre for ryddigere nettsider",
"Dandelion Sprouts vestnordiske filtre for ryddigere nettsider (for Adblock Plus - Møter ABP sine inkluderingregler)",
"Dandelion Sprouts vestnordiske filtre for ryddigere nettsider (for Adblock Plus - Møter ABP sine inkluderingsregler)",
line
)
@@ -1619,163 +1792,6 @@ 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"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()
@@ -1783,7 +1799,6 @@ 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)
@@ -1791,9 +1806,6 @@ if __name__ == "__main__":
with open(OUTPUT_ABP, "w") as text_file:
text_file.write(abp_filter)
with open(OUTPUT_AG, "w") as text_file:
text_file.write(ag_filter)
print('The Eyeo and AdGuard list versions have been generated.')