Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2009 18:57:29 GMT
From:      Murilo Opsfelder <mopsfelder@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/134116: [NEW PORT] www/videocache: A Squid URL rewriter for bandwidth optimization
Message-ID:  <200904301857.n3UIvTQA063581@www.freebsd.org>
Resent-Message-ID: <200904301900.n3UJ07Ed072699@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         134116
>Category:       ports
>Synopsis:       [NEW PORT] www/videocache: A Squid URL rewriter for bandwidth optimization
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 30 19:00:07 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Murilo Opsfelder
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
BluePex Security Solutions
>Environment:
FreeBSD opsfelderm.bplab.local 8.0-CURRENT FreeBSD 8.0-CURRENT #66 r191522: Sun Apr 26 15:39:54 BRT
>Description:
Videocache is a Squid URL rewriter plugin written in Python
for bandwidth optimization while browsing famous video
sharing portals/websites like Youtube, Metacafe etc.
It helps you save bandwidth when a particular video is
requested more than once from the same network/machine.

WWW:    http://www.cachevideos.com/
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./videocache
#
echo c - ./videocache
mkdir -p ./videocache > /dev/null 2>&1
exit

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./videocache/pkg-descr
#
echo x - ./videocache/pkg-descr
sed 's/^X//' >./videocache/pkg-descr << 'b10168bbaa810b35594b8066fd5c9d5b'
XVideocache is a Squid URL rewriter plugin written in Python
Xfor bandwidth optimization while browsing famous video
Xsharing portals/websites like Youtube, Metacafe etc.
XIt helps you save bandwidth when a particular video is
Xrequested more than once from the same network/machine.
X
XWWW:	http://www.cachevideos.com/
b10168bbaa810b35594b8066fd5c9d5b
exit

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./videocache/Makefile
#
echo x - ./videocache/Makefile
sed 's/^X//' >./videocache/Makefile << '356a38309371076105429d6f6e8e5c59'
X# New ports collection makefile for:	videocache
X# Date created:		2009-04-30
X# Whom:			Murilo Opsfelder <mopsfelder@gmail.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	videocache
XPORTVERSION=	1.9.1
XCATEGORIES=	www
XMASTER_SITES=	http://cachevideos.com/sites/default/files/pub/videocache/
X
XMAINTAINER=	mopsfelder@gmail.com
XCOMMENT=	A Squid URL rewriter for bandwidth optimization
X
XRUN_DEPENDS=	${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid \
X		${PYTHON_SITELIBDIR}/urlgrabber/grabber.py:${PORTSDIR}/www/py-urlgrabber \
X		${PYTHON_SITELIBDIR}/iniparse/ini.py:${PORTSDIR}/devel/py-iniparse
X
XNO_BUILD=	yes
XUSE_PYTHON=	yes
X
XMAN8=		videocache.8.gz
XPORTDOCS=	CHANGELOG COPYING Readme
XPORTEXAMPLES=	squid.conf
XSUB_FILES=	pkg-message
X
X.include <bsd.port.pre.mk>
X
Xdo-install:
X	${INSTALL_SCRIPT} ${WRKSRC}/update-vc ${PREFIX}/bin
X	${INSTALL_MAN} ${WRKSRC}/videocache.8.gz ${MAN1PREFIX}/man/man8
X	${INSTALL_DATA} ${WRKSRC}/videocache-sysconfig.conf ${PREFIX}/etc/videocache.conf.default
X	@[ -f ${PREFIX}/etc/videocache.conf ] || \
X		${CP} -v ${PREFIX}/etc/videocache.conf.default ${PREFIX}/etc/videocache.conf
X	${MKDIR} ${DATADIR}
X	${INSTALL_DATA} ${WRKSRC}/videocache/*.py ${DATADIR}
X.if !defined(NOPORTEXAMPLES)
X	${MKDIR} ${EXAMPLESDIR}
X	${INSTALL_DATA} ${FILESDIR}/squid.conf.example ${EXAMPLESDIR}/squid.conf
X.endif
X.if !defined(NOPORTDOCS)
X	${MKDIR} ${DOCSDIR}
X. for doc in ${PORTDOCS}
X	${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
X. endfor
X.endif
X
Xpost-install:
X.if !defined(NOPORTEXAMPLES)
X	${CAT} ${PKGMESSAGE}
X.endif
X
X.include <bsd.port.post.mk>
356a38309371076105429d6f6e8e5c59
exit

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./videocache/pkg-plist
#
echo x - ./videocache/pkg-plist
sed 's/^X//' >./videocache/pkg-plist << '59e91fe5983ab7acb041c36bc4b7a429'
X@comment $FreeBSD$
Xbin/update-vc
X@unexec if cmp -s %D/etc/videocache.conf %D/etc/videocache.conf.default; then rm -f %D/etc/videocache.conf; fi
Xetc/videocache.conf.default
X@exec [ -f %B/videocache.conf ] || cp %B/%f %B/videocache.conf
X%%DATADIR%%/Errors.py
X%%DATADIR%%/__init__.py
X%%DATADIR%%/config.py
X%%DATADIR%%/parser.py
X%%DATADIR%%/videocache.py
X@dirrm %%DATADIR%%
59e91fe5983ab7acb041c36bc4b7a429
exit

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./videocache/distinfo
#
echo x - ./videocache/distinfo
sed 's/^X//' >./videocache/distinfo << '830aaaf6e4ba4da697deb1686c704ec0'
XMD5 (videocache-1.9.1.tar.gz) = 0dac8dd20d67c252e1da13e1e9ad5cd5
XSHA256 (videocache-1.9.1.tar.gz) = b814c6dec236c842dda1258be142556874ca4c33247a83e11609bfa6bb10cf8b
XSIZE (videocache-1.9.1.tar.gz) = 52631
830aaaf6e4ba4da697deb1686c704ec0
exit

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./videocache/files
#
echo c - ./videocache/files
mkdir -p ./videocache/files > /dev/null 2>&1
exit

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./videocache/files/squid.conf.example
#
echo x - ./videocache/files/squid.conf.example
sed 's/^X//' >./videocache/files/squid.conf.example << '50d6089612b58b05041e010a6d8777cc'
X==============================================================================
X
XAdd the following sample lines to your squid.conf:
X
X# --BEGIN-- videocache config for squid
Xurl_rewrite_program %%PREFIX%%/bin/python %%DATADIR%%/videocache/videocache.py
Xurl_rewrite_children 7
Xacl videocache_allow_url url_regex -i \.youtube\.com\/get_video\?
Xacl videocache_allow_url url_regex -i \.googlevideo\.com\/videoplayback \.googlevideo\.com\/videoplay \.googlevideo\.com\/get_video\?
Xacl videocache_allow_url url_regex -i \.google\.com\/videoplayback \.google\.com\/videoplay \.google\.com\/get_video\?
Xacl 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\?
Xacl 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\?
Xacl 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\?
Xacl 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\?
Xacl videocache_allow_url url_regex -i proxy[a-z0-9\-][a-z0-9][a-z0-9][a-z0-9]?\.dailymotion\.com\/
Xacl videocache_allow_url url_regex -i vid\.akm\.dailymotion\.com\/
Xacl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv
Xacl videocache_allow_url url_regex -i bitcast\.vimeo\.com\/vimeo\/videos\/
Xacl videocache_allow_url url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]?
Xacl videocache_allow_url url_regex -i \.files\.youporn\.com\/(.*)\/flv\/
Xacl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv
Xacl 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]?\.ta-z0-9]?[a-z0-9]?\.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram)
Xacl videocache_allow_url url_regex -i video\.break\.com\/(.*)\.(flv|mp4)
Xacl videocache_allow_dom dstdomain .mccont.com dl.redtube.com .cdn.dailymotion.com
Xacl videocache_deny_url url_regex -i http:\/\/[a-z][a-z]\.youtube\.com http:\/\/www\.youtube\.com
Xurl_rewrite_access deny videocache_deny_url
Xurl_rewrite_access allow videocache_allow_url
Xurl_rewrite_access allow videocache_allow_dom
Xredirector_bypass on
X# --END-- videocache config for squid
X
X==============================================================================
50d6089612b58b05041e010a6d8777cc
exit

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./videocache/files/pkg-message.in
#
echo x - ./videocache/files/pkg-message.in
sed 's/^X//' >./videocache/files/pkg-message.in << '53696bb2c719aeb9943061b390e212a7'
XSee the following sample file to configure your ACL's on squid.conf:
X
X	%%EXAMPLESDIR%%/squid.conf
53696bb2c719aeb9943061b390e212a7
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904301857.n3UIvTQA063581>