IMPORTANT NOTE : Check http://cachevideos.com/installation/ for latest details.

Index
=====
  1. Requires
  2. Installation
    a. Using setup.py from source
    b. Manually from source step by step
  3. Configuration
  4. Bugs, Suggestions, Comments
  5. Online Help

1. Requires
===========
  a. squid >= 2.6
  b. python >= 2.4
  c. python-urlgrabber
  d. python-iniparse
  e. Apache (httpd) or any other Web Server

2a. Installation (using setup.py from source)
=============================================
  a) Download latest version of videocache from http://cachevideos.com/download/ .
  b) Untar the package.
  [root@localhost root]# tar -xvzf videocache-x.x.tar.gz

  c) Go to videocache-x.x directory
  [root@localhost root]# cd videocache-x.x

  d) Run setup.py as root for installing videocache
  [root@localhost videocache-x.x]# python setup.py install

  BINGO!! You are done with installation. In case you get any error while
  installing videocache, there will be proper logging in videocache-setup.log
  in current directory.

  Skip to Configuration step (#3) now.

2b. Installation (from source step by step)
============================================
  a) Download latest version of videocache from http://cachevideos.com/download/ .
  b) Untar the package.
  [root@localhost root]# tar -xvzf videocache-x.x.tar.gz

  c) Go to videocache-x.x directory
  [root@localhost root]# cd videocache-x.x

  d) Copy videocache-httpd.conf to /etc/httpd/conf.d/videocache.conf
  [root@localhost videocache-x.x]# cp videocache-httpd.conf /etc/httpd/conf.d/videocache.conf

  e) Copy videocache-sysconfig.conf to /etc/videocache.conf
  [root@localhost videocache-x.x]# cp videocache-sysconfig.conf /etc/videocache.conf

  f) Copy update-vc to /usr/sbin/update-vc and change permission to executable.
  [root@localhost videocache-x.x]# cp update-vc /usr/sbin/update-vc
  [root@localhost videocache-x.x]# chmod 744 /usr/sbin/update-vc

  g) Copy vccleaner to /usr/sbin/vccleaner and change permission to executable.
  [root@localhost videocache-x.x]# cp vccleaner /usr/sbin/vccleaner
  [root@localhost videocache-x.x]# chmod 744 /usr/sbin/vccleaner

  h) Copy videocache directory to /usr/share/
  [root@localhost videocache-x.x]# cp -r videocache /usr/share/

  i) Create directories to cache videos
  [root@localhost root]# cd /var/spool/
  [root@localhost spool]# mkdir videocache
  [root@localhost spool]# mkdir videocache/tmp videocache/youtube videocache/metacafe videocache/dailymotion videocache/google videocache/redtube videocache/xtube videocache/vimeo videocache/wrzuta videocache/youporn videocache/soapbox videocache/tube8 videocache/tvuol videocache/bliptv videocache/break
  [root@localhost spool]# chown -R squid:squid videocache
  [root@localhost spool]# chmod -R 755 videocache

  j) Create logdir /var/log/videocache/ and change permissions and ownership
  [root@localhost ~]# mkdir -p /var/log/videocache
  [root@localhost ~]# chmod -R 755 /var/log/videocache/
  [root@localhost ~]# chown -R squid:squid /var/log/videocache/

3. Configuration
================
  Assuming you have squid installed. The following configurations are required to get it running.
  Newbies are instructed to stick with default configuration as much as possible otherwise
  you'll be lost in directory permissions.

  Reload the httpd service as
  [root@localhost root]# service httpd reload

  Add the following lines to your squid.conf which is generally found in
  /etc/squid/squid.conf .

  # --BEGIN-- videocache config for squid
  url_rewrite_program /usr/bin/python /usr/share/videocache/videocache.py
  url_rewrite_children 7
  acl videocache_allow_url url_regex -i \.youtube\.com\/get_video\?
  acl videocache_allow_url url_regex -i \.youtube\.com\/videoplayback \.youtube\.com\/videoplay \.youtube\.com\/get_video\?
  acl videocache_allow_url url_regex -i \.youtube\.[a-z][a-z]\/videoplayback \.youtube\.[a-z][a-z]\/videoplay \.youtube\.[a-z][a-z]\/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 .metacafe.com .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
  redirector_bypass on
  # --END-- videocache config for squid

  Save squid.conf and reload the squid service using
  [root@proxy root]# service squid reload

  SEE README FILE FOR MORE CONFIGURATION OPTIONS.

4. Bugs, Suggestions, Comments
==============================
  File bugs, suggestions or comments at http://cachevideos.com/forum/ .

5. Online Help
==============
  1. Project Website : http://cachevideos.com/
  2. How to configure squid http://fedora.co.in/content/how-configure-squid-proxy-server
  3. How to write custorm squid redirector in python http://fedora.co.in/content/writing-custom-redirector-plugin-squid-python
