This took far, far longer than I thought it would

This commit is contained in:
Imre Kristoffer Eilertsen
2020-04-03 00:08:06 +02:00
committed by GitHub
parent a67261da11
commit c7c1d4af4f
3 changed files with 720 additions and 164 deletions
+97 -25
View File
@@ -222,12 +222,6 @@ def prepare_agh(lines) -> str:
line
)
line = re.sub(
r"^[/\\].*",
r"",
line
)
line = re.sub(
r"@?@?\|\|.*/.*",
r"",
@@ -289,13 +283,7 @@ def prepare_agh(lines) -> str:
)
line = re.sub(
r".*\*/[a-z0-9]*",
r"",
line
)
line = re.sub(
r"^[,=^/?~.-].*",
r"^[,=^?~.-].*",
r"",
line
)
@@ -306,12 +294,6 @@ def prepare_agh(lines) -> str:
line
)
line = re.sub(
r"^[,=^/?~.-].*",
r"",
line
)
line = re.sub(
r"^\.php\?$",
r"",
@@ -390,6 +372,36 @@ def prepare_agh(lines) -> str:
line
)
line = re.sub(
r"^/.*[a-z0-9_=.,*?|^@&~+;-]$",
r"",
line
)
line = re.sub(
r"^/.*[\]]$",
r"",
line
)
line = re.sub(
r"^://.*/.*",
r"",
line
)
line = re.sub(
r".*104\\\.154\\\.\..*",
r"",
line
)
line = re.sub(
r"^/.*[a-zA-Z0-9]\\?/[a-z0-9\(].*",
r"",
line
)
if is_supported_agh(line) and not line == '':
text += line + '\r\n'
@@ -661,12 +673,6 @@ def prepare_ip(lines) -> str:
line
)
line = re.sub(
r"^[/\\].*",
r"",
line
)
line = re.sub(
r"^@@.*[a-z].*",
r"",
@@ -691,6 +697,72 @@ def prepare_ip(lines) -> str:
line
)
line = re.sub(
r"^/.*[a-zA-Z0-9_=.,*?|^@&~+;-]$",
r"",
line
)
line = re.sub(
r"^/.*[\]]$",
r"",
line
)
line = re.sub(
r"^://.*/.*",
r"",
line
)
line = re.sub(
r".*104\\\.154\\\.\..*",
r"",
line
)
line = re.sub(
r"^/.*[a-z0-9]\\?/[a-z0-9\(].*",
r"",
line
)
line = re.sub(
r"^/\^[h.].*",
r"",
line
)
line = re.sub(
r"^/\\.*",
r"",
line
)
line = re.sub(
r"^/\(https\?:\\/\\/\)([0-9][0-9]?[0-9]?)\\.([0-9][0-9]?[0-9]?)\\.([0-9][0-9]?[0-9]?)\\.\.\*/",
r"\1.\2.\3.0/24",
line
)
line = re.sub(
r"^/\(https\?:\\/\\/\)([0-9][0-9]?[0-9]?)\\.([0-9][0-9]?[0-9]?)\\.\.\*/",
r"\1.\2.0.0/16",
line
)
line = re.sub(
r"^/.*",
r"",
line
)
line = re.sub(
r"^@@",
r"",
line
)
if is_supported_ip(line) and not line == '':
text += line + '\r\n'
File diff suppressed because it is too large Load Diff
@@ -3,8 +3,8 @@
! 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: 13February2020v1-Alpha
@@104.198.251.169
! Version: 02April2020v1-Alpha
104.198.251.169
104.154.237.93
174.142.194.177
194.71.107.25
@@ -18,11 +18,10 @@
74.117.182.77
78.138.126.253
78.140.131.214
104.154.0.0/16
104.197.0.0/16
104.198.0.0/16
130.211.0.0/16
142.91.0.0/16
142.91.159.0/24
216.21.0.0/16
51.158.0.0/16
51.77.227.100