now using youtube-dl itself to call ffmpeg

This commit is contained in:
silvernode 2013-07-26 18:53:45 -05:00
parent ffead88967
commit b0a076561b

View File

@ -81,20 +81,20 @@ function set_dir()
end
function ytDl(x)
local tmpName = math.random(0,999999999999)
local tmpNameTwo = math.random(0,999999999999)
local tmpPath = x.." --output=/tmp/youtube-dl-"..tmpName.."-"..tmpNameTwo..".flv"
local tmpPath2 = "/tmp/youtube-dl-"..tmpName.."-"..tmpNameTwo..".flv"
function ytDl(x, y)
--local tmpName = math.random(0,999999999999)
--local tmpNameTwo = math.random(0,999999999999)
local thePath = set_dir()
local tmpPath = x.."--extract-audio --audio-format=mp3 -t --output="..thePath
--local tmpPath2 = "/tmp/youtube-dl-"..tmpName.."-"..tmpNameTwo..".flv"
popin.ytdl(tmpPath)
return tmpPath2
io.popen("vlc "..y)
return
end
function ffmpeg(tmpPath, dirD)
--[[function ffmpeg(tmpPath, dirD)
local mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y "..dirD
os.execute(mp3)
@ -102,7 +102,7 @@ function ffmpeg(tmpPath, dirD)
io.popen("vlc "..dirD)
end
--]]
--put everything into a table to use local functions globally
global = {}
global.url = function ()
@ -115,14 +115,14 @@ global.dir = function()
return dir
end
global.path = function(url)
local yt = ytDl(url)
global.path = function(url, dir)
local yt = ytDl(url, dir)
return yt
end
global.ffmpeg = function(tmpPath, saveDir)
local convert = ffmpeg(tmpPath, saveDir)
return convert
end
--global.ffmpeg = function(tmpPath, saveDir)
-- local convert = ffmpeg(tmpPath, saveDir)
-- return convert
--end