[Script] Adblock Plus Filters for Privoxy (without Optware)

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
justyourimage
DD-WRT User


Joined: 04 Nov 2014
Posts: 113

PostPosted: Thu Nov 27, 2014 21:31    Post subject: [Script] Adblock Plus Filters for Privoxy (without Optware) Reply with quote
Last Update: 141512-1 @ Sun, 15th December 2014

Well I thought I'd share my modification of the original AdblockPlus to Privoxy Script from Andrwe here:

http://andrwe.org/scripting/bash/privoxy-blocklist (BEWARE THIS IS THE ORIGINAL SCRIPT NOT MADE FOR DD-WRT!!!)

It 's modified to be used with the recent DD-WRT builds from BS and Kong Builds 23900 upwards and was tested with my R7000 running both the last BS builds as well 23900 Kong OLDD.

Unlike the Original Script this doesn't require Bash 4, Optware or any special Binaries at all (besides the ones being delivered with the mentioned build). So it should work with any ARM based router running the above Build or similar.

The only requirements are of course Privoxy and /jffs (I'm not going into detail as to how to create a /jffs storage). Privoxy doesn't even have to be build into the Firmware itself - however if you use (like me) Build 25408 or newer I'd recommend to copy the initial Privoxy config from /etc/privoxy/ to /jffs/etc/privoxy/ or the directory you'd like to store your privoxy filterlists at.

You can of course use the script in a crontab but I'm not going into details on that either since it 's pretty easy to do in itself and there are various topics about that to be found in the Forum. Please refrain from asking questions about that here (really it 's only a single line - you should be able to figure that out yourself).

Download, Install Instructions, Readme and Changelog is now on Github (as of 2014/15/12):

ddwrt-adbp-to-privoxy


Changelog

  • 141512-1

    • Moved to Github
    • Fixed some Syntax Errors (possibly - tested with shellcheck.net). Please update to the newest Version

  • 141012-1

    • Added Domain-Based Blocking
    • Fixed Regex for Whitelisting (now properly working)

  • 142711-1

    • Initial Release
    • Fixed Regex from original Script that would prevent the Filter- and Actionlists from working
    • Changed binaries that are used to be compatible with DD-WRT 25408 and similar


Cheers!


Last edited by justyourimage on Mon Dec 15, 2014 0:34; edited 9 times in total
Sponsor
icewaere
DD-WRT User


Joined: 09 Sep 2010
Posts: 86

PostPosted: Fri Nov 28, 2014 16:42    Post subject: Reply with quote
[EDIT: Now it works see next Post]

hi,

first thx for this hope it works soon Wink

but at the moment it dont works for me ;/
i have installed like your instructions and download of lists and copy to /jffs/privoxy works fine.

Only the config file on /jffs/privoxy is empty 0bytes. Is that normal?

i have change Custom Config in Gui to this:
Code:

confdir /jffs/privoxy
logdir /jffs/tmp/
actionsfile match-all.action
actionsfile default.action
actionsfile user.action
actionsfile easylistgermany.script.action
actionsfile malwaredomains_full.script.action
actionsfile easylist.script.action
filterfile default.filter
filterfile easylistgermany.script.filter
filterfile malwaredomains_full.script.filter
filterfile easylist.script.filter
logfile logfile
listen-address  192.168.1.1:8118
toggle  1
enable-remote-toggle  0
enable-remote-http-toggle  0
enable-edit-actions 0
buffer-limit 4096
accept-intercepted-requests 0
split-large-forms 0
keep-alive-timeout 5
socket-timeout 300
handle-as-empty-doc-returns-ok 1


on TOP is see that privoxy starts with 50%cpu and than it crashed :/ and start again....

if i start provixy manualy i get mesg: fatal error invalid argument in config...

i use Kongs 24710M

hope you can help whats going wrong.

ahh Logfile:
Code:

2014-11-28 17:18:31.909 b6f23bbc Fatal error: can't load actions file '/jffs/privoxy/user.action': Invalid argument. Note that beginning with Privoxy 3.0.7, actions files have to be specified with their complete file names.


regards ice

_________________
Netgear Nighthawk R7000@1400mhz / KongAC-ARM-build (25530M)
Netgear WNDR4500 DD-WRT v24-sp2 (09/27/13) kongac-build 23430 / OTRW t2 Squid 3.1.8 / 64gb SSD
Belkin Play Max F7D4301v1@533mhz / 500GB USB / 3G Huawei K3765-HV / DD-WRT 18777
Linksys E3000 with Tomato Victek
R.I.P. WRT160NL
R.I.P. WRT54GL


Last edited by icewaere on Fri Nov 28, 2014 16:56; edited 1 time in total
icewaere
DD-WRT User


Joined: 09 Sep 2010
Posts: 86

PostPosted: Fri Nov 28, 2014 16:51    Post subject: Reply with quote
Lol ok my misstake Wink

i forgot to copy "user.action" to /jffs/privoxy

now it works great Wink

thx for that cool script and tut.

regards ice

_________________
Netgear Nighthawk R7000@1400mhz / KongAC-ARM-build (25530M)
Netgear WNDR4500 DD-WRT v24-sp2 (09/27/13) kongac-build 23430 / OTRW t2 Squid 3.1.8 / 64gb SSD
Belkin Play Max F7D4301v1@533mhz / 500GB USB / 3G Huawei K3765-HV / DD-WRT 18777
Linksys E3000 with Tomato Victek
R.I.P. WRT160NL
R.I.P. WRT54GL
justyourimage
DD-WRT User


Joined: 04 Nov 2014
Posts: 113

PostPosted: Fri Nov 28, 2014 17:15    Post subject: Reply with quote
Edit:

Ok good to know. Smile

----

Yea the config file is actually bugged - but it isn't used anyway since DD-WRT will overwrite it anyway.

1. Did you copy the contents from /etc/privoxy to /jffs/(etc/)privoxy ?

2. What does your logfile in /jffs/tmp/logfile say?

3. You're trying to use this on the R7000 right?

4. That 's my config:

Quote:

confdir /jffs/etc/privoxy
templdir /jffs/etc/privoxy/templates
logdir /var/log/privoxy
actionsfile match-all.action
actionsfile default.action
actionsfile user.action
filterfile default.filter
actionsfile easylistgermany.script.action
actionsfile malwaredomains_full.script.action
actionsfile easylist.script.action
filterfile easylistgermany.script.filter
filterfile malwaredomains_full.script.filter
filterfile easylist.script.filter
logfile logfile
tolerate-pipelining 1
enable-compression 1
enable-edit-actions 0
accept-intercepted-requests 1
listen-address 192.168.1.1:8118
max-client-connections 256
default-server-timeout 60
keep-alive-timeout 300
socket-timeout 120
toggle 1

_________________
The Netgear R7000 is a beast!

My contributions:

[Script] Adblock Plus Filters for Privoxy (without Optware)
[Privoxy-Template] PVXY Modern (officially integrated in DD-WRT starting Build r25541)

My Devices:

Netgear R7000 running DD-WRT BS 25648 with wl0_ampdu=off as Router
ASUS AC66U running DD-WRT Kong 23900 OLDD downclocked to 500 MHz as Repeater
ASUS N66U running 374.43_2 MerlinWRT with BL1.09 downclocked to 500MHz as WET for my Mainmachine
Linksys E2000 running Tomato v121 as WET for my Synology DS214play and Minix Neo X7 Mini
icewaere
DD-WRT User


Joined: 09 Sep 2010
Posts: 86

PostPosted: Fri Nov 28, 2014 20:34    Post subject: Reply with quote
yes r7000 see my sig Wink
and yes copy all content from /etc/privoxy to /jffs/privoxy

works absolutly great so far!

only one thing: you know a solution for slideins and popups on "linkcrypt.ws" ?

you know a list wich block that bull**** ?

regards ice

_________________
Netgear Nighthawk R7000@1400mhz / KongAC-ARM-build (25530M)
Netgear WNDR4500 DD-WRT v24-sp2 (09/27/13) kongac-build 23430 / OTRW t2 Squid 3.1.8 / 64gb SSD
Belkin Play Max F7D4301v1@533mhz / 500GB USB / 3G Huawei K3765-HV / DD-WRT 18777
Linksys E3000 with Tomato Victek
R.I.P. WRT160NL
R.I.P. WRT54GL
justyourimage
DD-WRT User


Joined: 04 Nov 2014
Posts: 113

PostPosted: Fri Nov 28, 2014 20:53    Post subject: Reply with quote
Well I don't get any Popups there (at least not on the mainsite). Did you subscribe to the Malware-List as well?
_________________
The Netgear R7000 is a beast!

My contributions:

[Script] Adblock Plus Filters for Privoxy (without Optware)
[Privoxy-Template] PVXY Modern (officially integrated in DD-WRT starting Build r25541)

My Devices:

Netgear R7000 running DD-WRT BS 25648 with wl0_ampdu=off as Router
ASUS AC66U running DD-WRT Kong 23900 OLDD downclocked to 500 MHz as Repeater
ASUS N66U running 374.43_2 MerlinWRT with BL1.09 downclocked to 500MHz as WET for my Mainmachine
Linksys E2000 running Tomato v121 as WET for my Synology DS214play and Minix Neo X7 Mini
icewaere
DD-WRT User


Joined: 09 Sep 2010
Posts: 86

PostPosted: Fri Nov 28, 2014 21:06    Post subject: Reply with quote
ahh sorry

here is a right link with slideins and popups:
edit link removed

plz test the captcha and klick download dlc to see the slideins & popups.

hope its ok to post this only for test i will del the link soon Wink
if not plz let me know to edit.

no i have not tested other lists yet for this ad.
I will check that next week.

regards ice

ps: yes subscribe to easylist + malware at the moment like your example

_________________
Netgear Nighthawk R7000@1400mhz / KongAC-ARM-build (25530M)
Netgear WNDR4500 DD-WRT v24-sp2 (09/27/13) kongac-build 23430 / OTRW t2 Squid 3.1.8 / 64gb SSD
Belkin Play Max F7D4301v1@533mhz / 500GB USB / 3G Huawei K3765-HV / DD-WRT 18777
Linksys E3000 with Tomato Victek
R.I.P. WRT160NL
R.I.P. WRT54GL


Last edited by icewaere on Fri Nov 28, 2014 21:52; edited 1 time in total
justyourimage
DD-WRT User


Joined: 04 Nov 2014
Posts: 113

PostPosted: Fri Nov 28, 2014 21:45    Post subject: Reply with quote
No popups, no popunders, no ads - nothing for me (better remove it tought!).

Using the Adlists supplied above in my Script.

_________________
The Netgear R7000 is a beast!

My contributions:

[Script] Adblock Plus Filters for Privoxy (without Optware)
[Privoxy-Template] PVXY Modern (officially integrated in DD-WRT starting Build r25541)

My Devices:

Netgear R7000 running DD-WRT BS 25648 with wl0_ampdu=off as Router
ASUS AC66U running DD-WRT Kong 23900 OLDD downclocked to 500 MHz as Repeater
ASUS N66U running 374.43_2 MerlinWRT with BL1.09 downclocked to 500MHz as WET for my Mainmachine
Linksys E2000 running Tomato v121 as WET for my Synology DS214play and Minix Neo X7 Mini
icewaere
DD-WRT User


Joined: 09 Sep 2010
Posts: 86

PostPosted: Fri Nov 28, 2014 21:48    Post subject: Reply with quote
hmm strange,

you use only easylistgermany & easylist & malwaredomain & default with privoxy?
no other blockers plugins on your browser?

i use Firefox 36 without any plugin for this test.

here my files from /jffs/privoxy:


and here you can see all subscribes loaded:


regards ice

_________________
Netgear Nighthawk R7000@1400mhz / KongAC-ARM-build (25530M)
Netgear WNDR4500 DD-WRT v24-sp2 (09/27/13) kongac-build 23430 / OTRW t2 Squid 3.1.8 / 64gb SSD
Belkin Play Max F7D4301v1@533mhz / 500GB USB / 3G Huawei K3765-HV / DD-WRT 18777
Linksys E3000 with Tomato Victek
R.I.P. WRT160NL
R.I.P. WRT54GL
justyourimage
DD-WRT User


Joined: 04 Nov 2014
Posts: 113

PostPosted: Fri Nov 28, 2014 22:52    Post subject: Reply with quote
Ah my bad you're right I forgot I had ABP installed in Chrome as well Very Happy ... yea I'm getting those Selsin.net Popups as well.

Add this in your user.actions at the bottom:

### CUSTOM RULES ###

{+block{Layered ads.} +handle-as-empty-document}
.selsin.net/lc.js

That should do the trick.

_________________
The Netgear R7000 is a beast!

My contributions:

[Script] Adblock Plus Filters for Privoxy (without Optware)
[Privoxy-Template] PVXY Modern (officially integrated in DD-WRT starting Build r25541)

My Devices:

Netgear R7000 running DD-WRT BS 25648 with wl0_ampdu=off as Router
ASUS AC66U running DD-WRT Kong 23900 OLDD downclocked to 500 MHz as Repeater
ASUS N66U running 374.43_2 MerlinWRT with BL1.09 downclocked to 500MHz as WET for my Mainmachine
Linksys E2000 running Tomato v121 as WET for my Synology DS214play and Minix Neo X7 Mini
icewaere
DD-WRT User


Joined: 09 Sep 2010
Posts: 86

PostPosted: Mon Dec 01, 2014 18:38    Post subject: Reply with quote
justyourimage wrote:
Ah my bad you're right I forgot I had ABP installed in Chrome as well Very Happy ... yea I'm getting those Selsin.net Popups as well.

Add this in your user.actions at the bottom:

### CUSTOM RULES ###

{+block{Layered ads.} +handle-as-empty-document}
.selsin.net/lc.js

That should do the trick.


Hi,

yes it works Wink suppa thx for that great work!
wish yea a nice week.

regards ice

_________________
Netgear Nighthawk R7000@1400mhz / KongAC-ARM-build (25530M)
Netgear WNDR4500 DD-WRT v24-sp2 (09/27/13) kongac-build 23430 / OTRW t2 Squid 3.1.8 / 64gb SSD
Belkin Play Max F7D4301v1@533mhz / 500GB USB / 3G Huawei K3765-HV / DD-WRT 18777
Linksys E3000 with Tomato Victek
R.I.P. WRT160NL
R.I.P. WRT54GL
jebise101
DD-WRT Guru


Joined: 25 Sep 2009
Posts: 594

PostPosted: Mon Dec 08, 2014 6:00    Post subject: Reply with quote
This is awsome, just applied this to my r7000, changed the script to run from usb rather than jffs and added the easylist privacy list.

However I can't seem to get rid of youtube ads (30sec ads).

Also is there a way to allow adfly but block the ads, currently with the chrome extension adfly is allowed you wait 5 seconds for the redirect button but see no ad, with prioxy the site itself is blocked and when you click proceed it works but you get ads and popups.

Using the below adblock which blocks YouTube ads, thought I could add it's custom filter but I don't think it will work with priory.

https://chrome.google.com/webstore/detail/adblock/gighmmpiobklfepjocnamgkkbiglidom?hl=en
justyourimage
DD-WRT User


Joined: 04 Nov 2014
Posts: 113

PostPosted: Mon Dec 08, 2014 15:49    Post subject: Reply with quote
Could you post that filter which block the YT ads?

I think looking at the way YT displays it 's Video ADs
it 's pretty hard to do that with simple filters in itself.

_________________
The Netgear R7000 is a beast!

My contributions:

[Script] Adblock Plus Filters for Privoxy (without Optware)
[Privoxy-Template] PVXY Modern (officially integrated in DD-WRT starting Build r25541)

My Devices:

Netgear R7000 running DD-WRT BS 25648 with wl0_ampdu=off as Router
ASUS AC66U running DD-WRT Kong 23900 OLDD downclocked to 500 MHz as Repeater
ASUS N66U running 374.43_2 MerlinWRT with BL1.09 downclocked to 500MHz as WET for my Mainmachine
Linksys E2000 running Tomato v121 as WET for my Synology DS214play and Minix Neo X7 Mini
jebise101
DD-WRT Guru


Joined: 25 Sep 2009
Posts: 594

PostPosted: Mon Dec 08, 2014 17:38    Post subject: Reply with quote
If you add the adblock extension and go into options/filter list, you should see the custom adblock list. If you hover over the text it will show you the url. I think that's what's blocking the YouTube ads.

Https://data.getadblock.com/filters/adblock_custom.txt

Any idea about adfly?
justyourimage
DD-WRT User


Joined: 04 Nov 2014
Posts: 113

PostPosted: Mon Dec 08, 2014 18:43    Post subject: Reply with quote
adfly is blocked in my case.

However I don't think you're able to block YT Video ADs easily since YouTube forces the Browser to run over HTTPS so Privoxy will only work when setup in Non-Transparency Mode and when setup on every Browser / Client.

s.ytimg.com/yts/swfbin/.*/ad.*.swf
.g.doubleclick.net

should be a start to block the Video ADs (don't expect it to just work since I didn't test the above).

But honestly?

Skip out on YouTube entirely and use Vimeo instead (yes, really).

YouTube has become really shitty the last years due to Google 's policy and behavior and I'm skipping as much as I can to be honest. And that 's not only due to Video ADs but also due to their broken Comment System and Google Plus integration but also due to them blocking half or more of their Videos in Germany due to their legal issues with the GEMA acting like spoiled kids.

Or just use an Adblocker for those Ads.

_________________
The Netgear R7000 is a beast!

My contributions:

[Script] Adblock Plus Filters for Privoxy (without Optware)
[Privoxy-Template] PVXY Modern (officially integrated in DD-WRT starting Build r25541)

My Devices:

Netgear R7000 running DD-WRT BS 25648 with wl0_ampdu=off as Router
ASUS AC66U running DD-WRT Kong 23900 OLDD downclocked to 500 MHz as Repeater
ASUS N66U running 374.43_2 MerlinWRT with BL1.09 downclocked to 500MHz as WET for my Mainmachine
Linksys E2000 running Tomato v121 as WET for my Synology DS214play and Minix Neo X7 Mini
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next Display posts from previous:    Page 1 of 8
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum