Página 1 de 1

Help for ExtractYouTube function

Publicado: 29 Dic 2014 08:38
por milano88
hi all,
I have a problem with this function
function ExtractYouTube()
local sBody = GetBody(Input.GetText("name_input"));
local url_map = string.match( sBody, "\"url_encoded_fmt_stream_map\": \"(.-)\"" );
url_map = string.gsub( url_map, "\\u0026", "&" );
  for stream in string.gmatch( url_map, "[^,]+" ) do
  local url = string.match( stream, "url=([^&,]+)" );
  local sig = string.match( stream, "s=([^&,]+)" );
    if ( string.find(unescape(url), "itag=137") ) then
    return unescape(url).."&signature="..sig;
    else
    local url_map = string.match( sBody, "adaptive_fmts\": \"(.-)\"" );
    url_map = string.gsub( url_map, "\\u0026", "&" );
      for stream in string.gmatch( url_map, "[^,]+" ) do
      local url = string.match( stream, "url=([^&,]+)" );
      local sig = string.match( stream, "s=([^&,]+)" );
        if ( string.find(unescape(url), "itag=137") ) then
        return unescape(url).."&signature="..sig;
        end
      end
    end
  end
end
does not give accurate results
Must return connection and signature here :
Imagen

sorry for my bad english :((

Re: Help for ExtractYouTube function

Publicado: 30 Dic 2014 22:02
por milano88
solve this problems :)) thanks for visiting

Re: Help for ExtractYouTube function

Publicado: 31 Dic 2014 02:47
por Thedary
Consider posting your solution that will benefit everyone.