VideoCache – Tambahan buat Squid biar nge-Cache Video Streaming
Sekedar Informasi:
Kadang kesel juga biarpun internet dah kenceng, tp streaming berasa lambat …
Apalagi kl kita sering akses video itu, atau temen2 sekantor pada akses video yang sama …
Kebayang brp gede benwit yg abis utk akses video tsb, kl tiap orang streaming lsg
Setelah googling2 … akhir nya nemu solusi nya … yaitu videocache, sebuah url rewriter utk squid.
Cara install nya gak ribet, krn dia cmn sekedar python script.
Script ini berlaku utk situs2 seperti:
Youtube, Vimeo, Dailymotion, Metacafe, Google Video, dan beberapa situs video streaming porno ![]()
Persiapan:
1. http://pypi.python.org/packages/source/u/urlgrabber/urlgrabber-3.1.0.tar.gz
2. http://iniparse.googlecode.com/files/iniparse-0.3.1.tar.gz
3. ftp://ftp.estpak.ee/pub/FreeBSD/ports/distfiles/videocache-1.9.2.tar.gz
Download dan extract ketiga file di atas. Lalu install masing2 dengan cara:
* python setup.py install
Nah … berikutnya edit file /etc/videocache.conf
Edit bagian ini, sesuaikan dengan setting squid Anda …
proxy = http://127.0.0.1:3128/
Lalu edit file squid.conf Anda, dan tambahkan baris berikut:
url_rewrite_program /usr/share/videocache/videocache.py
url_rewrite_children 20
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
Tidak ada yg perlu dimodif utk bagian ini … biarkan saja apa ada nya …
Lalu tinggal direstart aja squid nya …
Nah kalo misalkan gak jalan … coba cek ownership:
- /var/log/videocache/videocache.log
- /var/spool/videocache
Pastikan ownership nya sama dengan uid yg menjalankan squid …
Apabila video baru pertama kali diakses, biasanya loading pertama agak lama … tp begitu udah play, hampir nyaris terputus … tergantung koneksi internet juga ya. Tp setidaknya jauh lebih mendingan drpd tanpa videocache ini.
En kl diakses lagi, gak bakal loading dari nol lagi ![]()
Semoga bermanfaat …
* Config ini udah saya pasang di Linux en di MacOS X
- squid.conf Sederhana en Buat Transparent Proxy
- Setting Linux Sebagai AFP Server (appletalk) … En nongol di Finder MacOS X
- What Services are Running on My Macbook…


6 Comments
Dix, maksudnya dipasang di MacOSX itu gimana ? lha emang pasang squid juga ? ato ente pake server version kah ?
@sai: nope … mac os x biasa … tinggal pake darwinport … ato compile sendiri aja
udah ga jalan di youtube versi baru
munculnya selalu REQUEST pa harus nunggu dulu untuk HIT..
salam…
thanks sudah membatu banget totorial ini
hasil nya berhasil
2010-08-07 06:53:34,225 1863 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,226 1862 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,226 1864 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,227 1868 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,228 1865 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,229 1870 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,230 1866 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,232 1867 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,232 1871 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:34,234 1869 – - RELOAD – videocache plugin was reloaded.
2010-08-07 06:53:38,902 2211 – - XMLRPCSERVER – Starting XMLRPCServer on port 9100.
2010-08-07 06:53:38,903 2211 – - SCHEDULEDER – Download Scheduler starting.
selalu muncul itu knapa ya ?
Leave a reply