From 5eb1cd54bbcd84f56f040cf165abf5e75df93300 Mon Sep 17 00:00:00 2001 From: Juxhin Dyrmishi Brigjaj Date: Tue, 4 Feb 2025 18:08:57 +0100 Subject: [PATCH] misc: fix trimming wildcard tlds --- .github/workflows/update-tlds.yml | 4 ++-- twistrs/data/update-psl.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-tlds.yml b/.github/workflows/update-tlds.yml index 95ae19c..a9f1360 100644 --- a/.github/workflows/update-tlds.yml +++ b/.github/workflows/update-tlds.yml @@ -13,8 +13,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python uses: actions/setup-python@v4 @@ -31,4 +29,6 @@ jobs: - name: Run update script run: python twistrs/data/update-psl.py + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/twistrs/data/update-psl.py b/twistrs/data/update-psl.py index 4a45f8c..1db3aad 100644 --- a/twistrs/data/update-psl.py +++ b/twistrs/data/update-psl.py @@ -38,7 +38,7 @@ def parse_psl(psl_text): if not line or line.startswith("//"): continue # Remove any leading exclamation marks or wildcards (e.g. "!city." or "*.") - cleaned = re.sub(r"^(?:!\*\.|!\.|!\*|[\*!]+)", "", line) + cleaned = re.sub(r"^(?:!\*\.|!\.|!\*|^[\*.!]+)", "", line) valid_lines.append(cleaned) return sorted(valid_lines)