]> git.ipfire.org Git - dbl.git/commitdiff
sources: Consider ABP files as such without the header
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jan 2026 13:22:51 +0000 (13:22 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jan 2026 13:22:51 +0000 (13:22 +0000)
Some files don't have the [Adblock Plus] header, but they use ! as a
comment, so we can identify them that way.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/sources.py

index e0c33eae23106245dc97b184810370387c3845d5..5705daff0a398a22a9fabc0bbee14fe270209460 100644 (file)
@@ -396,7 +396,7 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True):
                        Called very early when we are detecting the format
                """
                # Check for the Adblock Plus header
-               if line == "[Adblock Plus]" or line.startswith("||"):
+               if line == "[Adblock Plus]" or line.startswith("!") or line.startswith("||"):
                        return Format.ADBLOCKPLUS
 
                # Is this a hosts file?