WWW.FILMUP.COM ??????

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.
stilegojo
Posts: 12
Joined: 2003-02-02 13:03:09

WWW.FILMUP.COM ??????

Post by stilegojo »

Bonjour,

j'ecrive da l'Italie, et voulez-vous savoir:

Est il possible d'inclure www.filmup.com, dans les script par "Ant movie catalog"?

Merci d'avance
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Il suffit que quelqu'un écrive le script pour ce site :D
stilegojo
Posts: 12
Joined: 2003-02-02 13:03:09

Post by stilegojo »

Il y a un personne, qu'il fait cette ci?

Grazie
Ork
Posts: 44
Joined: 2003-01-03 23:52:51
Location: Castres, France

Post by Ork »

[FR]Je viens de regarder le site. La structure me rappelle celle de Cineguia.
Ca devrait pas être trop long à faire. Je m'y mets tout de suite.

[IT]Ho guardato il sito. Penso che ne sarà lungo fare lo script. Comincio subito.
Last edited by Ork on 2003-02-16 17:35:21, edited 1 time in total.
Ork
Posts: 44
Joined: 2003-01-03 23:52:51
Location: Castres, France

Post by Ork »

[FR] Et voilà le script pour FilmUP.

[IT] Ecco lo script per FilmUP.

Code: Select all

// GETINFO SCRIPTING
// FilmUP (IT) import

(***************************************************
 *  Movie importation script for:                  *
 *      FilmUP (IT), http://www.filmup.com         *
 *                                                 *
 * (c) 2003 Louis Francisco ork@everydayangels.net *
 *                                                 *
 *  For use with Ant Movie Catalog 3.4.1           *
 *  www.ant.be.tf/moviecatalog ··· www.buypin.com  *
 *                                                 *
 *  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               *
 ***************************************************)

program FilmUP;
var
  MovieName: string;
  TheMovieAddress: 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;

procedure AnalyzePage(Address: string);
var
  Page: TStringList;
  LineNr: integer;
  BeginPos: integer;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  LineNr := FindLine('<title>FilmUP - Cerca: ', Page, 0);
  if LineNr = -1 then
  begin
    SetField(fieldURL, Address);
    AnalyzeMoviePage(Page);
  end
  else
  begin
    PickTreeClear;
    AddMoviesTitles(Page);
    if TheMovieAddress='' then
    begin
      if PickTreeExec(Address) then
      begin
        SetField(fieldURL, Address);
        Page.Text := GetPage(Address);
        AnalyzeMoviePage(Page);
      end;
    end
    else
    begin
      SetField(fieldURL, TheMovieAddress);
      Page.Text := GetPage(TheMovieAddress);
      AnalyzeMoviePage(Page);
    end;
  end;
  Page.Free;
end;

procedure AnalyzeMoviePage(Page: TStringList);
var
  Line, Value: string;
  LineNr: Integer;
  BeginPos, EndPos: Integer;
  Field: integer;
begin
  LineNr := FindLine('<font face="arial, helvetica" size="3"><b>', Page, 0);
  if LineNr > -1 then
  begin
    //Translated Title
    Line := Page.GetString(LineNr);
    HTMLRemoveTags(Line);
    SetField(fieldTranslatedTitle, Line);

    repeat
      //Look for next info
      repeat
        LineNr := LineNr + 1;
        Line := Page.GetString(LineNr);
        HTMLRemoveTags(Line);
      until Line<>'';

      //Look for type of line
      if Line = 'Titolo originale: ' then
        Field := fieldOriginalTitle
      else if Line = 'Regia: ' then
        Field := fieldDirector
      else if Line = 'Produzione: ' then
        Field := fieldProducer
      else if Line = 'Nazione: ' then
        Field := fieldCountry
      else if Line = 'Genere: ' then
        Field := fieldCategory
      else if Line = 'Anno: ' then
        Field := fieldYear
      else if Line = 'Durata: ' then
        Field := fieldLength //Special case: get number only
      else if Line = 'Cast: ' then
        Field := fieldActors
      else if Line = 'Trama:' then
        Field := fieldDescription
      else
        Field := 0;

      // I have to add this test, for sometimes the description
      // is on the same line as the tag 'Trama'
      if (copy(Line,1,6)='Trama:') and (length(Line)>6) then
      begin
        Field := fieldDescription;
        Delete(Line,1,6);
        HTMLDecode(Line);
      end
      else
      begin
        //Get values
        LineNr := LineNr + 1;
        Line := Page.GetString(LineNr);
        HTMLRemoveTags(Line);
        HTMLDecode(Line);

        //Special case: Length
        if Field = fieldLength then Line := copy(Line,1,length(Line)-1);
      end;

      if Field<>0 then SetField(Field,Line);

    until Field=fieldDescription;
  end;
  
  //Rating
  LineNr := FindLine('">Opinioni</a>', Page, LineNr);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Delete(Line,1,pos('<a href="op_',Line)+8);
    Line := GetLineFromOtherPage('http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1),'</b> - <img src="/img/star/');
    if Line <> '' then
      SetField(fieldRating,Copy(Line,1,pos('</b> - <img src="/img/star/',Line)-1));
  end;

  //Picture
  LineNr := FindLine('<a href="posters/locp/', Page, LineNr);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Delete(Line,1,pos('<a href="posters/locp/',Line)+8);
    Line := GetLineFromOtherPage('http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1),'<a href="../loc/500/');
    if Line <> '' then
    begin
      Delete(Line,1,pos('<a href="../',Line)+11);
      GetPicture('http://www.filmup.com/posters/'+Copy(Line,1,pos('"',Line)-1), False);
    end;
  end;
  DisplayResults;
end;

function GetLineFromOtherPage(address: string; hint: string): string;
var
  Page: TStringList;
  LineNr: integer;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  LineNr := FindLine(hint, Page, 0);
  if LineNr > -1 then result := Page.GetString(LineNr);
  Page.Free;
end;

procedure AddMoviesTitles(Page: TStringList);
var
  LineNr: Integer;
  Line: string;
  MovieTitle, MovieAddress: string;
  BeginPos, EndPos: Integer;
begin
  TheMovieAddress := '*';
  LineNr := 0;
  LineNr := FindLine('FilmUP - Scheda:',Page,LineNr);
  while LineNr > -1 do
  begin
    Line := Page.GetString(LineNr);
    BeginPos := pos('<a href="',Line)+9;
    EndPos := pos('" TARGET="_blank"><b>FilmUP - Scheda: ',Line);
    MovieAddress := copy(Line,BeginPos,EndPos-BeginPos);
    Delete(Line,1,EndPos);
    BeginPos := pos('Scheda: ',Line)+8;
    EndPos := pos('</a>',Line);
    MovieTitle := copy(Line,BeginPos,EndPos-BeginPos);
    HTMLRemoveTags(MovieTitle);
    HTMLDecode(Movietitle);
    LineNr := FindLine('FilmUP - Scheda:',Page,LineNr+1);
    PickTreeAdd(MovieTitle, MovieAddress);
    
    if TheMovieAddress='*' then
      TheMovieAddress := MovieAddress
    else
      TheMovieAddress := '';
  end;
  if TheMovieAddress='*' then TheMovieAddress := '';
end;

begin
  if CheckVersion(3,4,1) then
  begin
    MovieName := GetField(fieldOriginalTitle);
    if MovieName = '' then
      MovieName := GetField(fieldTranslatedTitle);
    if Input('FilmUP Import', 'Enter the title of the movie:', MovieName) then
    begin
      AnalyzePage('http://www.filmup.com/cgi-bin/search.cgi?q='+UrlEncode(MovieName)+'&ul=%25%2Fsc_%25');
    end;
  end else
    ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.1)');
end.
Last edited by Ork on 2003-02-16 17:38:55, edited 3 times in total.
Saatchi

Errore

Post by Saatchi »

[IT] Grazie per l'ottimo lavoro, purtroppo lo script mi da il seguente errore: HTTP1.1/ 400 Bad Request
sai come mai?
Grazie.

[FR] Il y a un erreur HTTP1.1/ 400 Bad Request
merci.
Ork
Posts: 44
Joined: 2003-01-03 23:52:51
Location: Castres, France

Post by Ork »

[FR] Pour tous les films ? Ou pour un en particulier ? Je pense que c'était un problème temporaire sur le site, parce que ça marche très bien pour moi.
Je viens de m'apercevoir que je n'avais pas importé d'image. Je travaille dessus.

[IT] Per tutte i film ? O per uno specialmente ? Penso che era un problema temporaneo sul sito, perché funziona bene per me.
Mi sono accorto che non ho importato nessun' immagine. Ci lavoro.
Last edited by Ork on 2003-02-16 17:41:11, edited 1 time in total.
Ork
Posts: 44
Joined: 2003-01-03 23:52:51
Location: Castres, France

Post by Ork »

[FR] Je viens de modifier le script. Il devrait maintenant importer la note et l'image.

[IT] Ho modificato lo script. Adesso, doverebbe importare il voto e l'immagine.
Valleyman

Post by Valleyman »

[IT] Potresti mettere online il nuovo script che preleva copertina e voto. Quello pubblicato non preleva la cover ed il voto.
Grazie
Valleyman

Post by Valleyman »

[IT] Per l'esattezza lo script su alcuni titoli importa la cover su altri no, stesso vale per le valutazioni.

Esempio:
Blow - cover OK - valutazione NO
Birthday girl - cover NO - valutazione OK
Chocolat - cover OK - valutazione OK
Dungeons & Dragons - cover NO - valutazione NO
Ork
Posts: 44
Joined: 2003-01-03 23:52:51
Location: Castres, France

Post by Ork »

pour antp : tu peux effacer mon entrée précédente ? celle inscrite en "guest" ?

[FR] Voici la nouvelle version corrigée pour les photos. Pour la note, le problème vient des demi-points : j'arrondis au-dessus ou en-dessous ? J'ai choisi la valeur inférieur, ça vous va ?

[IT] Ecco la nuova versione corretta per le copertine. Per il voto, il problema viene dai mezzi punti : arrotondo al superiore o al inferiore? Ho scelto la valore inferiore, bene ?

Code: Select all

// GETINFO SCRIPTING
// FilmUP (IT) import

(***************************************************
 *  Movie importation script for:                  *
 *      FilmUP (IT), http://www.filmup.com         *
 *                                                 *
 * (c) 2003 Louis Francisco ork@everydayangels.net *
 *                                                 *
 *  For use with Ant Movie Catalog 3.4.1           *
 *  www.ant.be.tf/moviecatalog ··· www.buypin.com  *
 *                                                 *
 *  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               *
 ***************************************************)

program FilmUP;
var
  MovieName: string;
  TheMovieAddress: 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;

procedure AnalyzePage(Address: string);
var
  Page: TStringList;
  LineNr: integer;
  BeginPos: integer;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  LineNr := FindLine('<title>FilmUP - Cerca: ', Page, 0);
  if LineNr = -1 then
  begin
    SetField(fieldURL, Address);
    AnalyzeMoviePage(Page);
  end
  else
  begin
    PickTreeClear;
    AddMoviesTitles(Page);
    if TheMovieAddress='' then
    begin
      if PickTreeExec(Address) then
      begin
        SetField(fieldURL, Address);
        Page.Text := GetPage(Address);
        AnalyzeMoviePage(Page);
      end;
    end
    else
    begin
      SetField(fieldURL, TheMovieAddress);
      Page.Text := GetPage(TheMovieAddress);
      AnalyzeMoviePage(Page);
    end;
  end;
  Page.Free;
end;

procedure AnalyzeMoviePage(Page: TStringList);
var
  Line: string;
  LineNr: Integer;
  BeginPos, EndPos: Integer;
  Field: integer;
begin
  LineNr := FindLine('<font face="arial, helvetica" size="3"><b>', Page, 0);
  if LineNr > -1 then
  begin
    //Translated Title
    Line := Page.GetString(LineNr);
    HTMLRemoveTags(Line);
    SetField(fieldTranslatedTitle, Line);

    repeat
      //Look for next info
      repeat
        LineNr := LineNr + 1;
        Line := Page.GetString(LineNr);
        HTMLRemoveTags(Line);
      until Line<>'';

      //Look for type of line
      if Line = 'Titolo originale: ' then
        Field := fieldOriginalTitle
      else if Line = 'Regia: ' then
        Field := fieldDirector
      else if Line = 'Produzione: ' then
        Field := fieldProducer
      else if Line = 'Nazione: ' then
        Field := fieldCountry
      else if Line = 'Genere: ' then
        Field := fieldCategory
      else if Line = 'Anno: ' then
        Field := fieldYear
      else if Line = 'Durata: ' then
        Field := fieldLength //Special case: get number only
      else if Line = 'Cast: ' then
        Field := fieldActors
      else if Line = 'Trama:' then
        Field := fieldDescription
      else
        Field := 0;

      // I have to add this test, for sometimes the description
      // is on the same line as the tag 'Trama'
      if (copy(Line,1,6)='Trama:') and (length(Line)>6) then
      begin
        Field := fieldDescription;
        Delete(Line,1,6);
        HTMLDecode(Line);
      end
      else
      begin
        //Get values
        LineNr := LineNr + 1;
        Line := Page.GetString(LineNr);
        HTMLRemoveTags(Line);
        HTMLDecode(Line);

        //Special case: Length
        if Field = fieldLength then Line := copy(Line,1,length(Line)-1);
      end;

      if Field<>0 then SetField(Field,Line);

    until Field=fieldDescription;
  end;
  
  //Rating
  LineNr := FindLine('">Opinioni</a>', Page, LineNr);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Delete(Line,1,pos('<a href="op_',Line)+8);
    Line := GetLineFromOtherPage('http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1),'</b> - <img src="/img/star/');
    if Line <> '' then
      Line := Copy(Line,1,pos('</b> - <img src="/img/star/',Line)-1);
      if pos('.',Line)>0 then Line := Copy(Line,1,pos('.',Line)-1);
      SetField(fieldRating,Line);
  end;

  //Picture
  LineNr := FindLine('<a href="posters/locp/', Page, LineNr);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Delete(Line,1,pos('<a href="posters/locp/',Line)+8);
    Line := GetLineFromOtherPage('http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1),'<img src="../loc/500/');
    if Line <> '' then
    begin
      Delete(Line,1,pos('<img src="../',Line)+12);
      GetPicture('http://www.filmup.com/posters/'+Copy(Line,1,pos('"',Line)-1), False);
    end;
  end;
  DisplayResults;
end;

function GetLineFromOtherPage(address: string; hint: string): string;
var
  Page: TStringList;
  LineNr: integer;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  LineNr := FindLine(hint, Page, 0);
  if LineNr > -1 then result := Page.GetString(LineNr);
  Page.Free;
end;

procedure AddMoviesTitles(Page: TStringList);
var
  LineNr: Integer;
  Line: string;
  MovieTitle, MovieAddress: string;
  BeginPos, EndPos: Integer;
begin
  TheMovieAddress := '*';
  LineNr := 0;
  LineNr := FindLine('FilmUP - Scheda:',Page,LineNr);
  while LineNr > -1 do
  begin
    Line := Page.GetString(LineNr);
    BeginPos := pos('<a href="',Line)+9;
    EndPos := pos('" TARGET="_blank"><b>FilmUP - Scheda: ',Line);
    MovieAddress := copy(Line,BeginPos,EndPos-BeginPos);
    Delete(Line,1,EndPos);
    BeginPos := pos('Scheda: ',Line)+8;
    EndPos := pos('</a>',Line);
    MovieTitle := copy(Line,BeginPos,EndPos-BeginPos);
    HTMLRemoveTags(MovieTitle);
    HTMLDecode(Movietitle);
    LineNr := FindLine('FilmUP - Scheda:',Page,LineNr+1);
    PickTreeAdd(MovieTitle, MovieAddress);
    
    if TheMovieAddress='*' then
      TheMovieAddress := MovieAddress
    else
      TheMovieAddress := '';
  end;
  if TheMovieAddress='*' then TheMovieAddress := '';
end;

begin
  if CheckVersion(3,4,1) then
  begin
    MovieName := GetField(fieldOriginalTitle);
    if MovieName = '' then
      MovieName := GetField(fieldTranslatedTitle);
    if Input('FilmUP Import', 'Enter the title of the movie:', MovieName) then
    begin
      AnalyzePage('http://www.filmup.com/cgi-bin/search.cgi?q='+UrlEncode(MovieName)+'&ul=%25%2Fsc_%25');
    end;
  end else
    ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.1)');
end.
Last edited by Ork on 2003-02-23 20:57:59, edited 1 time in total.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Ork wrote:pour antp : tu peux effacer mon entrée précédente ? celle inscrite en "guest" ?
ok, c'est fait ;)
stilegojo
Posts: 12
Joined: 2003-02-02 13:03:09

Post by stilegojo »

Non so come ringraziare, SIETE I MIGLIORI!

Je Vous remerci beucoup, pour le Votre "Script"!

Vous-etes les Meilleurs!

Excuse-moi pour mon francaise, c'est mauvais!

Stilegojo
Saatchi

Post by Saatchi »

[FR] J ai encore le meme erreur, peut etre un bug du programme, mon OS est Win 98

[IT] Riscontro Ancora lo stesso errore, anche mentre il sito funziona, potrebbe essere un ' incompatibilità del Programma con il mio sistema operativo, uso Windows 98.
Grazie Ciao
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

La connexion internet utilise-t-elle un proxy ?
Si oui, il faut le configurer dans Tools -> Preferences -> Scripting
saatchi

Post by saatchi »

Non
Ork
Posts: 44
Joined: 2003-01-03 23:52:51
Location: Castres, France

Post by Ork »

[FR] Moi aussi j'utilise Windows 98. Peux-tu me dire quelques titres de films pour lesquels ça ne marche pas ?

[IT] Anch'io uso Windows 98. Puoi dirmi alcuni titoli da film per i quali non funziona ?
saatchi

Post by saatchi »

ho praticamente con tutti, comunque ho provato, blow, titanic, chocolat.
Grazie
Ork
Posts: 44
Joined: 2003-01-03 23:52:51
Location: Castres, France

Post by Ork »

[FR] Je ne comprends pas pourquoi ça ne marche pas. Je ne reçois aucune erreur. Quelqu'un d'autre a des problèmes avec ce script ?... Est-ce que tu as des erreurs avec d'autres scripts ou seulement le mien ?

[IT] Non capisco perché non funziona. Non ricevo nessun errore. Qualcun altro ha probleme con quello script ?... Hai errori con altri script o solo con il mio ?
Saatchi

Post by Saatchi »

In genere uso solo lo script IMb e ha sempre funzionato, temo sia un problema del mio computer visto che a te ed altri funziona, perciò ho annunciato l'uscita dello script sul forum di quelli che il pc http://www.quellicheilpc.net/, un importante sito italiano dedicato al Divx.
Ciao e Grazie x la disponibilità.
Post Reply