diff --git a/README.md b/README.md index deda5c1..3746b6b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ dependancies. - libfreetype6-dev (ubuntu) - youtube-dl - ffmpeg -- vlc (temporary) +- libnotify - push notifications - git - [IUP][5] - [CD][6] @@ -49,7 +49,7 @@ main repository: - pacman -S lua youtube-dl ffmpeg vlc git + pacman -S lua youtube-dl ffmpeg git libnotify @@ -60,7 +60,7 @@ conversion to mp3: - sudo apt-get install lua5.2 youtube-dl ffmpeg vlc git libavcodec-extra-53 + sudo apt-get install lua5.2 youtube-dl ffmpeg vlc git libavcodec-extra-53 libfreetype6-dev libnotify ###IUP diff --git a/mandy.lua b/mandy.lua index 1049a9b..1bddb69 100644 --- a/mandy.lua +++ b/mandy.lua @@ -10,10 +10,11 @@ require('ffmpeg_progress') + --Main url entry box function url_entry() -res, url = iup.GetParam("Mandy 0.2 - Enter URL", nil, +res, url = iup.GetParam("Mandy 0.4 - Enter URL", nil, "Enter Youtube URL: %s\n", "") if res == true then @@ -50,7 +51,7 @@ end function set_dir() getPath = iup.filedlg{dialogtype = "SAVE", title="Save file...", filter="*.mp3", filterinfo="mp3", - directory="Music/", + directory=".", file="*.mp3"} getPath:popup(iup.ANYWHERE, iup.ANYWHERE) @@ -85,7 +86,7 @@ function set_dir() end - + end @@ -97,21 +98,18 @@ function ytDl(x) popin.ytdl(tmpPath) - return tmpPath2 end function ffmpeg(tmpPath, dirD) - - local mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y "..dirD + local subSpaces = string.gsub(dirD, "", "\\") + local mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y "..subSpaces --os.execute(mp3) convert_mp3.go(mp3) - - io.popen("vlc "..dirD) - + io.popen("notify-send 'The file was saved to' "..subSpaces) + io.popen("xdg-open "..subSpaces) end - --put everything into a table to use local functions globally global = {} global.url = function () @@ -130,7 +128,7 @@ global.path = function(url) end global.ffmpeg = function(tmpPath, saveDir) - local convert = ffmpeg(tmpPath, saveDir) + local convert = ffmpeg(tmpPath, saveDir) return convert end diff --git a/progress.lua b/progress.lua index 2a55bd5..d823dca 100644 --- a/progress.lua +++ b/progress.lua @@ -22,7 +22,7 @@ local function downloadStart(YtLink) --create button and cancle flag local pTest = "1" downloadProgress = iup.progressbar{expand="HORIZONTAL"} dlgProgress = iup.dialog{ --create main window - title = YtLink, + title = "Downloading.. ", dialogframe = "YES", border = "YES", iup.vbox { -- create vbox that contains said objects downloadProgress,