Php script to download and format otherwise unsupported lists

Just a lil script php script i quickly tossed together to generate domain only lists from list who are intended to use which adblock and alike, without blocking tons of pages who are supposed to be blocked (thirdparty, specific paths on a domain and whatever). You can add other lists aswell, those are just what i use.

Download:

Install:
Paste the script to /var/www/html/pihole/parser.php
Add it to the adlist.list file

http://localhost/pihole/parser.php?list=antipopads
http://localhost/pihole/parser.php?list=adware_filters
http://localhost/pihole/parser.php?list=easyprivacy_easylist
http://localhost/pihole/parser.php?list=adguard_dns
http://localhost/pihole/parser.php?list=fanboy_ultimate
http://localhost/pihole/parser.php?list=blockzilla
http://localhost/pihole/parser.php?list=openpish
http://localhost/pihole/parser.php?list=malwareurls
http://localhost/pihole/parser.php?list=adguard_mobile
http://localhost/pihole/parser.php?list=easylist_de
http://localhost/pihole/parser.php?list=adguard_en
http://localhost/pihole/parser.php?list=adguard_de
http://localhost/pihole/parser.php?list=aak
http://localhost/pihole/parser.php?list=adguard_safari
http://localhost/pihole/parser.php?list=adguard_ru
http://localhost/pihole/parser.php?list=adguard_spy
http://localhost/pihole/parser.php?list=adguard_annoy
http://localhost/pihole/parser.php?list=adguard_jap
http://localhost/pihole/parser.php?list=adguard_nl
http://localhost/pihole/parser.php?list=adguard_es
http://localhost/pihole/parser.php?list=adguard_fr

Optional arguments:

http://localhost/pihole/parser.php?list=openpish&allowpath //block the whole domain if example.com/ads/ads.htm is listed ...
http://localhost/pihole/parser.php?list=all //output all lists at once, will time out if you add too many

Edit:
Updated

2 Likes

I will take a look at this,,, I like having multiple ways to do the same thing.

I just started this thread, I put alot of work into putting together a script to help get pihole running faster.

I might look at adding this to my project.

Edit: I tested this script out and it works really well.

Here's the quick way to install this:

sudo wget https://pastebin.com/raw/dAAGmME9 -P /var/www/html/admin/

sudo mv /var/www/html/admin/dAAGmME9 /var/www/html/admin/parser.php

sudo echo "http://localhost/admin/parser.php?list=antipopads" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=adware_filters" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=easyprivacy_easylist" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=adguard_dns" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=fanboy_ultimate" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=blockzilla" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=openpish" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=malwareurls" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=adguard_mobile" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=easylist_de2" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=adguard_en" | sudo tee --append /etc/pihole/adlists.list

sudo echo "http://localhost/admin/parser.php?list=adguard_de" | sudo tee --append /etc/pihole/adlists.list
1 Like

This would be really cool if added directly to PiHole, with a webui page to add and remove lists from it.

Edit: If this were combined with Wally3k's block page classifications,, that would be even cooler!

Ad list management will be in the next release:

1 Like

My apologies if this is necroposting, but I followed your "quick way to install" steps, and it did not work.

The important thing to note is that I used my own version of the PHP, located at <?php/*types:adblock -> ||sub.domain.com^url -> http://sub.domain.com - Pastebin.com, rather than https://pastebin.com/raw/dAAGmME9. The ONLY difference is that I used different lists in my version of the PHP, and consequently used different echo commands.

When I update my lists, the lists referenced in the PHP and echo commands are created, and seem to update, but they have no data -- this is true in both the webgui and CLI. My blocked domains total does not change, but absolutely should.

Is there a reason that changing the links in parser.php would cause this? I'm at a loss as to what could be doing this.

well, you are using a wrong "type" on some lists, "adblock" is just for lists who use the adblock syntax. the script isnt smart enough to detect which one it should use. and you dont have to parse hosts like lists (http://someonewhocares.org/hosts/zero/hosts etc ...)

1 Like

Thanks! I didn't really grok the type -- thanks for explaining!