Major list compression efforts

This commit is contained in:
Imre Kristoffer Eilertsen
2020-05-06 18:14:01 +02:00
committed by GitHub
parent 88c071f7d9
commit a6ecae60fb
3 changed files with 195 additions and 3927 deletions
+33 -45
View File
@@ -1,9 +1,9 @@
import requests
import re
SOURCES = ['https://gitlab.com/DandelionSprout/adfilt/raw/master/AdGuard%20Home%20Compilation%20List/TopDescription.notlist', 'https://easylist-downloads.adblockplus.org/easylist_noelemhide.txt', 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt', 'https://raw.githubusercontent.com/NanoAdblocker/NanoFilters/master/NanoMirror/NanoDefender.txt', 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt', 'https://easylist-downloads.adblockplus.org/liste_fr.txt', 'https://www.i-dont-care-about-cookies.eu/abp/', 'https://easylist-downloads.adblockplus.org/easylistgermany.txt', 'https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt', 'https://easylist-downloads.adblockplus.org/antiadblockfilters.txt', 'https://easylist-downloads.adblockplus.org/advblock.txt', 'https://easylist-downloads.adblockplus.org/Liste_AR.txt', 'https://easylist-downloads.adblockplus.org/easylistspanish.txt', 'https://raw.githubusercontent.com/AdguardTeam/AdguardFilters/master/AnnoyancesFilter/sections/push-notifications.txt', 'https://easylist-downloads.adblockplus.org/fanboy-notifications.txt']
SOURCES = ['https://gitlab.com/DandelionSprout/adfilt/raw/master/AdGuard%20Home%20Compilation%20List/TopDescription.notlist', 'https://easylist-downloads.adblockplus.org/easylist_noelemhide.txt', 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt', 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters-2020.txt', 'https://raw.githubusercontent.com/NanoAdblocker/NanoFilters/master/NanoMirror/NanoDefender.txt', 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt', 'https://easylist-downloads.adblockplus.org/liste_fr.txt', 'https://www.i-dont-care-about-cookies.eu/abp/', 'https://easylist-downloads.adblockplus.org/easylistgermany.txt', 'https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt', 'https://easylist-downloads.adblockplus.org/antiadblockfilters.txt', 'https://easylist-downloads.adblockplus.org/advblock.txt', 'https://easylist-downloads.adblockplus.org/Liste_AR.txt', 'https://easylist-downloads.adblockplus.org/easylistspanish.txt', 'https://raw.githubusercontent.com/AdguardTeam/AdguardFilters/master/AnnoyancesFilter/sections/push-notifications.txt', 'https://easylist-downloads.adblockplus.org/fanboy-notifications.txt']
UNSUPPORTED_AGH = ['##', '@#', '#?#', '#%#', '!+', 'domain=', 'generichide', '$csp', 'xmlhttprequest', '$xhr', '$stylesheet', '$elemhide', '$inline-script', '$other', '$~object', 'redirect=', '#$#', '$domain', ',domain' ]
UNSUPPORTED_AGH = ['##', '@#', '#?#', '#%#', '!+', 'domain=', 'generichide', '$csp', 'xmlhttprequest', '$xhr', '$stylesheet', '$elemhide', '$inline-script', '$other', '$~object', 'redirect=', '#$#', '$domain', ',domain', '[Adblock Plus 2.0]']
UNSUPPORTED_IP = ['##', '@#', '#?#', '#%#', 'domain=', 'generichide', '$csp', 'badfilter', 'xmlhttprequest', '$xhr', '$stylesheet', '$elemhide', '$inline-script', '$other', '$~object', 'redirect=', '#$#', '!+']
OUTPUT = 'xyzzyx.txt'
@@ -325,49 +325,7 @@ def prepare_agh(lines) -> str:
)
line = re.sub(
r"! https?://forums\.lanik\.us.*",
r"",
line
)
line = re.sub(
r"! https?://www\.reddit\.com/r/uBlockOrigin.*",
r"",
line
)
line = re.sub(
r"! https?://github\.com/uBlockOrigin.*",
r"",
line
)
line = re.sub(
r"! https://github\.com/NanoMeow.*",
r"",
line
)
line = re.sub(
r"! https://github\.com/jspenguin2017/uBlockProtector.*",
r"",
line
)
line = re.sub(
r"! https://github.com/reek/anti-adblock-killer.*",
r"",
line
)
line = re.sub(
r"! https://github.com/NanoAdblocker.*",
r"",
line
)
line = re.sub(
r"! https://github\.com/jspenguin2017/uBlockProtector.*",
r"^! http.*",
r"",
line
)
@@ -438,6 +396,36 @@ def prepare_agh(lines) -> str:
line
)
line = re.sub(
r"^! Checksum:.*",
r"",
line
)
line = re.sub(
r".*\(update frequency\)",
r"",
line
)
line = re.sub(
r"^! 20(1|2).*",
r"",
line
)
line = re.sub(
r"^! Ref:.*",
r"",
line
)
line = re.sub(
r"^! #",
r"",
line
)
if is_supported_agh(line) and not line == '':
text += line + '\r\n'
File diff suppressed because it is too large Load Diff
@@ -3,7 +3,7 @@
! Expires: 14 days
! Licence: In accordance with the Dandelicence, the borrowed entries are considered to have been changed and reduced enough from their original lists, that they're counted as transformative work, meaning that creditation and seperate paragraphs are not necessary unless one of the lists' makers were to ask for such.
! Description: This was made as a proof-of-concept to see if the IP-based entries of major adblock lists, could be used to create an IP adblocker list for IP blockers, despite how IP lists are normally only meant to block malware, E-mail spam, or port scanners.
! Version: 03May2020v1-Alpha
! Version: 06May2020v1-Alpha
104.154.237.93
174.142.194.177
194.71.107.25