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
|
--Main url entry box
|
||||||
function url_entry()
|
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", "")
|
"Enter Youtube URL: %s\n", "")
|
||||||
|
|
||||||
if res == true then
|
if res == true then
|
||||||
@ -51,7 +51,7 @@ end
|
|||||||
function set_dir()
|
function set_dir()
|
||||||
getPath = iup.filedlg{dialogtype = "SAVE", title="Save file...",
|
getPath = iup.filedlg{dialogtype = "SAVE", title="Save file...",
|
||||||
filter="*.mp3", filterinfo="mp3",
|
filter="*.mp3", filterinfo="mp3",
|
||||||
directory="Music/",
|
directory=".",
|
||||||
file="*.mp3"}
|
file="*.mp3"}
|
||||||
|
|
||||||
getPath:popup(iup.ANYWHERE, iup.ANYWHERE)
|
getPath:popup(iup.ANYWHERE, iup.ANYWHERE)
|
||||||
@ -103,12 +103,12 @@ function ytDl(x)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ffmpeg(tmpPath, dirD)
|
function ffmpeg(tmpPath, dirD)
|
||||||
|
local subSpaces = string.gsub(dirD, "", "\\")
|
||||||
local mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y "..dirD
|
local mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y "..subSpaces
|
||||||
--os.execute(mp3)
|
--os.execute(mp3)
|
||||||
convert_mp3.go(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
|
end
|
||||||
--put everything into a table to use local functions globally
|
--put everything into a table to use local functions globally
|
||||||
global = {}
|
global = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user