scrapinghub / adblockparser

Python parser for Adblock Plus filters
MIT License
193 stars 29 forks source link

Easylist no longer supported? #14

Open gonedjur opened 6 years ago

gonedjur commented 6 years ago

I can't get any of the easylists to work at all?

>>> with open('fanboy_social_general_block.txt', 'rb') as f:
...     raw_rules = f.read().decode('utf8').splitlines()
>>> rules = AdblockRules(raw_rules)
>>> rules.should_block("http://www.facebook.com")
False
>>> with open('easylist.txt', 'rb') as f:
...     raw_rules = f.read().decode('utf8').splitlines()
>>> rules = AdblockRules(raw_rules)
>>> rules.should_block("http://ads.example.com")
False

Any ideas? Are they no longer compatible?

BookGin commented 5 years ago

@gonedjur Have you tried passing the third-party argument in options?

>>> from adblockparser import AdblockRules
>>> AdblockRules(['||example.com^$third-party']).should_block('example.com')
False
>>> AdblockRules(['||example.com^$third-party']).should_block('example.com', {'third-party': True})
True
swetang4 commented 2 years ago

I am facing the same problem. Every input returns false despite passing the third-party option in AdblockRules(). @gonedjur Please let me know if you were able to resolve this.