Added license and arranged comments
This commit is contained in:
parent
74b4efa7b0
commit
87c5c9b251
8
LICENSE.txt
Normal file
8
LICENSE.txt
Normal 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.
|
||||
|
@ -4,20 +4,37 @@
|
||||
#Zymp3 Configuration File
|
||||
|
||||
#FILE PATHS
|
||||
INSTALLPATH="/opt/zymp3" #your choice
|
||||
IMGDIR="/usr/share/pixmaps" #keep set
|
||||
DESKTOPFILEDIR="/usr/share/applications" #keep set
|
||||
|
||||
#choose your own install path
|
||||
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"
|
||||
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="libvorbis" #libmp3lame (mp3), libvorbis (ogg), flac (flac)
|
||||
MUSICDIR="/home/$USER/Music/" #must have a trailing slash /
|
||||
#Codec format of audio file
|
||||
#libmp3lame (mp3), libvorbis (ogg), flac (flac)
|
||||
CODEC="libvorbis"
|
||||
|
||||
#Output directory for audio files
|
||||
#must have a trailing slash /
|
||||
MUSICDIR="/home/$USER/Music/"
|
||||
|
||||
#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
|
||||
CONVERTED=/tmp
|
||||
|
||||
@ -26,9 +43,10 @@ USE_FILE_BROWSER="no" #options- yes, no
|
||||
|
||||
#GUI SETTINGS
|
||||
|
||||
|
||||
URL_BOX_HEIGHT="64"
|
||||
|
||||
URL_BOX_WIDTH="512"
|
||||
|
||||
FILENAME_BOX_HEIGHT="64"
|
||||
|
||||
FILENAME_BOX_WIDTH="326"
|
||||
|
23
lib/logic.sh
23
lib/logic.sh
@ -2,6 +2,7 @@
|
||||
|
||||
source config/zymp3.conf
|
||||
|
||||
#CHECK FOR YAD OR ZENITY AND DEFAULT TO ONE
|
||||
if [ ! -f /usr/bin/yad ];then
|
||||
SET_GUI_BIN="zenity"
|
||||
elif [ ! -f /usr/bin/zenity ];then
|
||||
@ -15,7 +16,8 @@ if [ ! -f /usr/bin/ffmpeg ];then
|
||||
else
|
||||
SET_CONV_TOOL="ffmpeg"
|
||||
fi
|
||||
#convert youtube videos to mp3 with zenity progess bar
|
||||
|
||||
#PROGRESS BAR
|
||||
backend()
|
||||
{
|
||||
|
||||
@ -71,7 +73,7 @@ backend()
|
||||
}
|
||||
|
||||
|
||||
#first zenity gui window (paste youtube link)
|
||||
#PASTE YOUTUBE LINK - WINDOW
|
||||
gui()
|
||||
{
|
||||
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()
|
||||
{
|
||||
@ -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()
|
||||
{
|
||||
|
||||
@ -156,8 +162,8 @@ open()
|
||||
|
||||
}
|
||||
|
||||
#Check if MUSICDIR exists and create the directory if not
|
||||
#move the mp3 file to the users music directory
|
||||
#MOVE MP3 FILE TO MUSICDIR
|
||||
#IF MUSICDIR DOES NOT EXIST, CREATE IT
|
||||
move()
|
||||
{
|
||||
if [ "${USE_FILE_BROWSER}" = "no" ];then
|
||||
@ -173,10 +179,11 @@ move()
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#CHECK IF MP3 FILE EXISTS
|
||||
checkFile()
|
||||
{
|
||||
|
||||
#check if mp3 file exists
|
||||
if [ "${USE_FILE_BROWSER}" = "no" ];then
|
||||
if [ -f "${MUSICDIR}${AUDIOFILENAME}.${EXTENSION}" ];then
|
||||
notify-send "${AUDIOFILENAME}.${EXTENSION} was saved in ${MUSICDIR}"
|
||||
@ -217,7 +224,7 @@ checkFile()
|
||||
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
|
||||
backend "${VIDURL}" "${AUDIOFILENAME}.${EXTENSION}"
|
||||
move
|
||||
|
5
zymp3
5
zymp3
@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
|
||||
#check for config file
|
||||
#CHECK FOR CONFIG FILE
|
||||
chk_conf(){
|
||||
if [ -f config/zymp3.conf ];then
|
||||
source config/zymp3.conf
|
||||
@ -28,6 +28,7 @@ else
|
||||
fi
|
||||
}
|
||||
|
||||
#CHECK FOR FUNCTIONS SCRIPT
|
||||
chk_libs(){
|
||||
if [ -f lib/logic.sh ];then
|
||||
source lib/logic.sh
|
||||
@ -42,7 +43,7 @@ fi
|
||||
}
|
||||
|
||||
|
||||
#call the main gui
|
||||
#RUN CHECKS AND OPEN THE MAIN WINDOW
|
||||
main(){
|
||||
while true;do
|
||||
chk_conf
|
||||
|
Loading…
x
Reference in New Issue
Block a user