diff --git a/mandy.lua b/mandy.lua index 7a0f825..1049a9b 100644 --- a/mandy.lua +++ b/mandy.lua @@ -9,22 +9,30 @@ require('progress') 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.2 - Enter URL", nil, "Enter Youtube URL: %s\n", "") - if string.match(url, "youtube.com/watch") then - return url + + if res == true then + if string.match(url, "youtube.com/watch") then + return url + else + iup.Message("Error", "The URL is not a youtube link") + iup.Flush() + iup.Close() + end + + else - iup.Message("Error", "The URL is not a youtube link") - iup.Flush() - iup.Close() - + return false end - + + end @@ -97,8 +105,9 @@ end function ffmpeg(tmpPath, dirD) local mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y "..dirD - os.execute(mp3) - -- convert_mp3.go(mp3) + --os.execute(mp3) + convert_mp3.go(mp3) + io.popen("vlc "..dirD) end