Simple share your file with Samba

Who doesn’t know what youtube.com is. You can found any favorites music clips and video there. More than that, you can use youtube.com as your media to share your home-made video there. You can download that too, incase you want to watch your friend video and backup that to your own PC.

Here little bash script to show you how to that. You need ffmpeg if you want convert the video to mpeg format.

#!/bin/bash
# Command: sh convert filename youtubeurl
# Note: don’t use space for filename

url_asli=$2
url_baru=”http://youtube.com/get_video.php?”;
nama_baru=$1

wget $url_asli -O /tmp/$nama_baru;
temporary_file=$url_baru`grep player2.swf /tmp/$nama_baru | cut -d? -f2 | cut -d\” -f1`;

wget “$temporary_file” -O /tmp/$nama_baru.flv

# Remove ‘#’ below if you want to convert it to mpg
# ffmpeg -i /tmp/$nama_baru.flv -y -sameq $nama_baru.mpg;
# rm /tmp/$nama_baru.flv;
# rm /tmp/$nama_baru;

Leave a comment

Your email address will not be published.

*