From e57ddcf0c54f6e58e05a3b99a410a496ea8b4a67 Mon Sep 17 00:00:00 2001 From: iam-py-test <84232764+iam-py-test@users.noreply.github.com> Date: Sat, 6 Nov 2021 19:25:38 -0400 Subject: [PATCH 1/8] Update scripts/compile.py Fix the styling Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com> --- scripts/compile.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/compile.py b/scripts/compile.py index 87cb0f331..75038f20c 100644 --- a/scripts/compile.py +++ b/scripts/compile.py @@ -102,9 +102,11 @@ def print_rules( else: endrules.write(plain_format.format(rule, url_pattern) + "\n") -def getrules(): - import requests - return requests.get("https://raw.githubusercontent.com/ClearURLs/Rules/master/data.min.json").text +def getrules() -> str: + RULES = "https://raw.githubusercontent.com/ClearURLs/Rules/master/data.min.json" + return requests.get(RULES).text + + def main() -> int: global endrules data_min_json = json.loads(getrules()) From 9de66debb761b24f094fc4a0829dcad8ebcd2b0a Mon Sep 17 00:00:00 2001 From: iam-py-test <84232764+iam-py-test@users.noreply.github.com> Date: Sat, 6 Nov 2021 19:25:59 -0400 Subject: [PATCH 2/8] Add a space Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com> --- scripts/compile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/compile.py b/scripts/compile.py index 75038f20c..dd1ba9f82 100644 --- a/scripts/compile.py +++ b/scripts/compile.py @@ -110,7 +110,7 @@ def getrules() -> str: def main() -> int: global endrules data_min_json = json.loads(getrules()) - endrules = open("uBO list extensions/clear_urls_uboified.txt","w") + endrules = open("uBO list extensions/clear_urls_uboified.txt", "w") # TODO: referralMarketing providers = { From 69dde41cff3545b1d409b90e561090649fb62ef2 Mon Sep 17 00:00:00 2001 From: iam-py-test <84232764+iam-py-test@users.noreply.github.com> Date: Sat, 6 Nov 2021 19:26:58 -0400 Subject: [PATCH 3/8] Update scripts/compile.py Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com> --- scripts/compile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/compile.py b/scripts/compile.py index dd1ba9f82..750f0fca6 100644 --- a/scripts/compile.py +++ b/scripts/compile.py @@ -26,6 +26,7 @@ import sys endrules = None + def normalize_url_pattern(url_pattern: str) -> str: # No need for protocol and subdomain url_pattern = url_pattern.replace(r"^https?:\/\/(?:[a-z0-9-]+\.)*?", "", 1) From e5882d78cf2383df17473045daca43a75b7f8d3d Mon Sep 17 00:00:00 2001 From: iam-py-test <84232764+iam-py-test@users.noreply.github.com> Date: Sat, 6 Nov 2021 23:46:21 +0000 Subject: [PATCH 4/8] Update scripts/compile.py Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com> --- scripts/compile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/compile.py b/scripts/compile.py index 750f0fca6..e8342afdb 100644 --- a/scripts/compile.py +++ b/scripts/compile.py @@ -24,6 +24,8 @@ import json import sys +import requests + endrules = None From f0613a8507ea9fa9c435a8c74e306cb1fdfd1449 Mon Sep 17 00:00:00 2001 From: iam-py-test <84232764+iam-py-test@users.noreply.github.com> Date: Sun, 7 Nov 2021 11:30:03 +0000 Subject: [PATCH 5/8] Update scripts/compile.py Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com> --- scripts/compile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/compile.py b/scripts/compile.py index e8342afdb..89501ffd8 100644 --- a/scripts/compile.py +++ b/scripts/compile.py @@ -23,6 +23,7 @@ import json import sys +from datetime import date import requests From 3734c98fadb6e9496432101dea0e604412984937 Mon Sep 17 00:00:00 2001 From: iam-py-test <84232764+iam-py-test@users.noreply.github.com> Date: Sun, 7 Nov 2021 11:30:51 +0000 Subject: [PATCH 6/8] Add the head & date Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com> --- scripts/compile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/compile.py b/scripts/compile.py index 89501ffd8..280d07260 100644 --- a/scripts/compile.py +++ b/scripts/compile.py @@ -115,6 +115,7 @@ def main() -> int: global endrules data_min_json = json.loads(getrules()) endrules = open("uBO list extensions/clear_urls_uboified.txt", "w") + endrules.write(HEAD.format(date=date.today().strftime("%d/%m/%Y"))) # TODO: referralMarketing providers = { From ee006d13413b5b1021162cbf14e41c3e69e120a5 Mon Sep 17 00:00:00 2001 From: iam-py-test <84232764+iam-py-test@users.noreply.github.com> Date: Sun, 7 Nov 2021 11:31:06 +0000 Subject: [PATCH 7/8] Update scripts/compile.py Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com> --- scripts/compile.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/compile.py b/scripts/compile.py index 280d07260..44a912051 100644 --- a/scripts/compile.py +++ b/scripts/compile.py @@ -27,6 +27,14 @@ from datetime import date import requests +HEAD = """\ +! Title: ClearURLs for uBo - List extension +! Homepage: https://github.com/DandelionSprout/adfilt/discussions/163 +! Last updated: {date} +! Note: This was forked from https://gist.github.com/rusty-snake/5cd83a87d680ecbd03e79a1a06758207, which is based off of https://github.com/ClearURLs/Rules. The maintainers of Adfilt (DandelionSprout and iam-py-test, and contributors) have made some modifications as to keep it up-to-date with the source and to fix issues + +""" + endrules = None From a2d79f9232e24c37ac1887c46b924beba7d83cf4 Mon Sep 17 00:00:00 2001 From: Update bot Date: Sun, 7 Nov 2021 11:31:27 +0000 Subject: [PATCH 8/8] Update the list ClearURLs uBo list --- uBO list extensions/clear_urls_uboified.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uBO list extensions/clear_urls_uboified.txt b/uBO list extensions/clear_urls_uboified.txt index ad40a0528..1e5d4131c 100644 --- a/uBO list extensions/clear_urls_uboified.txt +++ b/uBO list extensions/clear_urls_uboified.txt @@ -1,3 +1,8 @@ +! Title: ClearURLs for uBo - List extension +! Homepage: https://github.com/DandelionSprout/adfilt/discussions/163 +! Last updated: 07/11/2021 +! Note: This was forked from https://gist.github.com/rusty-snake/5cd83a87d680ecbd03e79a1a06758207, which is based off of https://github.com/ClearURLs/Rules. The maintainers of Adfilt (DandelionSprout and iam-py-test, and contributors) have made some modifications as to keep it up-to-date with the source and to fix issues + $removeparam=/^p[fd]_rd_[a-z]*=/,domain=amazon.* $removeparam=qid,domain=amazon.* $removeparam=/^srs?=/,domain=amazon.*