From ca41eddfdc979955105cce572e659941544d6f6d Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Thu, 9 Oct 2014 20:44:15 +0100 Subject: alles neu macht der mai --- youtube_mp3 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 youtube_mp3 (limited to 'youtube_mp3') diff --git a/youtube_mp3 b/youtube_mp3 new file mode 100755 index 0000000..107f0f0 --- /dev/null +++ b/youtube_mp3 @@ -0,0 +1,20 @@ +#!/bin/sh + +usage() +{ + echo "$0 " + exit 1 +} + +if [ -z $1 ] || [ -z $2 ]; then usage; fi + +TMP_FN=/tmp/youtube-dl-$RANDOM +while [ -a $TMP_FN ]; do + TMP_FN=/tmp/youtube-dl-$RANDOM +done +echo $TMP_FN + +youtube-dl --output=$TMP_FN --format=18 "$1" +ffmpeg -i $TMP_FN -acodec libmp3lame -ac 2 -ab 128k -vn -y "$2" +rm $TMP_FN + -- cgit v1.2.3