i have the script from this post in first page. I have the option set in 0. im going to copy and paste first part of the script so tell me what is the error please
thanks, sorry for my english.
(***************************************************
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, juliojs
Title=FilmAffinity (ES)
Description=Movie importation script for FilmAffinity Spain
Site=
http://www.filmaffinity.com
Language=ES
Version=2.65
Requires=3.5.0
Comments=Updated to 2013/04/16 version of the web-page. Added an option to choose Actor list format (ActorsInALine).
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
RequiresMovies=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
ActorsInALine=0|0|1=Actores separados por comas|0=Actores en lineas independientes
[Parameters]
***************************************************)
program FilmAffinity;
const
BaseURL = '
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(S: string; StartTag: string; EndTag: string): string;
var
ini, fin: Integer;
begin
Result := '';
ini := Pos(StartTag, S);
if ini <> 0 then
begin
ini := ini + Length(StartTag);
fin := Pos(EndTag, S);
if (fin <> 0) and (fin > ini) then
begin
Result := Copy(S, ini, fin - ini);
end;
end;
end;
//------------------------------------------------------------------------------------
function DeleteTags(S: string): string;
var
n, len, tag: Integer;
c, p: char;
begin
HTMLDecode(S);
len := Length(S);
tag := 0;
p := ' ';
Result := '';
for n := 1 to len do
begin
c := Copy(S,n,1);
// Eliminamos los tabuladores
if c = #9 then c := ' ';
// Los espacios redundantes no se procesan
if (c <> ' ') or (p <> ' ') then
begin
// Eliminamos los tags de HTML
if tag = 0 then
begin
if c <> '<' then
begin
Result := Result + c;
p := c;
end
else tag := 1;
end
else if c = '>' then tag := 0;
end;
end
if p = ' ' then Result := Copy(Result, 1, Length(Result) - 1);
end;
//------------------------------------------------------------------------------------
procedure AnalyzePage(Address: string);
var
Page: TStringList;
LineNr: Integer;
Line: string;
Count: Integer;
MovieTitle, MovieAddress: string;
begin
Count := 0;
Page := TStringList.Create;
Page.Text := GetPage(Address);
PickTreeClear;
// Get how much search results have been found
LineNr := FindLine('</strong> resultados.</div>', Page, 0);
if LineNr <> -1 then
begin
Line := Page.GetString(LineNr);
Count := StrToInt(TextBetween(Line, '<div style="text-align:right;"><strong>', '</strong> resultados.</div>'), 0);
end;
// Add the results to the PickTree
if Count = 0 then
ShowMessage('No se ha encontrado ningún registro')
else
begin
LineNr := 0;
while true do
begin
LineNr := FindLine('<div class="mc-title"><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);
Page.Text := GetPage(TextBetween(Line, '<a href="', '">'));
LineNr := 0;
continue;
end;
Line := Page.GetString(LineNr);
MovieAddress := TextBetween(Line, '<div class="mc-title"><a href="', '.html">') + '.html';
MovieTitle := DeleteTags(TextBetween(Line, '.html">', '<img src="'));
if (Length(MovieAddress) <> 0) and (Length(MovieTitle) <> 0) then
PickTreeAdd(MovieTitle, BaseURL + MovieAddress);
end;
if ((Count = 1) and (GetOption('DontAsk') = 1)) or PickTreeExec(Address) then
AnalyzeMoviePage(Address);
end;
Page.Free;
end;