Filmaffinity (ES) 2.42 Critics and picture

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
el.leon
Posts: 4
Joined: 2009-08-31 00:50:13

Filmaffinity (ES) 2.42 Critics and picture

Post by el.leon »

I've modified the 2.41 version and the critics and pictures works fine now.

Modifiqué la versión 2.41 y la obtención de la carátula y las críticas funcionan bien.

León

Yo tuve el mismo problema y lo solucioné modificando el script, aquí dejo el nuevo modificado.
Ojalá te sirva

León

(***************************************************

Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/


[Infos]
Authors=aviloria (aviloria@yahoo.com) modded by: rodpedja (rodpedja@gmail.com), kreti (bisoft@hotmail.com), MrK, gilistico
Title=FilmAffinity (ES)
Description=Movie importation script for FilmAffinity Spain
Site=http://www.filmaffinity.com
Language=ES
Version=2.42
Requires=3.5.0
Comments=Updated: Script option for batch running (default disabled), and now it gets the category.
License=The source code of the script can be used in another program only if full credits to script author and a link to Ant Movie Catalog website are given in the About box or in the documentation of the program.|
GetInfo=1

[Options]
DontAsk=0|0|1=Método rápido: No te pregunta el titulo al principio, ni te pide confirmar si sólo hay un resultado|0=Método lento: Confirmas la información manualmente

***************************************************)

program FilmAffinity;

const

BaseURL1 = 'http://www.filmaffinity.com';

var
MovieName: string;
MovieURL: string;
//------------------------------------------------------------------------------------

function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer;
var
i: Integer;
begin
Result := -1;
if StartAt < 0 then
StartAt := 0;
for i := StartAt to List.Count-1 do
if Pos(Pattern, List.GetString(i)) <> 0 then
begin
Result := i;
Break;
end;
end;
//------------------------------------------------------------------------------------

function TextBetween(var S: string; StartTag: string; EndTag: string): string;
var
InitialPos: Integer;
begin
InitialPos := Pos(StartTag, S);
if InitialPos = 0 then
result := ''
else
begin
Delete(S, 1, InitialPos + Length(StartTag) - 1);
InitialPos := Pos(EndTag, S);
if InitialPos = 0 then
result := S
else
begin
result := copy(S, 1, InitialPos - 1);
Delete(S, 1, InitialPos + 1);
end;
end;
end;

//------------------------------------------------------------------------------------

function DeleteTags(var S: string): string;
var
n,len, tag: Integer;
c: char;
t: String;
begin

tag := 0;
t := '';
len := length(s);

for n :=1 to len do
begin
c := Copy(s,n,1);

// quitamos los tabuladores
if c = #9 then
c := ' ';

if(tag=1) then
begin
if(c='>') then tag := 0;
continue;
end
else
begin
if(c='<') then
begin
tag := 1;
continue;
end;
t := t + c;
end;
end
s := t;
result := t;
end;


//------------------------------------------------------------------------------------

procedure AnalyzePage(Address: string);
var
Page: TStringList;
LineNr: Integer;
Line,Line2: string;
Count: Integer;
MovieTitle, MovieAddress: string;

begin

Count := 0;
Page := TStringList.Create;
Page.Text := GetPage(Address);
PickTreeClear;


// Veamos si solo hay un solo resultado
LineNr := FindLine('<b>TITULO ORIGINAL</b>', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 1);
MovieTitle := TextBetween (Line, '<td ><b>', '</b></td>');
HTMLDecode(MovieTitle);
PickTreeAdd(MovieTitle, Address);

if(GetOption('DontAsk') = 0) then
if PickTreeExec(Address) then AnalyzeMoviePage(Address);
if(GetOption('DontAsk') = 1) then AnalyzeMoviePage(Address);
Page.Free;
exit;
end;

// Veamos cuantos resultados se han encontrado
LineNr := FindLine('resultados.</b></td></tr>', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr);
Count := StrToInt(TextBetween (Line, '<b>', ' resultados.</b>'), 0);
end;


// Si no hemos encontrado ningún resultado, abandonamos
if Count = 0 then
begin
ShowMessage('No se ha encontrado ningún registro');
Page.Free;
exit;
end;

LineNr := 0;

while TRUE do
begin

LineNr := FindLine('<b><a href="', Page, LineNr + 1);
if LineNr = -1 then
begin
LineNr := FindLine('<b>siguientes >></b>', Page,0);
if LineNr = -1 then
break;

Line := Page.GetString(LineNr);
Address := TextBetween (Line, '<a href="', '">');
Page.Text := GetPage(Address);
LineNr := 0;
continue;
end;

Line := Page.GetString(LineNr);
Line2 := Line;
MovieAddress := TextBetween (Line, '<b><a href="', '">');
MovieTitle := TextBetween (Line2, '.html">', '</td>');

HTMLDecode(MovieTitle);
DeleteTags(MovieTitle);

if (MovieAddress<>' ') AND (MovieTitle <>'') then
PickTreeAdd(MovieTitle, BaseURL1 + MovieAddress);
end;

if PickTreeExec(Address) then
AnalyzeMoviePage(Address);

Page.Free;
end;



//------------------------------------------------------------------------------------

procedure AnalyzeMoviePage(Address: string);
var
Page: TStringList;
LineNr, iL, aux, Check: Integer;
Line,LineAux: string;
Item: string;
Comments: string;
Actors: string;
Directors: string;

begin
Comments := '';
Actors := '';

// URL
SetField(fieldURL, Address);

Page := TStringList.Create;
Page.Text := GetPage(Address);

// Translated Title
LineNr := FindLine('<div style="margin-bottom: 4; padding:1; text-align: left; border-bottom: 1px solid #990000;"><span style="color:#990000; font-size:16; font-weight: bold;">', Page, 0);
Line := Page.GetString(LineNr);
Item := TextBetween (Line, ' border="0"> ', '</span>');
HTMLDecode(Item);
SetField(fieldTranslatedTitle, Trim (Item));

// Original Title
LineNr := FindLine('TITULO ORIGINAL', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 1);
Item := TextBetween (Line, '<td ><b>', '</b></td>');
HTMLDecode(Item);
SetField(fieldOriginalTitle, Trim (Item));
end;

// Picture
LineNr := FindLine('http://pics.filmaffinity.com/', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr);
Item := TextBetween (Line, '<img src="', '"');
GetPicture (Item);
end;

// Year
LineNr := FindLine('AÑO', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 3);
Item := TextBetween (Line, '<td >', '</td>');
HTMLDecode(Item);
SetField(fieldYear, Trim (Item));
end;

// Length
LineNr := FindLine('DURACIÓN', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 3);
Item := TextBetween (Line, '<td>', ' min.</td>');
HTMLDecode(Item);
SetField(fieldLength, Trim (Item));
end;

// Country
LineNr := FindLine('PAÍS', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 3);
Item := TextBetween (Line, 'title="', '" border');
HTMLDecode(Item);
SetField(fieldCountry, Trim (Item));
end;

// Director
LineNr := FindLine('DIRECTOR', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 1);
Directors := '';
while Pos ('stype=director', Line) > 0 do
begin
Item := TextBetween (Line, '">', '</a>');
HTMLDecode(Item);
if Directors = '' then
Directors := Item
else
Directors := Directors + ', ' + Item;
end;
SetField(fieldDirector, Trim (Directors));
end;

// Script writer
LineNr := FindLine('GUIÓN', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 1);
Item := TextBetween (Line, '<td >', '</td>');
Comments := Comments + 'Guión: ' + Item + #13#10;
end;

// Composer
LineNr := FindLine('MUSICA', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 1);
Item := TextBetween (Line, '<td >', '</td>');
Comments := Comments + 'Música: ' + Item + #13#10;
end;

// Photography
LineNr := FindLine('FOTOGRAFÍA', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 1);
Item := TextBetween (Line, '<td >', '</td>');
Comments := Comments + 'Fotografía: ' + Item + #13#10;
end;

// Actors
LineNr := FindLine('REPARTO', Page, 0);
if LineNr <> -1 then
begin

Line := '';
while TRUE do
begin
LineNR := LineNR + 1;
Line := Line + Page.GetString(LineNr);
if Pos ('</td>', Line)>0 then
break;
end;

Actors := TextBetween (Line, '">', '</a>') + #13#10;
while Pos ('stype=cast', Line) > 0 do
Actors := Actors + TextBetween (Line, '"> ', '</a>') + #13#10;
HTMLDecode(Actors);
SetField(fieldActors, Actors);
end;

// Productor
LineNr := FindLine('PRODUCTORA', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 1);
Item := TextBetween (Line, '<td >', '</td>');
HTMLDecode(Item);
SetField(fieldProducer, Trim (Item));
end;

// Category
Check := 0;
LineNr := FindLine('GÉNERO Y CRÍTICA', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 6);
Item := TextBetween (Line, ' / ', ' / ');
if Length(Item)> 100 then
begin
Line := Page.GetString(LineNr + 6);
Item := TextBetween (Line, '<td valign="top">', ' /');
if Item <> '' then
Check := 1;
end;
HTMLDecode(Item);
SetField(fieldCategory, Trim (Item));
end;

// Critic
LineNr := FindLine('GÉNERO Y CRÍTICA', Page, 0);
if LineNr <> -1 then
begin
iL := 6;
Line := Page.GetString(LineNr + iL);
LineAux := Page.GetString(LineNr + iL+1);

while true do
begin
if Pos('</tr>', LineAux) > 0 then
break;
Line := Line+LineAux;
iL := iL+1;
LineAux := Page.GetString(LineNr + iL+1);
end;

HTMLDecode(Line);
Line := StringReplace(Line, '<br />', #13#10);
if Check = 1 then
Item := TextBetween (Line, '/ ', '</td>')
else
Item := TextBetween (Line, '<td valign="top">','</td>');
Item := StringReplace (Item, 'á','á');
Item := StringReplace (Item, 'é','é');
Item := StringReplace (Item, 'í','í');
Item := StringReplace (Item, 'ó','ó');
Item := StringReplace (Item, 'ú','ú');
Item := StringReplace (Item, 'Á','Á');
Item := StringReplace (Item, 'É','É');
Item := StringReplace (Item, 'Í','Í');
Item := StringReplace (Item, 'Ó','Ó');
Item := StringReplace (Item, 'Ú','Ú');
Item := StringReplace (Item, '"','');
Item := StringReplace (Item, 'ñ','ñ');
Item := StringReplace (Item, '¿','¿');
SetField(fieldDescription, Trim(Item));
end;

// Official Webpage
LineNr := FindLine('WEB OFICIAL', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr + 1);
Comments := Comments + 'Web oficial: ' + TextBetween (Line, '<a href="', '" target="_blank">') + #13#10;
end;

// Rating
LineNr := FindLine('<td align="center" style="color:#990000; font-size:22px; font-weight: bold;">', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr);
Item := TextBetween (Line, '<td align="center" style="color:#990000; font-size:22px; font-weight: bold;">', '</td>');
HTMLDecode(Item);
SetField(fieldRating, Item);
end;

HTMLDecode(Comments);
SetField(fieldComments, Comments);
end;

//------------------------------------------------------------------------------------

begin
if (CheckVersion(3,5,0)=FALSe) then
begin
ShowMessage('Se requiere Ant Movie Catalog versión 3.5 o superior');
exit;
end;

MovieName := GetField(fieldOriginalTitle);
if MovieName = '' then
MovieName := GetField(fieldTranslatedTitle);

if GetOption('DontAsk') = 0 then
Input('FilmAffinity', 'Pelicula:', MovieName);

if Pos('filmaffinity.com', MovieName) > 0 then
AnalyzeMoviePage(MovieName)
else
AnalyzePage('http://www.filmaffinity.com/es/search.php?stext=' + UrlEncode(MovieName) + '&stype=Title');
end.
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

:??: isn't it the same as what you posted here:
viewtopic.php?p=28917#28917
?
el.leon
Posts: 4
Joined: 2009-08-31 00:50:13

Post by el.leon »

Yes, I tought is better put it out and open an independent topic.
aas8051
Posts: 4
Joined: 2009-08-28 13:56:19

Post by aas8051 »

Hola a todos,

He modificado la línea 288 para añadir un acento en la palabra "MÚSICA". Ahora vuelve a cargar la informacion del compositor.
La línea 288 debe quedar así:

LineNr := FindLine('MÚSICA', Page, 0);

Salu2
Alberto


Hi,
I've modified line 288 to add an accent in word "MÚSICA". Now is getting information about composer again.
Line number 288 shoud be:

LineNr := FindLine('MÚSICA', Page, 0);

Regards
Alberto
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Thanks, I increased version to 2.43
genoma
Posts: 3
Joined: 2009-09-17 17:49:34

Post by genoma »

Hola a todos modifique es script para capturar la fotos grandes.

Code: Select all

//----------------------

(***************************************************

Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/


[Infos]
Authors=aviloria  (aviloria@yahoo.com) modded by: rodpedja (rodpedja@gmail.com), kreti (bisoft@hotmail.com), MrK, gilistico
Title=FilmAffinity (ES)
Description=Movie importation script for FilmAffinity Spain
Site=http://www.filmaffinity.com
Language=ES
Version=2.43
Requires=3.5.0
Comments=Updated: Script option for batch running (default disabled), and now it gets the category.
License=The source code of the script can be used in another program only if full credits to script author and a link to Ant Movie Catalog website are given in the About box or in the documentation of the program.|
GetInfo=1

[Options]
DontAsk=0|0|1=Método rápido: No te pregunta el titulo al principio, ni te pide confirmar si sólo hay un resultado|0=Método lento: Confirmas la información manualmente

***************************************************)

program FilmAffinity;

const

  BaseURL1 = 'http://www.filmaffinity.com';

var
  MovieName: string;
  MovieURL: string;
//------------------------------------------------------------------------------------

function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer;
var
  i: Integer;
begin
  Result := -1;
  if StartAt < 0 then
    StartAt := 0;
  for i := StartAt to List.Count-1 do
    if Pos(Pattern, List.GetString(i)) <> 0 then
    begin
      Result := i;
      Break;
    end;
end;
//------------------------------------------------------------------------------------

function TextBetween(var S: string; StartTag: string; EndTag: string): string;
var
  InitialPos: Integer;
begin
  InitialPos := Pos(StartTag, S);
  if InitialPos = 0 then
    result := ''
  else
  begin
    Delete(S, 1, InitialPos + Length(StartTag) - 1);
    InitialPos := Pos(EndTag, S);
    if InitialPos = 0 then
      result := S
    else
    begin
      result := copy(S, 1, InitialPos - 1);
      Delete(S, 1, InitialPos + 1);
    end;
  end;
end;

//------------------------------------------------------------------------------------

function DeleteTags(var S: string): string;
var
   n,len, tag: Integer;
   c: char;
   t: String;
begin

   tag := 0;
   t := '';
   len := length(s);

   for n :=1 to len do
   begin
      c := Copy(s,n,1);

      // quitamos los tabuladores
      if c = #9 then
         c := ' ';

      if(tag=1) then
      begin
         if(c='>') then tag := 0;
         continue;
      end
      else
      begin
         if(c='<') then
         begin
            tag := 1;
            continue;
         end;
         t := t + c;
      end;
   end
   s := t;
   result := t;
end;


//------------------------------------------------------------------------------------

procedure AnalyzePage(Address: string);
var
   Page: TStringList;
   LineNr: Integer;
   Line,Line2: string;
   Count: Integer;
   MovieTitle, MovieAddress: string;

begin

   Count := 0;
   Page  := TStringList.Create;
   Page.Text := GetPage(Address);
     PickTreeClear;


   // Veamos si solo hay un solo resultado
   LineNr := FindLine('<b>TITULO ORIGINAL</b>', Page, 0);
   if LineNr <> -1 then
   begin
      Line := Page.GetString(LineNr + 1);
      MovieTitle := TextBetween (Line, '<td ><b>', '</b></td>');
      HTMLDecode(MovieTitle);
      PickTreeAdd(MovieTitle, Address);

       if(GetOption('DontAsk') = 0) then
            if PickTreeExec(Address) then AnalyzeMoviePage(Address);
       if(GetOption('DontAsk') = 1) then AnalyzeMoviePage(Address);
      Page.Free;
      exit;
   end;

   // Veamos cuantos resultados se han encontrado
   LineNr := FindLine('resultados.</b></td></tr>', Page, 0);
   if LineNr <> -1 then
   begin
          Line   := Page.GetString(LineNr);
          Count  := StrToInt(TextBetween (Line, '<b>', ' resultados.</b>'), 0);
   end;


   // Si no hemos encontrado ningún resultado, abandonamos
       if Count = 0 then
   begin
      ShowMessage('No se ha encontrado ningún registro');
        Page.Free;
      exit;
   end;

   LineNr := 0;

   while TRUE do
   begin

      LineNr := FindLine('<b><a href="', Page, LineNr + 1);
      if LineNr = -1 then
      begin
         LineNr := FindLine('<b>siguientes >></b>', Page,0);
         if LineNr = -1 then
            break;

                    Line      := Page.GetString(LineNr);
              Address   := TextBetween (Line, '<a href="', '">');
         Page.Text := GetPage(Address);
         LineNr    := 0;
         continue;
      end;

            Line         := Page.GetString(LineNr);
      Line2        := Line;
      MovieAddress := TextBetween (Line, '<b><a href="', '">');
           MovieTitle   := TextBetween (Line2, '.html">', '</td>');

      HTMLDecode(MovieTitle);
      DeleteTags(MovieTitle);

      if (MovieAddress<>' ') AND (MovieTitle <>'') then
         PickTreeAdd(MovieTitle, BaseURL1 + MovieAddress);
   end;

   if PickTreeExec(Address) then
           AnalyzeMoviePage(Address);

   Page.Free;
end;



//------------------------------------------------------------------------------------

procedure AnalyzeMoviePage(Address: string);
var
  Page: TStringList;
  LineNr, iL, aux, Check: Integer;
  Line,LineAux: string;
  Item: string;
  Comments: string;
  Actors: string;
  Directors: string;

begin
  Comments := '';
  Actors := '';

  // URL
  SetField(fieldURL, Address);

  Page := TStringList.Create;
  Page.Text := GetPage(Address);

  // Translated Title
  LineNr := FindLine('<div style="margin-bottom: 4; padding:1; text-align: left; border-bottom: 1px solid #990000;"><span style="color:#990000; font-size:16; font-weight: bold;">', Page, 0);
  Line := Page.GetString(LineNr);
  Item := TextBetween (Line, ' border="0"> ', '</span>');
  HTMLDecode(Item);
  SetField(fieldTranslatedTitle, Trim (Item));

  // Original Title
  LineNr := FindLine('TITULO ORIGINAL', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 1);
    Item := TextBetween (Line, '<td ><b>', '</b></td>');
    HTMLDecode(Item);
    SetField(fieldOriginalTitle, Trim (Item));
  end;

  // Picture
  LineNr := FindLine('http://pics.filmaffinity.com/', Page, 0);
  if LineNr <> -1 then
  begin
     Line := Page.GetString(LineNr);
     Item := TextBetween (Line, '<a class="lightbox" href="', '"');
     GetPicture (Item);
  end;

  // Year
  LineNr := FindLine('AÑO', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 3);
    Item := TextBetween (Line, '<td >', '</td>');
    HTMLDecode(Item);
    SetField(fieldYear, Trim (Item));
  end;

  // Length
  LineNr := FindLine('DURACIÓN', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 3);
    Item := TextBetween (Line, '<td>', ' min.</td>');
    HTMLDecode(Item);
    SetField(fieldLength, Trim (Item));
  end;

  // Country
  LineNr := FindLine('PAÍS', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 3);
    Item := TextBetween (Line, 'title="', '" border');
    HTMLDecode(Item);
    SetField(fieldCountry, Trim (Item));
  end;

  // Director
  LineNr := FindLine('DIRECTOR', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 1);
    Directors := '';
    while Pos ('stype=director', Line) > 0 do
    begin
      Item := TextBetween (Line, '">', '</a>');
      HTMLDecode(Item);
      if Directors = '' then
        Directors := Item
      else
        Directors := Directors + ', ' + Item;
    end;
    SetField(fieldDirector, Trim (Directors));
  end;

  // Script writer
  LineNr := FindLine('GUIÓN', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 1);
    Item := TextBetween (Line, '<td >', '</td>');
    Comments := Comments + 'Guión: ' + Item + #13#10;
  end;

  // Composer
  LineNr := FindLine('MÚSICA', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 1);
    Item := TextBetween (Line, '<td  >', '</td>');
    Comments := Comments + 'Música: ' + Item + #13#10;
  end;

  // Photography
  LineNr := FindLine('FOTOGRAFÍA', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 1);
    Item := TextBetween (Line, '<td  >', '</td>');
    Comments := Comments + 'Fotografía: ' + Item + #13#10;
  end;

  // Actors
  LineNr := FindLine('REPARTO', Page, 0);
  if LineNr <> -1 then
  begin

   Line := '';
   while TRUE do
   begin
      LineNR := LineNR + 1;
      Line   := Line + Page.GetString(LineNr);
      if Pos ('</td>', Line)>0 then
         break;
   end;

    Actors := TextBetween (Line, '">', '</a>') + #13#10;
   while Pos ('stype=cast', Line) > 0 do
            Actors := Actors + TextBetween (Line, '"> ', '</a>') + #13#10;
       HTMLDecode(Actors);
       SetField(fieldActors, Actors);
  end;

  // Productor
  LineNr := FindLine('PRODUCTORA', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 1);
    Item := TextBetween (Line, '<td  >', '</td>');
    HTMLDecode(Item);
    SetField(fieldProducer, Trim (Item));
  end;

   // Category
  Check := 0;
  LineNr := FindLine('GÉNERO Y CRÍTICA', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 6);
    Item := TextBetween (Line, ' / ', ' / ');
   if Length(Item)> 100 then
     begin
        Line := Page.GetString(LineNr + 6);
        Item := TextBetween (Line, '<td valign="top">', ' /');
        if Item <> '' then
          Check := 1;
     end;
    HTMLDecode(Item);
    SetField(fieldCategory, Trim (Item));
  end;

  // Critic
  LineNr := FindLine('GÉNERO Y CRÍTICA', Page, 0);
  if LineNr <> -1 then
  begin
    iL := 6;
    Line := Page.GetString(LineNr + iL);
    LineAux := Page.GetString(LineNr + iL+1);

      while  true do
      begin
		  if Pos('</tr>', LineAux) > 0 then
			break;
          Line := Line+LineAux;
          iL := iL+1;
          LineAux := Page.GetString(LineNr + iL+1);
      end;

    HTMLDecode(Line);
    Line := StringReplace(Line, '<br />', #13#10);
    if Check = 1 then
      Item := TextBetween (Line, '/ ', '</td>')
    else
      Item := TextBetween (Line, '<td valign="top">','</td>');
    Item := StringReplace (Item, 'á','á');
    Item := StringReplace (Item, 'é','é');
    Item := StringReplace (Item, 'í','í');
    Item := StringReplace (Item, 'ó','ó');
    Item := StringReplace (Item, 'ú','ú');
    Item := StringReplace (Item, 'Á','Á');
    Item := StringReplace (Item, 'É','É');
    Item := StringReplace (Item, 'Í','Í');
    Item := StringReplace (Item, 'Ó','Ó');
    Item := StringReplace (Item, 'Ú','Ú');
    Item := StringReplace (Item, '"','');
    Item := StringReplace (Item, 'ñ','ñ');
    Item := StringReplace (Item, '¿','¿');
    SetField(fieldDescription, Trim(Item));
  end;

  // Official Webpage
  LineNr := FindLine('WEB OFICIAL', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 1);
    Comments := Comments + 'Web oficial: ' + TextBetween (Line, '<a href="', '" target="_blank">') + #13#10;
  end;

  // Rating
  LineNr := FindLine('<td align="center" style="color:#990000; font-size:22px; font-weight: bold;">', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr);
    Item := TextBetween (Line, '<td align="center" style="color:#990000; font-size:22px; font-weight: bold;">', '</td>');
    HTMLDecode(Item);
    SetField(fieldRating, Item);
  end;

  HTMLDecode(Comments);
  SetField(fieldComments, Comments);
end;

//------------------------------------------------------------------------------------

begin
  if (CheckVersion(3,5,0)=FALSe) then
  begin
    ShowMessage('Se requiere Ant Movie Catalog versión 3.5 o superior');
    exit;
  end;

  MovieName := GetField(fieldOriginalTitle);
  if MovieName = '' then
    MovieName := GetField(fieldTranslatedTitle);

  if GetOption('DontAsk') = 0 then
    Input('FilmAffinity', 'Pelicula:', MovieName);

  if Pos('filmaffinity.com', MovieName) > 0 then
    AnalyzeMoviePage(MovieName)
  else
    AnalyzePage('http://www.filmaffinity.com/es/search.php?stext=' + UrlEncode(MovieName)  + '&stype=Title');
end.

//--------------------


Saludos :)
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Current script was already version 2.43, is this an update on an older one, or did you just forget to update the version number?
(seeing only one small change in the code, I guess it is the latter case)
genoma
Posts: 3
Joined: 2009-09-17 17:49:34

Post by genoma »

Sorry, but forget to change the version number. :??:
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

ok, I'll change it in the version on my server
Thanks
BittMan
Posts: 9
Joined: 2009-05-06 21:03:55

Post by BittMan »

Ahora no me reconoce el titulo original de la peli... imagino que es sólo cambiar una linea, pero no sé hacerlo... alguna ayuda? gracias

-----------------------------------------------------------------------------
Now don't get the original title of the film, anyone can help? thanks in advance
cinecampillos
Posts: 21
Joined: 2009-04-06 15:51:36

Post by cinecampillos »

BittMan: Modifica las líneas 132 y 233 y donde pone TITULO pon TÍTULO con acento en la I. Con eso te leerá el título original.
BittMan wrote:Ahora no me reconoce el titulo original de la peli... imagino que es sólo cambiar una linea, pero no sé hacerlo... alguna ayuda? gracias

-----------------------------------------------------------------------------
Now don't get the original title of the film, anyone can help? thanks in advance
BittMan
Posts: 9
Joined: 2009-05-06 21:03:55

Post by BittMan »

Muchas gracias, ahora funciona perfectamente, aunque las lineas eran la 109 y 210

Saludos
Post Reply