mirror of
https://github.com/DandelionSprout/adfilt.git
synced 2026-09-30 22:05:16 +01:00
Merge branch 'main' into master
This commit is contained in:
+19
-7
@@ -23,9 +23,21 @@
|
||||
|
||||
import json
|
||||
import sys
|
||||
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
|
||||
|
||||
|
||||
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)
|
||||
@@ -102,16 +114,16 @@ 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())
|
||||
endrules = open("uBO list extensions/clear_urls_uboified.txt","w")
|
||||
endrules.write("! Title: ClearURLs for uBlock Origin\n")
|
||||
endrules.write("! Homepage: https://github.com/DandelionSprout/adfilt\n")
|
||||
endrules.write("! Expires: 1 day\n\n")
|
||||
endrules = open("uBO list extensions/clear_urls_uboified.txt", "w")
|
||||
endrules.write(HEAD.format(date=date.today().strftime("%d/%m/%Y")))
|
||||
|
||||
# TODO: referralMarketing
|
||||
providers = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
! Title: ClearURLs for uBlock Origin
|
||||
! Homepage: https://github.com/DandelionSprout/adfilt
|
||||
! Expires: 1 day
|
||||
! 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.*
|
||||
|
||||
Reference in New Issue
Block a user