for itag,url in string.gmatch( fmt_url_map, "(%d+)|([^,]+)" ) do
-- Apparently formats are listed in quality order,
-- so we can afford to simply take the first one
if not fmt or tonumber( itag ) == tonumber( fmt ) then
path = url
break
end
end
end
-- Also available on non-HTML5 pages: var swfHTML = (isIE) ? "<object [...]><param name=\"flashvars\" value=\"rv.2.thumbnailUrl=http%3A%2F%2Fi4.ytimg.com%2Fvi%2F3MLp7YNTznE%2Fdefault.jpg&rv.7.length_seconds=384 [...] &video_id=OHVvVmUNBFc [...] &t=OEgsToPDskK3zO44y0QN8Fr5ZSAZwCQp [...]
elseif string.match( line, "swfHTML" ) and string.match( line, "video_id" ) then
_,_,t = string.find( line, "&t=(.-)&" )
end
if name and description and artist --[[and video_id]] then break end