Added license and arranged comments

This commit is contained in:
2015-08-09 18:53:58 -07:00
parent 74b4efa7b0
commit 87c5c9b251
4 changed files with 53 additions and 19 deletions

8
LICENSE.txt Normal file
View File

@@ -0,0 +1,8 @@
#License
Copyright (c) 4-digit year, Company or Person's Name
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -4,20 +4,37 @@
#Zymp3 Configuration File #Zymp3 Configuration File
#FILE PATHS #FILE PATHS
INSTALLPATH="/opt/zymp3" #your choice
IMGDIR="/usr/share/pixmaps" #keep set #choose your own install path
DESKTOPFILEDIR="/usr/share/applications" #keep set INSTALLPATH="/opt/zymp3"
#You can change this but icon may not appear
IMGDIR="/usr/share/pixmaps"
#Desktop icon directory ( default recommended)
DESKTOPFILEDIR="/usr/share/applications"
#Default gui - switch between zenity or yad
SET_GUI_BIN="zenity" SET_GUI_BIN="zenity"
EXTENSION="ogg" #change this if you change CODEC
#choose file extension - (does not change format)
#change this if you change CODEC
EXTENSION="ogg"
#Desired bitrate of audio in kilobytes
BITRATE="192"
BITRATE="192" #desired bitrate of mp3 in kilobytes #Codec format of audio file
CODEC="libvorbis" #libmp3lame (mp3), libvorbis (ogg), flac (flac) #libmp3lame (mp3), libvorbis (ogg), flac (flac)
MUSICDIR="/home/$USER/Music/" #must have a trailing slash / CODEC="libvorbis"
#Output directory for audio files
#must have a trailing slash /
MUSICDIR="/home/$USER/Music/"
#VIDEO TMP DIRECTORY #VIDEO TMP DIRECTORY
#You shouldn't need to change these filename but just in case #You shouldn't need to change this but you can
VIDEOFILE=/tmp/youtube-dl-$RANDOM-$RANDOM.flv VIDEOFILE=/tmp/youtube-dl-$RANDOM-$RANDOM.flv
CONVERTED=/tmp CONVERTED=/tmp
@@ -26,9 +43,10 @@ USE_FILE_BROWSER="no" #options- yes, no
#GUI SETTINGS #GUI SETTINGS
URL_BOX_HEIGHT="64" URL_BOX_HEIGHT="64"
URL_BOX_WIDTH="512" URL_BOX_WIDTH="512"
FILENAME_BOX_HEIGHT="64" FILENAME_BOX_HEIGHT="64"
FILENAME_BOX_WIDTH="326" FILENAME_BOX_WIDTH="326"

View File

@@ -2,6 +2,7 @@
source config/zymp3.conf source config/zymp3.conf
#CHECK FOR YAD OR ZENITY AND DEFAULT TO ONE
if [ ! -f /usr/bin/yad ];then if [ ! -f /usr/bin/yad ];then
SET_GUI_BIN="zenity" SET_GUI_BIN="zenity"
elif [ ! -f /usr/bin/zenity ];then elif [ ! -f /usr/bin/zenity ];then
@@ -15,7 +16,8 @@ if [ ! -f /usr/bin/ffmpeg ];then
else else
SET_CONV_TOOL="ffmpeg" SET_CONV_TOOL="ffmpeg"
fi fi
#convert youtube videos to mp3 with zenity progess bar
#PROGRESS BAR
backend() backend()
{ {
@@ -71,7 +73,7 @@ backend()
} }
#first zenity gui window (paste youtube link) #PASTE YOUTUBE LINK - WINDOW
gui() gui()
{ {
VIDURL=$(${SET_GUI_BIN} --title="Zymp3 0.1.7" \ VIDURL=$(${SET_GUI_BIN} --title="Zymp3 0.1.7" \
@@ -98,7 +100,10 @@ gui()
} }
#second gui window to name your mp3 file
#ENTER MP3 FILE NAME OR OPEN FILEBROWSER
#CAN BE SWITCHED IN CONFIG
gui2() gui2()
{ {
@@ -133,7 +138,8 @@ gui2()
#notify the user that the mp3 file has been moved to their music folder #CHECK IF FILEBROWSER VAR IS SET
#IF NOT SET, DEFAULT TO MANUAL TO {MUSICDIR}
open() open()
{ {
@@ -156,8 +162,8 @@ open()
} }
#Check if MUSICDIR exists and create the directory if not #MOVE MP3 FILE TO MUSICDIR
#move the mp3 file to the users music directory #IF MUSICDIR DOES NOT EXIST, CREATE IT
move() move()
{ {
if [ "${USE_FILE_BROWSER}" = "no" ];then if [ "${USE_FILE_BROWSER}" = "no" ];then
@@ -173,10 +179,11 @@ move()
fi fi
} }
#CHECK IF MP3 FILE EXISTS
checkFile() checkFile()
{ {
#check if mp3 file exists
if [ "${USE_FILE_BROWSER}" = "no" ];then if [ "${USE_FILE_BROWSER}" = "no" ];then
if [ -f "${MUSICDIR}${AUDIOFILENAME}.${EXTENSION}" ];then if [ -f "${MUSICDIR}${AUDIOFILENAME}.${EXTENSION}" ];then
notify-send "${AUDIOFILENAME}.${EXTENSION} was saved in ${MUSICDIR}" notify-send "${AUDIOFILENAME}.${EXTENSION} was saved in ${MUSICDIR}"
@@ -217,7 +224,7 @@ checkFile()
dconvert() dconvert()
{ {
#call backend function and pass video URL and input of mp3 file #PASS VIDEO URL AND FILENAME.MP3 TO BACKEND FUNCTION
if [ "${USE_FILE_BROWSER}" = "no" ];then if [ "${USE_FILE_BROWSER}" = "no" ];then
backend "${VIDURL}" "${AUDIOFILENAME}.${EXTENSION}" backend "${VIDURL}" "${AUDIOFILENAME}.${EXTENSION}"
move move

5
zymp3
View File

@@ -14,7 +14,7 @@
#check for config file #CHECK FOR CONFIG FILE
chk_conf(){ chk_conf(){
if [ -f config/zymp3.conf ];then if [ -f config/zymp3.conf ];then
source config/zymp3.conf source config/zymp3.conf
@@ -28,6 +28,7 @@ else
fi fi
} }
#CHECK FOR FUNCTIONS SCRIPT
chk_libs(){ chk_libs(){
if [ -f lib/logic.sh ];then if [ -f lib/logic.sh ];then
source lib/logic.sh source lib/logic.sh
@@ -42,7 +43,7 @@ fi
} }
#call the main gui #RUN CHECKS AND OPEN THE MAIN WINDOW
main(){ main(){
while true;do while true;do
chk_conf chk_conf