essandess / adblock2privoxy

Convert adblock config files to privoxy format
https://hackage.haskell.org/package/adblock2privoxy
GNU General Public License v3.0
93 stars 16 forks source link

empty rules #21

Closed wmyrda closed 6 years ago

wmyrda commented 6 years ago

I am not sure how should converter behave in such a cases, but if the rule is not possibile to convert into privoxy understood regex than pehaps it is better to skip it with error message instead of creating an empty rule?

Examples

{+client-header-tagger{ab2p-block-dnt-R390} \
}
# |http://$subdocument,third-party,domain=clictune.com (onelist.txt: 39648)
# |https://$subdocument,third-party,domain=clictune.com (onelist.txt: 39627)

or

{+client-header-tagger{ab2p-block-dnt-R436} \
}
# |https://$ping,popup,stylesheet,subdocument,third-party,domain=daclips.com|daclips.in|gorillavid.in|movpod.in (onelist.txt: 39346)
# |http://$ping,popup,stylesheet,subdocument,third-party,domain=daclips.com|daclips.in|gorillavid.in|movpod.in (onelist.txt: 38970)
wmyrda commented 6 years ago

Quick check says in those list I use combined is almost 2000 of such recodrs which would double in ab2p.action file given there will be rules set for dnt and block-elem

cat onelist.txt |grep '|http:\/\/\$'|wc
    975 
cat onelist.txt |grep '|https:\/\/\$'|wc
    903     903   91692

WORKAROUND: Before running adblock2privoxy one could add those grep statements to their script removing all those undesired records.

My current script among other include following statement

cat *.txt |grep -v -E -i -a '^\[|^!|^$|^~|\,\~www|\,\~ir\.|\,\~dea|\,\~all|\-abp\-|ipt:inj|\|(http|https):\/\/\$' >> ${scriptdir}/onelist.txt
essandess commented 6 years ago

These are the correct Privoxy actions for the supplied rules.