Nuevo script CoverCaratulas(ES)

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
legrad
Posts: 109
Joined: 2006-02-11 09:46:06
Location: Lerida-Spain

Nuevo script CoverCaratulas(ES)

Post by legrad »

Script para bajar caratulas -cds-trasera delantera-DVD-Xbox-plystation-musica etc, en fin todo lo que pueda haber en la web.


espero no hacerme pesado con los scripts, estoy subiendo todos los que tengo, aun tengo mas...

Code: Select all

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

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

[Infos]
Authors=Legrad
Title=Cover caratulas
Description=Caratulas
Site=www.caratulas.info
Language=ES
Version=1
Requires=3.5.0
Comments=
License=
GetInfo=1

[Options]

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

program CoverCaratulas;
 Uses StringUtils7552;



var
  MovieName: string;
  MovieURL: string;
//------------------------------------------------------------------------------------
function BorraComillas(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);
     if c = '''' then
        c := ' ';
        t := t + c;
   end
   s := t;
   result := t;
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);

      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
  strPage, strPages, MovieAddr, MovieTitle, MovieDate, MovieID: string;
  BeginPos, EndPos, BeginPo, EndPo: Integer;
  Line: string;
  LineNr: Integer;
  Page: TStringList;
begin
  strPage := GetPage(Address);
  BeginPos := Pos('en el dominio <b>www.caratulas.info', strPage);
  if(BeginPos > -1)then
    begin
      PickTreeClear;
      Delete(strPage, 1, BeginPos);
      BeginPos := Pos('href="http://www.caratulas.info/', strPage);
      EndPos := 1;
      while ((BeginPos > 0) and (EndPos > 0)) do
        begin
          Delete(strPage, 1, BeginPos);
          EndPos := Pos('" class', strPage);
          MovieId := Copy(strPage, +32, EndPos-32);
          MovieAddr := 'http://www.caratulas.info/' + MovieId;
          BeginPos := Pos('.info/',strPage);
          EndPos := Pos('.htm"', strPage);
          MovieTitle := Copy(strPage,BeginPos, EndPos);
          MovieTitle  := TextBetween (MovieTitle , '.info/', 'jpg');
          MovieTitle  := StringReplace(MovieTitle , 'musica/', '(MUSICA)');
          MovieTitle  := StringReplace(MovieTitle , 'juegos/', '(JUEGOS)');
          MovieTitle  := StringReplace(MovieTitle , '-', ' ' );
          MovieTitle  := StringReplace(MovieTitle , 'DVD', '(DVD)' );
          MovieTitle  := StringReplace(MovieTitle , 'Pc', '(PC)' );
          MovieTitle  := StringReplace(MovieTitle , 'Vcd', '(VCD)' );
          MovieTitle  := StringReplace(MovieTitle , 'Trasera', '(Trasera)' );
          MovieTitle  := StringReplace(MovieTitle , 'cd ', '(CD)' );
          MovieTitle  := StringReplace(MovieTitle , '/', '' );
          MovieTitle  := StringReplace(MovieTitle , 'Delantera', '(Delantera)' );
          MovieTitle  := StringReplace(MovieTitle , 'peliculas', '' );
          MovieTitle  := StringReplace(MovieTitle , 'Frontal', '(Frontal)' );
          MovieTitle  := StringReplace(MovieTitle , 'PS2', '(PS2)' );
          MovieTitle  := StringReplace(MovieTitle , 'Bso', '' );
          MovieTitle  := StringReplace(MovieTitle , 'The Album Del', '' );
          MovieTitle  := StringReplace(MovieTitle , 'Divx', '(DIVX)' );
          MovieTitle  := StringReplace(MovieTitle , 'BSO', '' );
          MovieTitle  := StringReplace(MovieTitle , 'B S O', '' );
          MovieTitle  := StringReplace(MovieTitle , 'Inlay', '(Interior)' );
          DeleteTags(MovieTitle);
          PickTreeAdd(MovieTitle,  MovieAddr);
          BeginPos := Pos('href="http://www.caratulas.info/', strPage);
          if(Pos('</body>', strPage) < BeginPos) then
           BeginPos := -1;
        end;
    end;
    PickTreeExec(Address)
    AnalyzeMoviePage(Address);
    SetField(fieldURL, Address);
end;
//------------------------------------------------------------------------------------

procedure AnalyzeMoviePage(Address: string);
var
  Page: TStringList;
  LineNr: Integer;
  Line: string;
  Item: string;
  Comments: string;
  Actors: string;
  Directors: string;
  Description: string;
  BaseURL2: string;
  Beginpos: string;
  titre_film: string;
  EndPos: string;
  Item1: string;
  Item2: string;
   Movie: string;
begin
  Description := '';

 // URL
  SetField(fieldURL, Address);
  Page := TStringList.Create;
  Page.Text := GetPage(Address);


  // Picture
  LineNr := FindLine('<p><img src="/', Page, 0);
  if LineNr <> -1 then
  begin
    Item := copy(Page.Text, pos('<p><img src="/',Page.Text), length(Page.Text));
    Item := TextBetween (Item, 'src="', '"');
    Item  := Trim(Item );
   GetPicture ('http://www.caratulas.info'+Item);
  end;
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(fieldTranslatedTitle);
   if MovieName = '' then
            MovieName := GetField(fieldOriginalTitle);
            Input('Cover caratulas', 'Buscar', MovieName);

     if(GetOption('') = 0) then  Input('Cover caratulas', 'Buscar', MovieName);

   AnalyzePage('http://www.google.es/search?num=100&hl=es&as_qdr=all&q=+%22' + UrlEncode(MovieName)+'%22+site%3Awww.caratulas.info&btnG=B%C3%BAsqueda&meta=');
end.
jdhorux
Posts: 3
Joined: 2007-08-31 16:20:32

Post by jdhorux »

Muchas gracias! Pero sería posible hacerlo tb con el "otro" covercarátulas?

www.covercaratulas.com

:grinking:
legrad
Posts: 109
Joined: 2006-02-11 09:46:06
Location: Lerida-Spain

Post by legrad »

el error es que este script deberia llamarse "caratulaInfo" fue una confusion mia llamarle "covercaratulas" ya que este es de otro site
en cuanto si se puede hacer uno de covercaratulas ya lo probare aunque me temo que no, ya que necesita registrase osea entrar con login y password no se como inplementar esto en un script(la cosa no me da para tanto) aunque ya te digo que hare algun intento
un saludo
jdhorux
Posts: 3
Joined: 2007-08-31 16:20:32

Post by jdhorux »

Y si estás registrado y dejas la cookie no funcionaría? :sleep:

De todos modos, GRACIAS MIL POR INTENTARLO! :hihi:
Post Reply