Simple script written in zenity that takes a user inputted YouTube url and creates an mp3 file in the users Music folder.
requires
youtube-dl
ffmpeg
libav-tools
#! /bin/bash
#Written by oenahs
#Feb. 14 2013
#getFromYT v0.4
#This is a zenity frontend for youtube-dl
#It uses a user input of a YouTube url to produce an mp3 320 file
#Requires youtube-dl, ffmpeg, libavtools to be installed
###CHANGES###
#removed all formats but mp3 320(v0.3)
#added dialog to show progress of download(v0.4)
#code cleanup(v0.4)
#Audio Formats
#mp3 320
title=getFromYT
#URL Input
url=$(zenity --entry \
--title="$title" \
--width 200 \
--text="Enter YouTube url")
case $? in
1)
zenity --error \
--text="Download Cancelled"
exit
;;
-1)
zenity --error \
--text="Download Cancelled"
exit
;;
esac
#Fetching Process
cd /tmp
youtube-dl -l -w --no-continue --no-part --no-mtime --extract-audio --audio-format mp3 --audio-quality 320 $url |
zenity zenity --text-info \
--title="$title"
case $? in
1)
zenity --error \
--text="Download Cancelled"
exit
;;
-1)
zenity --error \
--text="Download Cancelled"
exit
;;
esac
#File Download/Save location
cd /tmp #change this if you want
mv *.mp3 $HOME/Music #change this if you want
Ok ill add a function showing the process if you would like :)