3月 26 2009

(前略)自動的に iTunes に登録

Published by HoLY at 2:30:14 under tech

さらに前の続き前回のスクリプトを ~/bin/encmp3.sh とか置く。

~/bin/asfdownload.sh

#!/bin/sh 

filename=$1 
url=$2 

if [ -z $url ]; then 
    echo "usage: $0 filename url" 
    exit 1 
fi 

tmpfile=`mktemp /tmp/asfdownload.XXXXXXXX` 

if echo $url|grep http ; then 
 wget "$2" -O $tmpfile 
 url=$(sed -ne '/mms/s/^.*\(mms.*\)".*$/\1/;/mms/p' $tmpfile) 
 cat $tmpfile 
fi 

echo "-----" 
echo "Downloading $url" 
echo "-----" 

mplayer -dumpstream -dumpfile $filename $url 

rm $tmpfile 

asf2itunes.sh

#!/bin/sh

filename=$1
url=$2

if [ -z $url ]; then
    echo "usage: $0 filename url"
    exit 1
fi

~/bin/asfdownload.sh "$1" "$2"
~/bin/encmp3.sh "$1"

まだ適当なんで主に自分向けメモ。

Tags: ,

No responses yet

Trackback URI | Comments RSS

Leave a Reply