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

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


Joined: 23 Dec 2015
Posts: 1

PostPosted: Wed Dec 23, 2015 1:08    Post subject: Reply with quote
can someone help me cant run this
Code:
root@DD-WRT:/jffs# sh privoxy-blocklist.sh
The following dependency is missing: (curl).


curl is installed but in telnet it not works
Sponsor
powerfulman
DD-WRT Novice


Joined: 26 Apr 2013
Posts: 13

PostPosted: Sun Jan 10, 2016 21:39    Post subject: Reply with quote
I am using the last dd-wrt firmware on tplink_tl-wdr3600v1 and have installed optware.
while I run the script, it is able to generate the filter and action files, but when I try to start up privoxy, it is stuck at loading the filter file. This is the log:

2016-01-10 13:33:56.093 774a4000 Info: Privoxy version 3.0.21
2016-01-10 13:33:56.093 774a4000 Info: Program name: privoxy
2016-01-10 13:33:56.093 774a4000 Info: Loading filter file: /opt/etc/privoxy/default.filter
2016-01-10 13:33:56.165 774a4000 Info: Loading filter file: /opt/etc/privoxy/easylist.script.filter
2016-01-10 13:33:56.281 774a4000 Error: Adding re_filter job 's@<([a-zA-Z0-9]+)\s+.*id=.?\5f _mom_ad_12.*>.*</\1>@@g' to filter easylist failed with error 49.
2016-01-10 13:33:56.282 774a4000 Error: Adding re_filter job 's@<([a-zA-Z0-9]+)\s+.*id=.?\5f _mom_ad_2.*>.*</\1>@@g' to filter easylist failed with error 48.

Any help is appreciated.
DDWWWRT
DD-WRT Novice


Joined: 10 Feb 2016
Posts: 17

PostPosted: Tue Feb 16, 2016 17:26    Post subject: Privoxy Custom confi breaks all trafic on port 80 Reply with quote
I see a few other have ran into the same problem I have.

Privoxy itself works and when I turn on tansparant mode I am able to acess the config web page. But as soon I enter the custom config info all traffic on port 80 is broken. I made sure my config directory is pointing to the right place... Everythin appears to be set u problerly.


Does anyone know what my problem is, have you found a solution?

Thanks
Duxa
DD-WRT User


Joined: 16 Aug 2013
Posts: 191

PostPosted: Fri Dec 16, 2016 4:43    Post subject: Reply with quote
Having bad regex "\?" errors when executing the shell script to update. here is an image. Any ideas?

http://imgur.com/a/cl7Zg
boatingdude
DD-WRT Novice


Joined: 12 Dec 2013
Posts: 24

PostPosted: Fri Dec 16, 2016 13:19    Post subject: Reply with quote
Hi,

To fix it you have to modify the script,

heres the fixed line

sed '/^!.*/d;1,1 d;/^@@.*/d;/\$.*/d;/#/d;s/\./\\./g;s|?|\\?|g;s/\*/.*/g;s/(/\\(/g;s/)/\\)/g;s/\[/\\[/g;s/\]/\\]/g;s/\^/[\/\&:\?=_]/g;s/^||/\./g;s/^|/^/g;s/|$/\$/g;/|/d' ${file} >> ${actionfile}


try to match yours. I am attaching the script too. I understand for security reasons you cant run this one but try to compare with yours and fix the line that differs,
thanks,
boatingdude



privoxy-blocklist.txt
 Description:

Download
 Filename:  privoxy-blocklist.txt
 Filesize:  7.91 KB
 Downloaded:  1094 Time(s)

hubermania
DD-WRT User


Joined: 24 Aug 2012
Posts: 223

PostPosted: Sat Dec 17, 2016 6:31    Post subject: Reply with quote
Duxa wrote:
Having bad regex "\?" errors when executing the shell script to update. here is an image. Any ideas?

Try changing the first line of the script to #!/bin/sh

When I first installed privoxy-blocklist.sh, I had no bash so I crossed my fingers and changed the first line of the script to run itself in /bin/sh. No regex issues converting easylist, easyprivacy, or antiadblockfilters.

_________________
[Broadcom] Asus rt-ac66u r35531 ('66 should only be factory reset through the DD UI)
Fix RT-AC66U "wl1 [2.4 GHz TurboQAM]". DD-WRT failsafe UI @ http|https://169.254.255.1/
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Wed Jun 21, 2017 1:54    Post subject: Reply with quote
I have WRT1900AC v1 router DDWRT Kong 31100 on it. Privoxy 3.0.26 enabled and working ok. I want to implement this code because privoxy doesn't block all ads. I use on transparent mode.

Q1: Can I use this script on my router?
Q2: Can I work this script on usb drive instead of jffs? Whars the advantage and disadvantage of jffs?

Thanks

_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Wed Jun 21, 2017 15:21    Post subject: Reply with quote
This script still works! I tested. Here is my configuration:

Filters:

Code:
ADBLOCKLISTS=" \
https://easylist-downloads.adblockplus.org/easylist.txt \
https://easylist-downloads.adblockplus.org/antiadblockfilters.txt \
https://raw.githubusercontent.com/zpacman/Blockzilla/master/Blockzilla.txt \
https://easylist-downloads.adblockplus.org/adwarefilters.txt \
https://easylist-downloads.adblockplus.org/malwaredomains_full.txt \
https://raw.githubusercontent.com/Dawsey21/Lists/master/adblock-list.txt"


Cron Command:
Code:
0 0 * * *  root sh /jffs/privoxy-blocklist.sh


Custom Config:
Code:
confdir /jffs/etc/privoxy
logdir /var/log/privoxy
actionsfile adblock-list.script.action
actionsfile adwarefilters.script.action
actionsfile antiadblockfilters.script.action
actionsfile Blockzilla.script.action
actionsfile match-all.action
actionsfile default.action
actionsfile user.action
actionsfile malwaredomains_full.script.action
actionsfile easylist.script.action
filterfile adblock-list.script.filter
filterfile adwarefilters.script.filter
filterfile antiadblockfilters.script.filter
filterfile Blockzilla.script.filter
filterfile easylist.script.filter
filterfile malwaredomains_full.script.filter
filterfile default.filter
filterfile user.filter
listen-address 192.168.20.1:8118
toggle 1
enable-remote-toggle 0
enable-remote-http-toggle 0
enable-edit-actions 1
buffer-limit 4096
debug 512
accept-intercepted-requests 1
split-large-forms 0
keep-alive-timeout 5
socket-timeout 300
handle-as-empty-doc-returns-ok 1


Screenshots:



2017-06-21_18-15-31.png
 Description:
 Filesize:  134.56 KB
 Viewed:  10612 Time(s)

2017-06-21_18-15-31.png



2017-06-21_18-16-16.png
 Description:
 Filesize:  109.82 KB
 Viewed:  10612 Time(s)

2017-06-21_18-16-16.png



2017-06-21_18-15-47.png
 Description:
 Filesize:  27.62 KB
 Viewed:  10612 Time(s)

2017-06-21_18-15-47.png



_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Sat Jul 22, 2017 17:45    Post subject: Reply with quote
boatingdude wrote:
Hi,

To fix it you have to modify the script,

heres the fixed line

sed '/^!.*/d;1,1 d;/^@@.*/d;/\$.*/d;/#/d;s/\./\\./g;s|?|\\?|g;s/\*/.*/g;s/(/\\(/g;s/)/\\)/g;s/\[/\\[/g;s/\]/\\]/g;s/\^/[\/\&:\?=_]/g;s/^||/\./g;s/^|/^/g;s/|$/\$/g;/|/d' ${file} >> ${actionfile}


try to match yours. I am attaching the script too. I understand for security reasons you cant run this one but try to compare with yours and fix the line that differs,
thanks,
boatingdude


Thank you! I fixed the problem with this tip!

_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
rickyyip123
DD-WRT Novice


Joined: 31 Dec 2016
Posts: 18

PostPosted: Fri Aug 11, 2017 3:57    Post subject: Reply with quote
Hi, this has been an old thread, but I hope someone could help.

I have used the script to convert and load everything into privoxy, no syntax error, but the easylists are not blocking any ads at all.

So I used the privoxy function to test the adblock, and it says not match in files...

Is the script broken and no longer usable?



Untitled.jpg
 Description:
easylists are not working
 Filesize:  109.03 KB
 Viewed:  9885 Time(s)

Untitled.jpg


mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Fri Aug 11, 2017 16:56    Post subject: Reply with quote
There is no any record about gsmarena in updated easylist.action or easylist.filter files. I added these line in my user.filter file. For this reason it blocks.

Quote:
FILTER: div-ads DIV ad blocks.
s/<div id="adidm_reklam"/<div id="adidm_reklam" style="display:none;"/g
s/<div id="google_image_div"/<div id="google_image_div" style="display:none;"/g
s/<div id="adContent-border"/<div id="adContent-border" style="display:none;"/g



3.png
 Description:
Without Privoxy
 Filesize:  471.28 KB
 Viewed:  9853 Time(s)

3.png



2.png
 Description:
With Privoxy
 Filesize:  475.31 KB
 Viewed:  9853 Time(s)

2.png



1.png
 Description:
 Filesize:  54.34 KB
 Viewed:  9853 Time(s)

1.png



_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
bl@d3runn3r
DD-WRT User


Joined: 10 Jan 2010
Posts: 210

PostPosted: Sat Sep 22, 2018 20:57    Post subject: Reply with quote
@mkaand
Thanks for your detailed information, running perfect on my R7000 here Wink
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Wed Sep 26, 2018 16:30    Post subject: Reply with quote
bl@d3runn3r wrote:
@mkaand
Thanks for your detailed information, running perfect on my R7000 here Wink


You're welcome buddy Smile

_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
Rickz
DD-WRT Novice


Joined: 01 Jan 2020
Posts: 35

PostPosted: Wed Jan 01, 2020 20:00    Post subject: does this actually work with youtube ? Reply with quote
@mkaand
there are simply method to block ads with a simple host file in script, less memory and space
actually does this method block youtube ads ?
the ads are shared between servers that also host the real videos so blocking by ip will break links where videos reside, some will work and some will not play, so best method will be implementing a script that will act like Ublock Origin or some other adblocks that will block the https request for ads and vids will continue playing without interruption

any ideas?
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Wed Jan 01, 2020 20:11    Post subject: Reply with quote
Hi @Rickz,

You are researching Youtube Ads blocking I guess. This quite old topic. I updated my adblock system. I use old firmware for my router DD-WRT v3.0-r38060 std (12/20/1Cool

I still use privoxy and every week automatically get filter updates + I found this link for YouTube Ads:

https://www.reddit.com/r/pihole/comments/9w5swx/i_think_ive_managed_to_block_youtube_ads_with/

I use Recursive DNS Resolving (Unbound) for prevent DNS leaks and block unwanted webhosts. I found Youtube ads server hostnames:

https://github.com/anudeepND/youtubeadsblacklist/blob/master/domainlist.txt

I added into my custom unbound config file:

Code:

local-zone: "manifest.googlevideo.com" redirect
local-data: "manifest.googlevideo.com A 172.217.19.46"
local-data-ptr: "172.217.19.46 manifest.googlevideo.com"

local-zone: "1e100.net" redirect
local-data: "1e100.net A 127.0.0.1"

local-data: "r1---sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r1.sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r2---sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r2.sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r3---sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r3.sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r4---sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r4.sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r5---sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r5.sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r6---sn-25ge7n76.googlevideo.com A 127.0.0.1"
local-data: "r6.sn-25ge7n76.googlevideo.com A 127.0.0.1"


Now I can still see some Youtube ad videos but less than before. Maybe you can improve my work.

_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next Display posts from previous:    Page 7 of 8
Post new topic   Reply to topic    DD-WRT 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