VideoCache

Problem after upgrade 1.9.1

by soho on 16 Feb 2009

Hi,

after upgrade videocache-1.8.1 to 1.9.1-videcache videos began to show some errors: we're sorry this video is no longer available

Below my videocache.conf, squid.conf and /etc/httpd/conf.d/videocache.conf

file : /etc/videocache.conf

# This option controls the global behavior of videocache plugin.
# If it is 0, videocache will stop caching or serving anything.
# This option's value can be either 0 or 1.
enable_video_cache = 1

# The hostname or IP address of the system on which caching is being done. This is
# used for serving the videos from the cache. Please don't use http:// or slashes (/).
# Just specify the domain name or IP address.
# Example : localhost.localdomain
# or proxy.example.com
# or 192.168.36.204
# or <Proxy_Server_IP_OR_Domain>
cache_host = 127.0.0.1

# Proxy for http content.
# Example : http_proxy = http://<Proxy_Server_IP_OR_Domain>:<Proxy_port>/
# or http://proxy.example.com:3128/
proxy = http://127.0.0.1:3128/

# If the above proxy requires authentication, please specify the username.
proxy_username = 

# If the above proxy requires authentication, please specify the password.
proxy_password = 

# No of times a video should be requested before we start caching it.
hit_threshold = 2

# Base directories for caching the videos.
# You can specify multiple caching directories here separated by '|' symbol.
# Please try to avoid special characters in directory names like spaces, $ etc.
# For Example : base_dir = /var/spool/videocache/ | /videocache2/stuff-new/|/new_videocache
base_dir = /var/spool/videocache/

# Directory to store partially downloaded videos. Directory name is relative to base_dir.
# e.g. if you specify temp_dir = tmp, actual path for storing partially downloaded
# videos would be /var/spool/videocache/tmp/ .
temp_dir = tmp

# The maximum number of parallel downloads allowed. If all connections are consumed,
# videos will be queued for download.
max_parallel_downloads = 30

# Enable the videocache cleaner script which will remove videos
# from cache which have not been used since long.
# The value of this option can be 0 or 1.
enable_videocache_cleaner = 0

# The maximum life of a video in cache without being used. If the video was not accessed
# for more than 'video_lifetime' days, it'll be removed from the cache. The unit of
# video_lifetime is days.
# For Example : video_lifetime = 3 will remove videos which were not used since last 3 or more days.
video_lifetime = 60

# Directory where videocache logs will be stored.
logdir = /var/log/videocache/

# Maximum size of logfile specified above. The size is in mega bytes.
# Note : Please don't use max_logfile_size = 10MB. Don't append MB.
max_logfile_size = 10

# The logfiles are automatically rotated once they have exceeded the max_logfile_size.
# max_logfile_backups is the number of backup files you want to keep.
# e.g. max_logfile_backups = 2 will keep videocache.log and videocache.log.1 and
# videocache.log.2 as logfiles.
max_logfile_backups = 10

# XMLRPCServer is used for memory sharing across different instances of
# videocache. Leave these settings as it is if you don't have a fair
# idea of XMLRPCServer. This will be same as cache_host in almost all the cases.
rpc_host = 127.0.0.1

# Please make sure this port is not currently in use. If it is in use by some
# other program, change this to some port above 1024 which is not in use by
# any other program.
rpc_port = 9100

# This option enables the caching of youtube videos.
# This option's value can be either 0 or 1.
enable_youtube_cache = 1

# Directory to cache youtube videos. Directory name is relative to base_dir.
# e.g. if you specify youtube_cache_dir = youtube, actual path for caching
# youtube videos would be /var/spool/videocache/youtube/ .
youtube_cache_dir = youtube

# Maximum total size of youtube caching directory. 0 for unlimited.
# This size is in Mega Bytes.
# e.g. youtube_cache_size = 200 will limit your cache size to 200MB.
# NOTE : Don't use cache_size = 200MB. Don't append MB.
youtube_cache_size = 0

# Youtube videos with size more than max_youtube_video_size will not be cached. This
# size is in kilo bytes. Use 0 for unlimited caching.
# e.g. max_youtube_video_size = 10000. Only videos with size less than 10MB (10000KB)
# will be cached.
# NOTE : Don't use max_youtube_video_size = 10000KB. Don't append KB.
max_youtube_video_size = 0

# Youtube videos with size less than min_youtube_video_size will not be cached. This
# size is in kilo bytes. Use 0 for no lower limit.
# e.g. min_youtube_video_size = 10. Only videos with size more than 10KB will be cached.
# NOTE : Don't use min_youtube_video_size = 10KB. Don't append KB.
min_youtube_video_size = 0

# Metacafe.com Options
enable_metacafe_cache = 1
metacafe_cache_dir = metacafe
metacafe_cache_size = 0
max_metacafe_video_size = 0
min_metacafe_video_size = 0

# Dailymotion.com Options
enable_dailymotion_cache = 1
dailymotion_cache_dir = dailymotion
dailymotion_cache_size = 0
max_dailymotion_video_size = 0
min_dailymotion_video_size = 0

# Google.com Options
enable_google_cache = 1
google_cache_dir = google
google_cache_size = 0
max_google_video_size = 0
min_google_video_size = 0

# Redute.com Options
enable_redtube_cache = 1
redtube_cache_dir = redtube
redtube_cache_size = 0
max_redtube_video_size = 0
min_redtube_video_size = 0

# Xtube.com Options
enable_xtube_cache = 1
xtube_cache_dir = xtube
xtube_cache_size = 0
max_xtube_video_size = 0
min_xtube_video_size = 0

# Vimeo.com Options
enable_vimeo_cache = 1
vimeo_cache_dir = vimeo
vimeo_cache_size = 0
max_vimeo_video_size = 0
min_vimeo_video_size = 0

# Wrzuta.pl Options
enable_wrzuta_cache = 1
wrzuta_cache_dir = wrzuta
wrzuta_cache_size = 0
max_wrzuta_video_size = 0
min_wrzuta_video_size = 0

# Youporn.com Options
enable_youporn_cache = 1
youporn_cache_dir = youporn
youporn_cache_size = 0
max_youporn_video_size = 0
min_youporn_video_size = 0

# Soapbox.msn.com Options
enable_soapbox_cache = 1
soapbox_cache_dir = soapbox
soapbox_cache_size = 0
max_soapbox_video_size = 0
min_soapbox_video_size = 0

# Tube8.com Options
enable_tube8_cache = 1
tube8_cache_dir = tube8
tube8_cache_size = 0
max_tube8_video_size = 0
min_tube8_video_size = 0

# Tvuol.uol.com.br Options
enable_tvuol_cache = 1
tvuol_cache_dir = tvuol
tvuol_cache_size = 0
max_tvuol_video_size = 0
min_tvuol_video_size = 0

# Blip.tv Options
enable_bliptv_cache = 1
bliptv_cache_dir = bliptv
bliptv_cache_size = 0
max_bliptv_video_size = 0
min_bliptv_video_size = 0

# Break.com Options
enable_break_cache = 1
break_cache_dir = break
break_cache_size = 0
max_break_video_size = 0
min_break_video_size = 0

file: /etc/squid/squid.conf

http_port 3128 transparent
snmp_port 3400

cache_mem 512 MB
cache_swap_high 90
cache_swap_low 80
maximum_object_size 400 MB
maximum_object_size_in_memory 128 KB
ipcache_size 51200
ipcache_high 95
ipcache_low 90
fqdncache_size 51200

cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
cache_dir aufs /var/spool/squid 120000 32 256

# hide squid version
httpd_suppress_version_string on

access_log /var/log/squid/access.log
cache_log none
cache_store_log none

coredump_dir /var/spool/squid

mime_table /etc/squid/mime.conf
pid_filename /var/run/squid.pid
debug_options ALL, 5
log_fqdn off

refresh_pattern ^ftp:           15      20%     2280
refresh_pattern ^gopher:        15      0%      2280
refresh_pattern .               15      20%     2280
half_closed_clients off

## ACLs
acl all src all
acl public_aloo snmp_community public
# Public network
acl internet src 189.x.x.x/xx
# Private network
acl intranet src 192.168.0.0/16 10.0.0.0/8 172.16.0.0/12

miss_access allow all
snmp_access allow public_aloo all

## No Cache
acl NOCACHE url_regex "/etc/squid/no-cache" \\?
acl NOCACHE url_regex gateway/gateway.dll? \\?
no_cache deny NOCACHE

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

acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 82
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443 563     # https, snews
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl Safe_ports port 901         # swat
acl Safe_ports port 1025-65535  # unregistered ports
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge

#http_access deny !Safe_ports
#http_access deny CONNECT !SSL_ports

http_access allow localhost
http_access allow internet
http_access allow intranet
http_access deny all

cache_mgr proxy@my-domain.com
cache_effective_user squid
cache_effective_group squid
visible_hostname proxy.my-domain.com

unique_hostname  proxy-my
via off
forwarded_for off
logfile_rotate 24
pipeline_prefetch on
shutdown_lifetime 1 second
read_ahead_gap 2 KB
quick_abort_min 0 KB
client_db off
buffered_logs on
positive_dns_ttl 24 hours
negative_dns_ttl 10 seconds
request_timeout 40 seconds
connect_timeout 40 seconds
pconn_timeout 40 seconds
dns_nameservers 172.16.0.3 172.16.0.1
emulate_httpd_log off
log_ip_on_direct on

file : /etc/httpd/conf.d/videocache.conf

#
# videocache is a squid url rewriter to cache videos from various websites.
# Check http://cachevideos.com/ for more details.
#

# ------------------- Note This --------------------
# Don't forget to reload httpd and squid services if you change this file.

Alias /videocache /var/spool/videocache

<Directory /var/spool/videocache>
  Options +Indexes
  Order Allow,Deny
  #Comment the following line and uncomment the next for public use 
  #Deny from all
  Allow from all
</Directory>

The logs:

file: /var/log/squid/access.log

1234742071.705    152 189.x.x.250 TCP_MISS/304 239 GET http://www.google.com/crossdomain.xml - DIRECT/209.85.193.104 -
1234742071.722    483 189.x.x.250 TCP_MISS/303 594 GET http://www.youtube.com/get_video? - DIRECT/208.65.153.253 text/html
1234742071.752      7 189.x.x.250 TCP_MISS/303 498 GET http://v10.cache.googlevideo.com/get_video? - NONE/- -
1234742071.936    230 189.x.x.250 TCP_MISS/200 1025 GET http://www.google.com/reviews/y/read2? - DIRECT/209.85.193.104 text/xml

file: /var/log/videocache/videocache.log

2009-02-15 20:55:48,344 3469 189.x.x.250 - REQUEST - http://v10.cache.googlevideo.com/get_video?origin=ash-v375.ash.youtube.com&video_id=pPu9tUCHv0Q&ip=189.x.x.253&region=0&signature=01D4B9D181076E1039EE997288E26F73A478474C.9FC36E8C331D5EC823203B9B2C43735754F52ECE&sver=2&expire=1234763751&key=yt1&ipbits=0
2009-02-15 20:55:48,347 3469 189.x.x.250 pPu9tUCHv0Q URL_HIT YOUTUBE http://v10.cache.googlevideo.com/get_video?origin=ash-v375.ash.youtube.com&video_id=pPu9tUCHv0Q&ip=189.x.x.253&region=0&signature=01D4B9D181076E1039EE997288E26F73A478474C.9FC36E8C331D5EC823203B9B2C43735754F52ECE&sver=2&expire=1234763751&key=yt1&ipbits=0
2009-02-15 20:55:48,349 3469 189.x.x.250 pPu9tUCHv0Q CACHE_HIT YOUTUBE Video was served from cache.
2009-02-15 20:55:48,350 3469 189.x.x.250 pPu9tUCHv0Q NEW_URL YOUTUBE 303:http://127.0.0.1/videocache/0/youtube/pPu9tUCHv0Q?origin=ash-v375.ash.youtube.com&video_id=pPu9tUCHv0Q&ip=189.x.x.253&region=0&signature=01D4B9D181076E1039EE997288E26F73A478474C.9FC36E8C331D5EC823203B9B2C43735754F52ECE&sver=2&expire=1234763751&key=yt1&ipbits=0

any suggestions? I do not see where is the error... :(

6 Answers

by Kulbir Saini on 16 Feb 2009

Sergio,

The problem is with your /etc/httpd/conf.d/videocache.conf. Did you run update-vc command? Try running update-vc command once. I think it'll be fine after that. Let me know if the problem persists.

Thank You!

by soho on 16 Feb 2009

Hi Kulbir.

Thanks for the answer.

Yes, I'm run update-vc command, but not solve the problem.

file : /etc/httpd/conf.d/videocache.conf

Alias /videocache /var/spool/videocache

Options +Indexes
Order Allow,Deny
#Deny from all
Allow from all

My OS is CentOS 5.2 and upgrading with rpm -Uvh videocache-1.9.1.rpm

by Kulbir Saini on 16 Feb 2009

Sergio,

I can't really understand why your update-vc is not working properly. Please use this as your videocache.conf for apache.

Alias /videocache/0 /var/spool/videocache

<Directory /var/spool/videocache>
  Options +Indexes
  Order Allow,Deny
  #Comment the following line and uncomment the next for public use 
  Allow from all
  #Deny from all
</Directory>

Can you paste your update-vc program at http://pastebin.com ? I want to have a look at it for further inspection.

Thank you for using videocache :)

by soho on 18 Feb 2009

hi Kulbir and thanks, again.

I applied the changes mentioned above in /etc/httpd/conf.d/videocache.conf but still the same problem.

Below the file processed by http://pastebin.com

Edit by admin : File removed.

by Kulbir Saini on 18 Feb 2009

Sergio,

Thanks for supplying the file. It'll not be a problem in next version.

Thank You!

by soho on 18 Feb 2009

Thanks Kulbir.

Your project is excellent and I thank once again for providing it.

You need to sign in. Please sign in to add answer to this question.