getFromYT

By oenahs on Jan 11, 2013

Screenshots

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

Comments

Sign in to comment.
oenahs   -  Feb 19, 2013

Updated with a dialog window to show the process of the youtube-dl download.

 Respond  
oenahs   -  Feb 07, 2013

I have been adding many additions and a new version of the script should be up this week when I have some more time to finish it off

 Respond  
Aion-   -  Jan 12, 2013

Nice, I'd have loved to see how 'youtube-dl' worked exactly, though.

oenahs  -  Jan 12, 2013

Ok ill add a function showing the process if you would like :)

Sign in to comment

Hawkee   -  Jan 11, 2013

Neat. I'd give it a more descriptive title though. It'll be easier to find.

oenahs  -  Jan 12, 2013

Thanks for the recommendation ill look into changing it.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.