Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Colaboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 13-09-2007
Avatar de xEsk
[xEsk] xEsk is offline
Miembro Premium
 
Registrado: feb 2006
Posts: 454
Poder: 21
xEsk Va por buen camino
Para poder "emular" la validación debes enviar los parámetro por POST. Los parámetro a pasar por POST son: bMonth=01&bDay=1&bYear=1970&verifyAge=true&submit=CONTINUE »

Aquí te pongo un trozo del código que realiza la validación y obtiene el HTML de una página (piensa que el código que te muestro esta hecho usando Synapse para Internet...).

Código Delphi [-]
  // start a custom http instance
  HTTP:=THTTPSend.Create;
  try
    // set the POST parameters
    WriteStrToStream(HTTP.Document, 'bMonth=01&bDay=1&bYear=1970&verifyAge=true&submit=CONTINUE »');
    // Set the Mime Type
    HTTP.MimeType := 'application/x-www-form-urlencoded';
    // Get the page html (send it as POST)
    HTTP.HTTPMethod('POST', 'http://www.pornotube.com/media.php?m=1389132');
    // if all is ok
    if HTTP.ResultCode = 200 then
      begin
        // Aqui ya podemos analizar el código HTML de la pagina! 
        // HTTP.Document --> contiene el HTML de la pagina
      end;
  finally
    HTTP.Free;
  end;
Y aquí el código exacto que uso en el xVideoServiceThief para obtener la URL del video FLV en PornoTube (añadido hoy, y disponible en la próxima actualización):
Código Delphi [-]
function TVideoDownload_PornoTube.GetVideoInformation(
  const URL: String): TVideoDownloadInfo;
const
  AGE_VALIDATION = 'bMonth=01&bDay=1&bYear=1970&verifyAge=true&submit=CONTINUE »';
  GET_FLV_INFO_URL = 'http://www.pornotube.com/player/player.php?%s';
  GET_FLV_URL = 'http://%s.pornotube.com/%s/%s.flv';

var
  Html: TStringList;
  HTTP: THTTPSend;
  VideoID: String;
  FlvID: String;
  FUserID: String;
  FDomain: String;

begin
  // clear possible prev. data
  InitTVideoDownloadInfo(Result);
  // start a custom http instance
  HTTP:=THTTPSend.Create;
  try
    // set the POST parameters
    WriteStrToStream(HTTP.Document, AGE_VALIDATION);
    // Set the Mime Type
    HTTP.MimeType := 'application/x-www-form-urlencoded';
    // Get the page html (send it as POST)
    HTTP.HTTPMethod('POST', URL);
    // if all is ok
    if HTTP.ResultCode = 200 then
      begin
        Html:=TStringList.Create;
        try
          // get the html
          Html.LoadFromStream(HTTP.Document);
          // get the video Title
          Result.Title:=CopyBetween(Html.Text, 'PornoTube.com - '</span>, <span class='quote'>'');
          Result.Title:=Copy(Result.Title, 1, Pos(' - Browsing: Videos -', Result.Title) - 1);
          // get the video ID
          VideoID:=CopyBetween(Html.Text, 'player/v.swf?v=', '"');
          // get the video Information
          HTTP.Clear;
          HTTP.HTTPMethod('GET', Format(GET_FLV_INFO_URL, [VideoID]));
          if HTTP.ResultCode = 200 then
            begin
              // get the html
              Html.LoadFromStream(HTTP.Document);
              // get the video ID
              FlvID:=CopyBetween(Html.Text, 'mediaId=', '&');
              // get the User ID
              FUserID:=CopyBetween(Html.Text, 'userId=', '&');
              // get the video domain
              FDomain:=CopyBetween(Html.Text, 'mediaDomain=', '&');
              // get the final FLV url
              Result.VideoURL:=Format(GET_FLV_URL, [FDomain, FUserID, FlvID]);
              // clear and get the final flv url
              Result.VideoURL:=URLtoAscii(Result.VideoURL);
            end;
        finally
          Html.Free;
        end;
      end;
  finally
    HTTP.Free;
  end;
end;
Saludos.

Última edición por xEsk fecha: 13-09-2007 a las 16:23:16.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Cronómetro en una Sesión panuweb Varios 4 19-07-2007 16:26:29
Cambiar propiedad de componente del formulario padre al cerrar el formulario hijo jzginez OOP 5 22-06-2007 21:40:51
Validar Una ContraseÑa Y Cerrar La Ventana De Inicio De Sesion TrUnkS OOP 10 28-12-2005 13:35:35
pasar datos de un formulario vista a cualquier formulario @-Soft OOP 2 28-09-2004 21:56:01
Validar active de un formulario StartKill Varios 1 31-03-2004 04:39:44


La franja horaria es GMT +2. Ahora son las 14:33:33.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi