VideoCache
Videocache is no longer in development.

Squid + Adzapper + VideoCache <--- not working

by Anonymous on 30 Jun 2009

I had tried many ways to have wrapzap or zapchain to work, none of them ever work, I cannot get videocache and adzapper work. If I get the videocache to work the adzapper is not working.

Debian:/etc/squid# ps ax | grep squid
 3510 ?        Ss     0:00 /usr/sbin/squid -D -YC
 3512 ?        S      0:00 (squid) -D -YC
 3517 ?        Ss     0:00 /usr/bin/perl /usr/bin/zapchain /usr/bin/squid_redirect /usr/share/videocache/videocache.py
 3518 ?        Ss     0:00 /usr/bin/perl /usr/bin/zapchain /usr/bin/squid_redirect /usr/share/videocache/videocache.py
 3520 ?        Ss     0:00 /usr/bin/perl /usr/bin/zapchain /usr/bin/squid_redirect /usr/share/videocache/videocache.py
 3521 ?        Ss     0:00 /usr/bin/perl /usr/bin/zapchain /usr/bin/squid_redirect /usr/share/videocache/videocache.py
 3522 ?        Ss     0:00 /usr/bin/perl /usr/bin/zapchain /usr/bin/squid_redirect /usr/share/videocache/videocache.py
 3523 ?        Ss     0:00 /usr/bin/perl /usr/bin/zapchain /usr/bin/squid_redirect /usr/share/videocache/videocache.py
 3524 ?        Ss     0:00 /usr/bin/perl /usr/bin/zapchain /usr/bin/squid_redirect /usr/share/videocache/videocache.py
 3526 ?        S      0:02 /usr/bin/perl -w /usr/bin/squid_redirect
 3528 ?        S      0:02 /usr/bin/perl -w /usr/bin/squid_redirect
 3530 ?        S      0:02 /usr/bin/perl -w /usr/bin/squid_redirect
 3532 ?        S      0:02 /usr/bin/perl -w /usr/bin/squid_redirect
 3534 ?        S      0:02 /usr/bin/perl -w /usr/bin/squid_redirect
 3536 ?        S      0:02 /usr/bin/perl -w /usr/bin/squid_redirect
 3538 ?        S      0:02 /usr/bin/perl -w /usr/bin/squid_redirect
 3559 pts/0    R+     0:00 grep squid

6 Answers

by mynullvoid on 30 Jun 2009

This is the snip last part of my squid.conf

url_rewrite_children 7
acl videocache_allow_url url_regex -i \\.youtube\\.com\\/get_video\\?
acl videocache_allow_url url_regex -i \\.googlevideo\\.com\\/videoplayback \\.googlevideo\\.com\\/videoplay \\.googlevideo\\.com\\/get_video\\?
acl videocache_allow_url url_regex -i \\.google\\.com\\/videoplayback \\.google\\.com\\/videoplay \\.google\\.com\\/get_video\\?
acl videocache_allow_url url_regex -i \\.google\\.[a-z][a-z]\\/videoplayback \\.google\\.[a-z][a-z]\\/videoplay \\.google\\.[a-z][a-z]\\/get_video\\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/videoplayback\\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/videoplay\\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/get_video\\?
acl videocache_allow_url url_regex -i proxy[a-z0-9\\-][a-z0-9][a-z0-9][a-z0-9]?\\.dailymotion\\.com\\/
acl videocache_allow_url url_regex -i vid\\.akm\\.dailymotion\\.com\\/
acl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\\.xtube\\.com\\/(.*)flv
acl videocache_allow_url url_regex -i bitcast\\.vimeo\\.com\\/vimeo\\/videos\\/
acl videocache_allow_url url_regex -i va\\.wrzuta\\.pl\\/wa[0-9][0-9][0-9][0-9]?
acl videocache_allow_url url_regex -i \\.files\\.youporn\\.com\\/(.*)\\/flv\\/
acl videocache_allow_url url_regex -i \\.msn\\.com\\.edgesuite\\.net\\/(.*)\\.flv
acl videocache_allow_url url_regex -i media[a-z0-9]?[a-z0-9]?[a-z0-9]?\\.tube8\\.com\\/ mobile[a-z0-9]?[a-z0-9]?[a-z0-9]?\\.tube8\\.com\\/
acl videocache_allow_url url_regex -i \\.mais\\.uol\\.com\\.br\\/(.*)\\.flv
acl videocache_allow_url url_regex -i \\.video[a-z0-9]?[a-z0-9]?\\.blip\\.tv\\/(.*)\\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram)
acl videocache_allow_url url_regex -i video\\.break\\.com\\/(.*)\\.(flv|mp4)
acl videocache_allow_dom dstdomain .mccont.com dl.redtube.com .cdn.dailymotion.com
acl videocache_deny_url url_regex -i http:\\/\\/[a-z][a-z]\\.youtube\\.com http:\\/\\/www\\.youtube\\.com
url_rewrite_access deny videocache_deny_url
url_rewrite_access allow videocache_allow_url
url_rewrite_access allow videocache_allow_dom
redirect_program /usr/bin/wrapzap
redirector_bypass on
by mynullvoid on 30 Jun 2009

This is my wrapzap

zapper=/usr/bin/squid_redirect
videocache=/usr/share/videocache/videocache.py

ZAP_MODE=                               # or "CLEAR"
ZAP_BASE=http://adzapper.sourceforge.net/zaps   # a local web server will be better
ZAP_BASE_SSL=https://adzapper.sourceforge.net/zaps # this can probably be ignored

ZAP_PREMATCH=                           # pathname of extra pattern file
                                        # for patterns to preempt the stock
                                        # zapper
ZAP_POSTMATCH=                          # pathname of extra pattern file
                                        # for patterns in addition to the
                                        # stock zapper; this is the one to
                                        # which you should add new ads
ZAP_MATCH=                              # pathname of extra pattern file
                                        # for patterns to use instead of the
                                        # inbuilt pattern list
ZAP_NO_CHANGE=                          # set to "NULL" is your proxy is Apache2 instead of Squid

STUBURL_AD=$ZAP_BASE/ad.gif
STUBURL_ADSSL=$ZAP_BASE_SSL/ad.gif
STUBURL_ADBG=$ZAP_BASE/adbg.gif
STUBURL_ADJS=$ZAP_BASE/no-op.js
STUBURL_ADJSTEXT=
STUBURL_ADHTML=$ZAP_BASE/no-op.html
STUBURL_ADHTMLTEXT=
STUBURL_ADMP3=$ZAP_BASE/ad.mp3
STUBURL_ADPOPUP=$ZAP_BASE/closepopup.html
STUBURL_ADSWF=$ZAP_BASE/ad.swf
STUBURL_COUNTER=$ZAP_BASE/counter.gif
STUBURL_COUNTERJS=$ZAP_BASE/no-op-counter.js
STUBURL_COUNTERHTML=$ZAP_BASE/no-op-counter.html
STUBURL_WEBBUG=$ZAP_BASE/webbug.gif
STUBURL_WEBBUGJS=$ZAP_BASE/webbug.js
STUBURL_WEBBUGHTML=$ZAP_BASE/webbug.html

STUBURL_PRINT=                          # off by default, set to 1

export ZAP_MODE ZAP_BASE ZAP_BASE_SSL ZAP_PREMATCH ZAP_POSTMATCH ZAP_MATCH ZAP_NO_CHANGE
export STUBURL_AD STUBURL_ADSSL STUBURL_ADJS STUBURL_ADHTML STUBURL_ADMP3 \\
        STUBURL_ADPOPUP STUBURL_ADSWF STUBURL_COUNTER STUBURL_COUNTERJS \\
        STUBURL_COUNTERHTML STUBURL_WEBBUG STUBURL_WEBBUGJS STUBURL_WEBBUGHTML \\
        STUBURL_PRINT STUBURL_ADHTMLTEXT STUBURL_ADJSTEXT


exec /usr/bin/zapchain "$zapper" "$videocache"
by mynullvoid on 1 Jul 2009

When I remove the videocache line, my adzapper work, but when I put it back, my adzapper is not working. Can anyone enlighten me.

by Cameron Simpson on 2 Jul 2009

I suspect these lines:

url_rewrite_access deny videocache_deny_url
url_rewrite_access allow videocache_allow_url
url_rewrite_access allow videocache_allow_dom

cause your trouble, if what you see is no zapped ads.

I imagine that in a purely-videocache install, these lines pass only
specific URLs to the video cache redirector plugin, so that most URLs
pass happily by the cache and are accessed normally.

However, by using these lines with the zapchain stuff you are also arranging
that non-video URLs do not pass through the adzapper either. And so the
zapper doesn't see anything. (Well, it will see videos, but it will be
leaving them alone.)

You should try commenting out ALL the "acl videocache_*" lines and the
three url_rewrite_access lines above.

by Kulbir Saini on 2 Jul 2009

Cameron Simpson,

Very nicely illustrated. I agree with your point. Though I have never used adzapper personally but whatever you have pointed out makes sense.

I hope this will help mynullvoid fix his problem.

Thank You!

by mynullvoid on 3 Jul 2009

Yes, Cameron Simpson had save my day.... I guess many of us who use adzapper also find this as solution to our problem. Thank you guys