Filtering extended-ABP syntax (e.g. AdGuard)

Currently, pihole incorrectly filters lists with extended-ABP syntax (e.g. AdGuard).
For example:
youtube.com#%#//scriptlet('set-constant', 'google_ad_status', '1') is incorrectly placed in the database as youtube.com, thus blocking the entire website.

If possible, please add a filter to ignore such AdGuard-style entries also (so one can use the different AdGuard lists, apart from AdGuard DNS list).
AdGuard set of rules: How to create your own ad filters | AdGuard Knowledge Base

It makes no sense to use lists containing URL based blocking rules with a filtering DNS server like Pi-hole. Attempting to partially parse such lists are bound to produce results that may fail spectacularly in meeting the original intention of the list's creator.

If Pi-hole would be extended to recognise URL patterns like the above, it should stop parsing immediately and reject the entire list.

Pi-hole block only domains and accept only ABP (Adblock Plus) domain lists.
Other valid ABP entries are ignored, because Pi-hole cannot use them.

I couldn't find the #%# separator in the current ABP help.

I don't think the entry above is considered a valid ABP rule.
This list is using an unsupported format.

I am not sure that's an appropriate manner to handle such lists.

ABP-style lists have both URL-based filters and domain-based filters.
Pihole already correctly ignores the URL-based filters and keeps the domain-based filters from the same list instead of ignoring the entire list.

All I am requesting is to extend the regex which ignores the URL-based filters, to also ignore extended ABP syntax.

Yes, it is not valid ABP syntax.
Which is why I am requesting support for ignoring extended ABP syntax also (which AdGuard uses), instead of a bug fix. The rules are in the linked adguard page.

If a list curator would advertise that their lists can be used with DNS filters like Pi-hole, they are likely to offer a list that is tailored for that use case.

Could you share an example of a list that contains such an expression?

As a DNS filtering engine, Pi-hole will only ever receive requests for domains - it never sees URLs.

In such a list intended for a URL filter, a list curator may choose one of three basic approaches to handle domains and URL resources served by a domain:
a. They may generally block the domain and allow only specific resources
b. They may generally allow the domain and block only specific elements
c. They may both allow and and block only specific elements

Using such a list with Pi-hole would lead to block too much (in case of a.) or not blocking anything (in case of b. and c.).
It will never produce the results its curators wanted, as they intend it to be used with a URL fillter.

Just as you would not fill up your diesel engine with petrol, lists intended for an URL based blocker should not be used with Pi-hole.

I'd prefer Pi-hole to reject using the wrong fuel type altogether, rather than stuttering and choking on it.

1 Like

I agree completely. As a DNS server, Pi-hole performing URL filtering is bad design, and is best left to a proxy/firewall.

There is much to debate about the Unix design philosophy here. Specifically the part about "Do one thing and do it well"