BolPoint.wordpress.com

January 30, 2011

cache mp3 dari indowebster, dan speedtest

Filed under: Linux — bolpoint @ 3:30 am

ini memanfaatkan videocache dengan squid 2.6

saya copy tutorialnya

Jika anda meneruskan membaca artikel ini, saya asumsikan anda telah menginstall squid dan videocache dan keduanya telah berjalan dengan baik.

pertama pastikan squid dan videocache sudah di shutdown

squid -k shutdown

killall -9 python

killall -9 python

lalu tambahkan kode berikut pada squid.conf

acl videocache_allow_url url_regex -i www[0-9][0-9]\.indowebster\.com\/(.*)mp3

tambahkan juga kode berikut pada /usr/share/videocache/videocache.py

untuk memudahkan, saya paste code di pastebin, http://pastebin.com/f74e131b4

masih di videocache.py, cari bagian # Website specific options lalu tambahkan:

(enable_indowebster_cache, indowebster_cache_dir, max_indowebster_video_size, min_indowebster_video_size) = set_globals(‘indowebster’)

 

tambah ini juga pada    /usr/share/videocache/config.py

# Indowebster.com Specific Options

enable_indowebster_cache = Option(1)

indowebster_cache_dir = Option(‘indowebster’)

max_indowebster_video_size = Option(0)

min_indowebster_video_size = Option(0)

kini kita edit /etc/videocache.conf lalu tambahkan config berikut:

# Indowebster.com Options

enable_indowebster_cache = 1

break_indowebster_dir = break

max_indowebster_video_size = 0

min_indowebster_video_size = 0

lalu terkahir, masuk ke folder cache videocache lalu buat folder indowebster dengan hak kepemilikan untuk squid
mkdir indowebster
chown -R squid.squid indowebster
Ok, jalankan kembali squidnya
squid
Jika ada error, coba cek log di cache.log
tail -f /var/log/cache.log
Jika tidak ada error mari kita coba streaming ke indowebster :
tail -f /var/log/videocache/videocache.log
2009-08-31 12:24:53,861 30553 xx.xx.xx.xx 85dce170f06ed5815d471b89f72e8149.mp3 URL_HIT INDOWEBSTER http://www43.indowebster.com/85dce170f06ed5815d471b89f72e8149.mp3
2009-08-31 12:24:53,861 30553 xx.xx.xx.xx 85dce170f06ed5815d471b89f72e8149.mp3 CACHE_MISS INDOWEBSTER Requested video was not found in cache.
2009-08-31 12:24:53,864 30553 xx.xx.xx.xx 85dce170f06ed5815d471b89f72e8149.mp3 NEW_URL INDOWEBSTER http://www43.indowebster.com/85dce170f06ed5815d471b89f72e8149.mp3
2009-08-31 12:24:58,416 30558 xx.xx.xx.xx 85dce170f06ed5815d471b89f72e8149.mp3 SCHEDULED INDOWEBSTER Video scheduled for download.
2009-08-31 12:24:58,426 30553 xx.xx.xx.xx – REQUEST – http://www43.indowebster.com/85dce170f06ed5815d471b89f72e8149.mp3
2009-08-31 12:24:58,426 30553 xx.xx.xx.xx 85dce170f06ed5815d471b89f72e8149.mp3 URL_HIT INDOWEBSTER http://www43.indowebster.com/85dce170f06ed5815d471b89f72e8149.mp3
2009-08-31 12:24:58,426 30553 xx.xx.xx.xx 85dce170f06ed5815d471b89f72e8149.mp3 CACHE_MISS INDOWEBSTER Requested video was not found in cache.
2009-08-31 12:24:58,429 30553 xx.xx.xx.xx 85dce170f06ed5815d471b89f72e8149.mp3 NEW_URL INDOWEBSTER http://www43.indowebster.com/85dce170f06ed5815d471b89f72e8149.mp3

Jika HIT lognya seperti ini (kebetulan dapet hitnya yg .flv) tutorial diatas untuk cache mp3 saja, tapi anda bisa modifikasi kode diatas sesuka anda.

2009-08-31 12:27:08,702 30791 xx.xx.xx.xx – REQUEST – http://www51.indowebster.com/b2395c108a3c6d2d150f2177fa6193d4.flv.jpg

2009-08-31 12:27:10,055 30791 xx.xx.xx.xx – REQUEST – http://www51.indowebster.com/b2395c108a3c6d2d150f2177fa6193d4.flv

2009-08-31 12:27:10,056 30791 xx.xx.xx.xx b2395c108a3c6d2d150f2177fa6193d4.flv URL_HIT INDOWEBSTER http://www51.indowebster.com/b2395c108a3c6d2d150f2177fa6193d4.flv

2009-08-31 12:27:10,056 30791 xx.xx.xx.xx b2395c108a3c6d2d150f2177fa6193d4.flv CACHE_HIT INDOWEBSTER Video was served from cache.

2009-08-31 12:27:10,056 30791 xx.xx.xx.xx b2395c108a3c6d2d150f2177fa6193d4.flv NEW_URL INDOWEBSTER 303:http://192.168.0.250/videocache/indowebster/b2395c108a3c6d2d150f2177fa6193d4.flv?

untuk cache speedtest tambahkan aja.

 

acl speedtest dstdomain .speedtest.cbn.net
acl speedtest dstdomain .speedtest.net
acl speedtest dstdomain .speedtest.
acl speedtest dstdomain .speedtest.telkomspeedy.com
cache allow speedtest



thank ya mas atas tutorialnya http://www.clovanzo.com/?p=42

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: