diff --git a/main.lua b/main.lua old mode 100755 new mode 100644 index 4a6bcbd..12e3eab --- a/main.lua +++ b/main.lua @@ -1,6 +1,6 @@ #!/usr/bin/lua5.2 require("mandy") -dofile("mandy.cfg") + function main() local url=global.url() if not url then return false end diff --git a/mandy.cfg b/mandy.cfg deleted file mode 100644 index 5d6ac5c..0000000 --- a/mandy.cfg +++ /dev/null @@ -1,6 +0,0 @@ -cfg_table = { - -format = "ogg" -- 0 for mp3, 1 for ogg, 2 for flac - -} - diff --git a/mandy.lua b/mandy.lua index 37b995c..09a7aa6 100644 --- a/mandy.lua +++ b/mandy.lua @@ -7,24 +7,15 @@ require('ffmpeg_progress') --Main url entry box function url_entry() - - local format = sel_format() - local url = "" - + local format = 0 res, url, format = iup.GetParam("Mandy 0.5.0 - Enter URL", nil, "Enter Youtube URL: %s\n".. "Select an audio format: %l|mp3|ogg|flac|\n", url, format) - - gFormat = sel_Codec(format) if res == true then if string.match(url, "youtube.com/watch") then - - local format_config = io.open("Config.txt", "w") - format_config:write("local format = "..format) - format_config:close() return url else iup.Message("Error", "The URL is not a youtube link") @@ -37,19 +28,6 @@ function url_entry() end --- checks mandy.cfg for format -function sel_format() - local format = cfg_table["format"] - if format == "mp3" then return 0 - elseif format == "ogg" then return 1 - elseif format == "flac" then return 2 - else return 0 - - end -end - - - --make format dropdown menu items work function sel_Codec(x) if x == 0 then @@ -80,7 +58,6 @@ function set_dir() local status = getPath.status - -- The "%" is used to escape the "." comming from gFormat if status == "1" or status == "0" then if string.match(getPath.value, "%"..gFormat) then local savedPath = getPath.value