Contents |
This howto covers the process of installing videocache on pfSense. This howto assumes that you already have squid installed, configured, and working.
| This is unsupported, use at your own risk |
Install python and additional libraries, using either the console or ssh.
# pkg_add -r python # pkg_add -r py25-bsddb # pkg_add -r py25-gdbm # pkg_add -r py25-sqlite3 # pkg_add -r py25-tkinter
Download the latest version from the URLGrabber Download Archive. Replace x.x.x with the version you are installing.
# fetch http:/linux.duke.edu/projects/urlgrabber/download/urlgrabber-x.x.x.tar.gz # tar -xzf urlgrabber-x.x.x.tar.gz # cd urlgrabber-x.x.x # python setup.py bdist_rpm # python setup.py install
Download the latest version of python-iniparse from Iniparse Project Website. Replace x.x.x with the version you are installing.
# fetch http:/iniparse.googlecode.com/files/iniparse-x.x.x.tar.gz # tar -xzf iniparse-x.x.x.tar.gz # cd iniparse-x.x.x # python setup.py bdist_rpm # python setup.py install
# fetch http:/cachevideos.com/sites/default/files/pub/videocache/videocache-x.x.tar.gz # tar -xvzf videocache-x.x.tar.gz # python setup.py install
Edit the /etc/videocache.conf file and change the following options in the file.
Add the following lines to /usr/local/pkg/squid.inc after acl.
# --BEGIN-- videocache config for squid url_rewrite_program /usr/bin/python /usr/share/videocache/videocache.py url_rewrite_children 10 acl videocache_allow_url url_regex -i \.youtube\.com\/get_video acl videocache_allow_url url_regex -i \.cache[a-z0-9]?[a-z0-9]?[a-z0-9]?\.googlevideo\.com\/videoplayback acl videocache_allow_url url_regex -i \.cache[a-z0-9]?[a-z0-9]?[a-z0-9]?\.googlevideo\.com\/get_video acl videocache_allow_url url_regex -i proxy\-[0-9][0-9]\.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_dom dstdomain v.mccont.com vp.video.google.com dl.redtube.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 redirector_bypass on # --END-- videocache config for squid
Save and restart squid service and you have videocache running on your PFsense.
You may also need to disable the https option in the General Setup Settings.
Courtesy of Mohd Izhar Ali, with some minor changes.
If you have issues, you may also want to take a look at: http://www.bellera.cat/josep/videocache/