Fixed various cancle flags to act properly.

This commit is contained in:
Logen Kain
2013-07-29 22:49:23 -05:00
parent 5f470e54ee
commit c145e73a30
4 changed files with 30 additions and 32 deletions

View File

@@ -34,7 +34,7 @@ end
local function DL_progress(YtLink)
downloadStart(YtLink)
downloadProgress.value = 0
local pipe = io.popen("youtube-dl " ..YtLink)
local pipe = io.popen("youtube-dl " ..YtLink )
repeat
local c = pipe:read(20) -- read the first 20 characters of each line
if c then
@@ -49,7 +49,10 @@ local function DL_progress(YtLink)
if cancelflag then
iup.Message("Terminated", "You have canceled the download")
iup.Flush()
break
pipe:close()
iup.Flush()
return false
end
end
@@ -60,10 +63,12 @@ local function DL_progress(YtLink)
until not c
pipe:close()
return true
end
popin = {}
popin.ytdl = function(tubeLink)
DL_progress(tubeLink)
local flag = DL_progress(tubeLink)
if not flag then return false else return true end
end