Squid Proxy — EasyList to SquidGuard Expression List Conversion

Hi all! It’s seems to be difficult to keep up with the EasyList expression lists, and to make matters more confusing, the conversion from one EasyList expression list to SquidGuard can be cumbersome. There are a few article out on Google that people have posted their own SED files to convert from EasyList to squidGuard, that will manipulate the EasyList expression list and convert it to be compatible with SquidGuard. However, most are outout of date and will cause squidGuard to fail to initialize the expression list when issuing a

>squidGuard -C all


I found a site whose owner (I believe) has developed a new SED file that will parse through the latest easylist.txt expression list file and convert it successfully. The site appears to be in Russian, and Google Translate is not able to translate it. Therefore, the purpose of this article is to increase the authors visibility of their SED file.

NOTICE: I am not the owner of the SED file below, no do I take any responsibility for it’s use and distribution.
From https://sites.google.com/site/uttools/squid-adblocker

s/r//g;
/Adblock/d;
/.*$.*/d;
/n/d;
/.*#.*/d;
/@@.*/d;
/^!.*/d;
/^[.*]$/d;
s#http://#||#g;
s////||/g
s,[+.?&/|],\&,g;
s/[/\[/g
s/]/\]/g
s#*#.*#g;
s,$.*$,,g;
s/\|\|(.*)^(.*)/.1\/2/g;
s/\|\|(.*)/.1/g;
/^.*$/d;
/^$/d;

Download the latest easylist.txt expression list.
https://easylist-downloads.adblockplus.org/easylist.txt

Commands:

cd /tmp
vi pattern.sed

–Paste in the SED pattern from above.

wget –no-check-certificate https://easylist-downloads.adblockplus.org/easylist.txt
cat easylist.txt | sed -f pattern.sed > expressions

Now just append or replace your current SquidGuard expression list, and don’t forget to issue a

>squidGuard -C all

to re-initializes your block and expression lists.

Sources: