From f12f3dc21d8e15d54d58f03b05275effce65fbb7 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Fri, 26 Jul 2013 13:46:26 -0500 Subject: [PATCH 1/7] making a change under the SSH protocole --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 693f80b..ce11cee 100644 --- a/README.md +++ b/README.md @@ -216,5 +216,8 @@ Thanks! [5]: http://sourceforge.net/projects/iup/files/ [6]: http://sourceforge.net/projects/canvasdraw/files/ [7]: http://sourceforge.net/projects/imtoolkit/files/ - + + + +#testing ssh From 80ed77cf11bdc4ecc24c656c7dc6f55afa1fe28f Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Fri, 26 Jul 2013 14:37:47 -0500 Subject: [PATCH 2/7] updated dependancies --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce11cee..4bc5fe8 100644 --- a/README.md +++ b/README.md @@ -219,5 +219,5 @@ Thanks! -#testing ssh + From 481199a1f3686764a1c8619a0c0a052627365374 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Fri, 26 Jul 2013 16:48:06 -0500 Subject: [PATCH 3/7] Depend added --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4bc5fe8..deda5c1 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ dependancies. - lua 5.2 +- libfreetype6-dev (ubuntu) - youtube-dl - ffmpeg - vlc (temporary) From 0b4ae7693444be4e522458f477ca05c4c8d76b06 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Fri, 26 Jul 2013 22:46:59 -0500 Subject: [PATCH 4/7] possibly working marquee --- ffmpeg_progress.lua | 74 +++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/ffmpeg_progress.lua b/ffmpeg_progress.lua index ef26a8b..811ac88 100644 --- a/ffmpeg_progress.lua +++ b/ffmpeg_progress.lua @@ -1,62 +1,47 @@ --- take note of YtLink, I keep passing it around in order to show it as the title bar --- of the download window, YOU WILL HAVE TO PAY ATTENTION TO IT --- IT GOES THROUGH FUCKING EVERYTHING --- Also it will be replaced by what the user saves the file as --- keep that in mind as well require ('iuplua') -local cancelflag --set variable -local downloadProgress --set variable +local cancelflag +local downloadProgress -local function downloadStart(YtLink) --create button and cancle flag +local function downloadStart(YtLink) cancelButton = iup.button{ title = "Cancel", action = function() cancelflag = true - - --return iup.CLOSE --not sure if needed - - end + end } local downloadProgress = iup.progressbar{expand="HORIZONTAL", MARQUEE="YES"} - local dlgProgress = iup.dialog{ --create main window - title = YtLink, + local dlgProgress = iup.dialog{ + title = "converting", dialogframe = "YES", border = "YES", - iup.vbox { -- create vbox that contains said objects + iup.vbox { downloadProgress, cancelButton, } } - dlgProgress.size = "QUARTERxEIGHT" --should be size of dialog box - -- dlgProgress.menubox = "NO" -- no windows menus - dlgProgress.close_cb = cancelButton.action -- calls the action of the button - dlgProgress:showxy(iup.CENTER, iup.CENTER) -- show and position box + dlgProgress.size = "QUARTERxEIGHT" + dlgProgress.menubox = "NO" + dlgProgress.close_cb = cancelButton.action + dlgProgress:showxy(iup.CENTER, iup.CENTER) return dlgProgress end -local function DL_progress(YtLink) -- monitor download progress - downloadStart(YtLink) -- start the progress bar - -- downloadProgress.value = 0 - -- local pipe = io.popen(YtLink) - os.execute(YtLink) - --[[repeat - local c = pipe:read() -- read the first 20 characters of each line - if c then -- if c is true then... +local function DL_progress(YtLink) + downloadStart() + local pipe = io.popen(YtLink) + --os.execute(YtLink) + + repeat + local c = pipe:read() + if c then - --downloadProgress.value = c/100 -- x out of 100 - -- in this case x is the progress - -- data we grabbed - iup.Flush() -- speeds everything up considerably - -- when changing an attribute of an element, the change may not - -- take place immediately - -- in that case throw in a flush after the change + iup.Flush() - iup.LoopStep() -- required to work, also allows user to click button - iup.Flush() -- added this second flush... helps a shit ton - if cancelflag then -- if cancelflag is true, then break - -- which happens if you click the button + iup.LoopStep() + iup.Flush() + if cancelflag then iup.Message("Terminated", "You have canceled the conversion") iup.Flush() @@ -69,21 +54,16 @@ local function DL_progress(YtLink) -- monitor download progress -until not c-- creating a loop until c is not true -pipe:close() -- closing the ipopen--]] +until not c +pipe:close() iup.Close() +return end convert_mp3 = {} convert_mp3.go = function(tubeLink) DL_progress(tubeLink) + return end ---if you can have your script call this one and insert the link to YtLink... win - ---local YtLink = ('http://www.youtube.com/watch?v=jrmlums5bV8') - - ---DL_progress( YtLink) - From c4fd0a3f91365ddeab26f6d9fb8a22ea524bcbb6 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Fri, 26 Jul 2013 22:49:41 -0500 Subject: [PATCH 5/7] fixed initial cancel, ffmpeg marquee function --- mandy.lua | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) 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 From d8cc7e06a065266df521974613c518274184b219 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Fri, 26 Jul 2013 22:52:14 -0500 Subject: [PATCH 6/7] added proper cancle functionality to url --- main.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.lua b/main.lua index 4b3e63d..8aa72d6 100755 --- a/main.lua +++ b/main.lua @@ -3,6 +3,10 @@ require("mandy") function main() local url=global.url() + if not url then + + return false + end -- codec=sel_Codec() local saveDir=global.dir() if saveDir == "23" then From 572cf5e2ebe56a589747c1ca31ee1e0025ca1346 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Fri, 26 Jul 2013 22:55:51 -0500 Subject: [PATCH 7/7] clean up --- progress.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progress.lua b/progress.lua index 321f358..2a55bd5 100644 --- a/progress.lua +++ b/progress.lua @@ -91,7 +91,7 @@ round up and only update if number has changed until not c-- creating a loop until c is not true pipe:close() -- closing the ipopen -iup.Close() +--iup.Close() end popin = {}