Post Reply 
Adapting “hosts” file block lists to Privoxy's way of blocking…
Jul. 31, 2015, 05:38 PM (This post was last modified: Aug. 01, 2015 09:46 PM by Faxopita.)
Post: #10
RE: Adapting “hosts” file block lists to Privoxy's way of blocking…
(Jul. 31, 2015 03:02 PM)cattleyavns Wrote:  adimg.tv.com and mads.tv.com, this site might be similar with Youtube, but shorten to .tv.com will block the whole site.

The script won't touch adimg.tv.com nor mads.tv.com, because of these simultaneously matched conditions in this case:
  • if the hosts file contains adimg.tv.com and mads.tv.com, they will only be preceded by a dot and not shorten to .tv.com; the conversion to one-single line entry .tv.com would only happen if the hosts file contained by accident tv.com as well.
  • although tv.com doesn't look like a second-level domain (like .us.com, for example), the script deems as is—because of a script limitation to protect second-level domain-included addresses—and uses a regular expression that takes account of
    Code:
    .vw.xyz
    -like pattern domain extension so that adimg will not be considered as a “subdomain” of the site (although it is in reality), which means that hosts entries containing, for example, banner.adimg.tv.com and banner.mads.tv.com will not respectively be turned into .adimg.tv.com and .mads.tv.com, although it would be ideal to (again, it's a script limitation); instead, the script would only prefix with a dot banner.adimg.tv.com and banner.mads.tv.com

After verification, my converted hosts file still contains .mads.tv.com and .adimg.tv.com

Equally, addresses like ad.mirror.co.uk will not be changed into .mirror.co.uk, because of the recognised
Code:
wx.yz
-like pattern ending the address, a second-level domain. Finally, the script will also protect addresses such as .com.sg, .us.com, .ac.be, etc.

(Jul. 31, 2015 03:02 PM)cattleyavns Wrote:  you should not convert server1.ad.goodsite.com and server2.ad.goodsite.com to .ad.goodsite.com, because that will cause you some trouble in the future, for example: server1.ad.goodsite.com and server2.ad.goodsite.com, but the site use cdn.ad.goodsite.com to host core content, for example Jquery, AngularJS then Privoxy will block them too

This didn't come up to my mind. I see what you mean. In this case, you could create in the user.action file an exception involving…
Code:
{ -block }
.cdn.ad.goodsite.com

The user.action file is to be called after the converted_hosts_file.action in the Privoxy's config file.

Other than this, I've been using the script for 14 months now and haven't had any deteriorated browsing experience. The script has only been improved towards further file size reduction. I use it every week to update my blocking .action file. Having said that, it does not mean of course the script is perfect as it's been proven by cattleyavns on that matter.

Regarding your last input:
Quote:0.0.0.0 c.cnzz.com
0.0.0.0 hos1.cnzz.com
0.0.0.0 hzs1.cnzz.com
0.0.0.0 hzs2.cnzz.com
0.0.0.0 hzs4.cnzz.com
0.0.0.0 hzs8.cnzz.com
0.0.0.0 hzs10.cnzz.com
0.0.0.0 hzs13.cnzz.com
0.0.0.0 hzs15.cnzz.com
0.0.0.0 hzs22.cnzz.com
0.0.0.0 icon.cnzz.com
0.0.0.0 pcookie.cnzz.com
0.0.0.0 pw.cnzz.com
0.0.0.0 s1.cnzz.com
0.0.0.0 s3.cnzz.com
0.0.0.0 s4.cnzz.com
0.0.0.0 s5.cnzz.com
0.0.0.0 s7.cnzz.com
0.0.0.0 s8.cnzz.com
0.0.0.0 s9.cnzz.com
....
0.0.0.0 s132.cnzz.com
0.0.0.0 s137.cnzz.com

While doing regular updates of your hosts file, you could see a newly-added entry like:
Code:
0.0.0.0 cnzz.com
alongside other .cnzz.com addresses. It's under this scenario the script would compress all these entries into one single entry .cnzz.com; and, indeed, after verification, my converted_hosts_file.action only contains .cnzz.com
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Adapting “hosts” file block lists to Privoxy's way of blocking… - Faxopita - Jul. 31, 2015 05:38 PM

Forum Jump: