filenames can now contain spaces and open with default media player
This commit is contained in:
parent
ec1334994b
commit
79e62e651c
12
mandy.lua
12
mandy.lua
@ -14,7 +14,7 @@ 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
|
||||
@ -51,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)
|
||||
@ -103,12 +103,12 @@ function ytDl(x)
|
||||
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 = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user