mirror of
https://github.com/DandelionSprout/adfilt.git
synced 2026-09-24 18:50:12 +01:00
Hopefully fix it
This commit is contained in:
@@ -41,7 +41,7 @@ HEAD = """\
|
||||
! Note: This was based off of 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.
|
||||
! IMPORTANT NOTE: Do not modify this file in pull requests. This file is auto-generated and therefore any direct edit to it will be undone. Instead, modifications must be made to https://github.com/DandelionSprout/adfilt/blob/master/ClearURLs%20for%20uBo/compile.py or to the upstream ClearURLs rules. If you experience an issue, please report it to https://github.com/DandelionSprout/adfilt/discussions/163, and we (the Adfilt maintainers and community) will look into it and either add an exclusion or report it to the ClearURLs team.
|
||||
! Important note about the purpose of this list: this list can not bypass tracker redirects through third-party domains. This can be done by strict-blocking said domain and using the ability to view params on the strict-block page to bypass it.
|
||||
! The adfilt maintainers would like to thank https://github.com/rusty-snake for helping create this list.
|
||||
! The adfilt maintainers would like to thank https://github.com/rusty-snake for helping create this Python script
|
||||
|
||||
"""
|
||||
KNOWN_BAD_FILTERS = [
|
||||
@@ -140,7 +140,6 @@ def normalize_url_pattern(url_pattern: str) -> str:
|
||||
def normalize_exception(exception: str) -> tuple[str, str]:
|
||||
orig_exception = exception
|
||||
|
||||
exception = exception.replace(r"^https?:\\/\\/(?:[a-z0-9-]+\\.)*?\\.", "||", 1)
|
||||
exception = exception.replace(r"^https?:\/\/(?:[a-z0-9-]+\.)*?", "||", 1)
|
||||
exception = exception.replace(r"^https?:\/\/", "||", 1)
|
||||
# FIXME: |ws://
|
||||
@@ -158,6 +157,8 @@ def normalize_exception(exception: str) -> tuple[str, str]:
|
||||
|
||||
exception = exception.replace("\\", "")
|
||||
|
||||
exception = exception.replace("||.","||")
|
||||
|
||||
if any(c in "([" for c in exception):
|
||||
exception = orig_exception
|
||||
exception = exception.replace("(?:", "(")
|
||||
|
||||
Reference in New Issue
Block a user