Tokio

[HELP] How to get this data from yt video?

Recommended Posts

I wanna get remaining time from the video, but does not working.. Why?

function callback(data, error)
    if (error ~= 0) then
        return outputChatBox(error)
    end
    if (data == "ERROR") then
        return outputChatBox("data error")
    end
    local data = fromJSON("["..data.."]")
    if (data) then
	local minutes, seconds = convertTime(tonumber(data.length))
	if seconds < 10 then 
		seconds = "0"..seconds
	end
        outputChatBox("Title: "..data.title)
        outputChatBox("Length: "..minutes..":"..seconds )
        outputChatBox("Remaining: "..data.remaining)
        loadBrowserURL( browser, data.link  )
    end
end

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.