grr
This commit is contained in:
parent
02f3b20806
commit
00ee57a1ac
30
zymp3
30
zymp3
@ -1,9 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
##############################################
|
||||||
|
# Title: Zymp3 v0.1
|
||||||
|
# Description: Convert youtube video to mp3
|
||||||
|
# Author: Justin Moore
|
||||||
|
# Contact: silvernode@gmail.com
|
||||||
|
# github: https://github.com/silvernode/zymp3
|
||||||
|
##############################################
|
||||||
|
|
||||||
|
|
||||||
|
#I wrote this in 2011 and realize now I could have done this alot better
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#set music directory path
|
||||||
MUSICDIR="/home/$USER/Music"
|
MUSICDIR="/home/$USER/Music"
|
||||||
|
|
||||||
|
|
||||||
|
#convert youtube videos to mp3 with zenity progess bar
|
||||||
backend()
|
backend()
|
||||||
{
|
{
|
||||||
t=~/.youtube-dl-$RANDOM-$RANDOM.flv
|
t=~/.youtube-dl-$RANDOM-$RANDOM.flv
|
||||||
@ -16,16 +29,15 @@ rm $t
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#first zenity gui window (paste youtube link)
|
||||||
gui()
|
gui()
|
||||||
{
|
{
|
||||||
x=$(zenity --title="Zymp3 0.1-1" --entry --text "Paste youtube link here: ")
|
x=$(zenity --title="Zymp3 0.1-1" --entry --text "Paste youtube link here: ")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [[ $? == 0 ]] ; then
|
if [[ $? == 0 ]] ; then
|
||||||
|
|
||||||
|
|
||||||
gui2
|
gui2
|
||||||
else
|
else
|
||||||
exit 0;
|
exit 0;
|
||||||
@ -37,6 +49,8 @@ fi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#second gui window to name your mp3 file
|
||||||
|
|
||||||
gui2()
|
gui2()
|
||||||
{
|
{
|
||||||
y=$(zenity --title="Filename" --entry --text "Name your file: ")
|
y=$(zenity --title="Filename" --entry --text "Name your file: ")
|
||||||
@ -52,7 +66,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#notify the user that the mp3 file has been moved to their music folder
|
||||||
open()
|
open()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -71,7 +85,7 @@ fi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#move the mp3 file to the users music directory
|
||||||
move()
|
move()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -80,6 +94,7 @@ mv "$y.mp3" /home/$USER/Music
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#call the backend function so we can use it
|
||||||
dconvert()
|
dconvert()
|
||||||
{
|
{
|
||||||
backend "$x" "$y.mp3"
|
backend "$x" "$y.mp3"
|
||||||
@ -98,6 +113,7 @@ fi
|
|||||||
open
|
open
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#call the main gui
|
||||||
gui
|
gui
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user