New script for import large image from dvdnet.ru (Ðóññêèé)

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
Dmitry501
Posts: 26
Joined: 2003-08-13 02:35:10

New script for import large image from dvdnet.ru (Ðóññêèé)

Post by Dmitry501 »

It is a new script for import of the big pictures of covers with dvdnet.ru. It is based on a script written Kamik. Please, write remarks.

Code: Select all

// GETINFO SCRIPTING
// Imports big picture from DVDnet.ru
{
 *  For use with Ant Movie Catalog 3.4.2           		*
 *  www.ant.be.tf/moviecatalog ··· www.buypin.com  	*
 *  It is based on a script written Kamik aka SlawDD	*
}
program DVDnet_PICT;
const
  BaseAddress = 'http://www.dvdnet.ru/';
var
  MovieName: string;
  MovieName2: 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 AddMoviesTitlesDVD(Page: TStringList; var LineNr: Integer);
var
  Line: string;
  MovieTitle, MovieAddress: string;
  StartPos, EndPos: Integer;
begin
  LineNr := FindLine('<b>ÔÈËÜÌÛ (æàíð è àêò¸ðû, èãðàþùèå ãëàâíûå ðîëè):</b><br>', Page, 0);
  Line := Page.GetString(LineNr);
  repeat
     WHILE pos('<a href="index', Line)>0 DO
     BEGIN
       StartPos := pos('<a href="index', Line) + 9;
       MovieAddress := copy(Line, StartPos, pos('">', Line) - StartPos);
       StartPos := pos('">', Line) + 2;
       MovieTitle := copy(Line, StartPos, pos('</i>', Line) - StartPos);
       Delete(Line, 1, pos(' </a><br><', Line));
       HTMLDecode(Movietitle);
       HTMLRemoveTags(MovieTitle);
       PickTreeAdd(MovieTitle, BaseAddress + MovieAddress);
     end;
    LineNr := LineNr + 1;
    Line := Page.GetString(LineNr);
  until (pos('<b>ÌÓËÜÒÔÈËÜÌÛ:</b><br>', Line)>0) or (pos('</table>', Line)>0);
end;

procedure AddAnimeTitlesDVD(Page: TStringList; var LineNr: Integer);
var
  Line: string;
  MovieTitle, MovieAddress: string;
  StartPos, EndPos: Integer;
begin
  LineNr := FindLine('<b>ÌÓËÜÒÔÈËÜÌÛ:</b><br>', Page, 0);
  Line := Page.GetString(LineNr);
  repeat
    WHILE pos('<a href="index', Line)>0 DO
    begin
      StartPos := pos('<a href="index', Line) + 9;
      MovieAddress := copy(Line, StartPos, pos('">', Line) - StartPos);
      StartPos := pos('">', Line) + 2;
      MovieTitle := copy(Line, StartPos, pos('</i>', Line) - StartPos);
      Delete(Line, 1, pos(' </a><br><', Line));
      HTMLDecode(Movietitle);
      HTMLRemoveTags(MovieTitle);
      PickTreeAdd(MovieTitle, BaseAddress + MovieAddress);
    end;
    LineNr := LineNr + 1;
    Line := Page.GetString(LineNr);
  until (pos('</table>', Line)>0);
end;

procedure AddPictureDVD(Page: TStringList);
var
  Line, Value : string;
  LineNr, BeginPos, EndPos: Integer;
begin
 // Get Picture
  LineNr := FindLine('window.open("pict', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    BeginPos := pos('"pict', Line);
    Delete(Line, 1, BeginPos);
    EndPos := pos('"', Line);
    Value := BaseAddress + copy(Line, 1, EndPos - 1);
    GetPicture(Value, True); // False = do not store picture externally ; store it in the catalog file
  end;
end;

procedure AnalyzePage(Address: string);
var
  Page: TStringList;
  LineNr, StartPos, EndPos, L: Integer;
  Line: string;
  MovieAddress, FindMovieName : string;

begin
  PickTreeClear;
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  if (pos('Ïî âàøåìó çàïðîñó â áàçå íàéäåíî:', Page.Text)>0) then
  begin
        PickTreeAdd('Íàéäåíî íà www.dvdnet.ru', '');
        LineNr := FindLine('<b>ÔÈËÜÌÛ (æàíð è àêò¸ðû, èãðàþùèå ãëàâíûå ðîëè):</b><br>', Page, 0);
        if LineNr >-1 then
          begin
            PickTreeAdd('Ôèëüìû', '');
            AddMoviesTitlesDVD(Page, LineNr);
          end;
        LineNr := FindLine('<b>ÌÓËÜÒÔÈËÜÌÛ:</b><br>', Page, 0);
        if LineNr > -1 then
          begin
            PickTreeAdd('Ìóëüòôèëüìû', '');
            AddAnimeTitlesDVD(Page, LineNr);
          end;
        if PickTreeExec(Address) then
          begin
            Page := TStringList.Create;
            Page.Text := GetPage(Address);
            AddPictureDVD(Page);
          end;
  Page.Free;
  end;
  DisplayResults;
end;

begin
  PickListClear;
  if CheckVersion(3,4,0) then
  begin
    MovieName := GetField(fieldOriginalTitle);
    if MovieName = '' then MovieName := GetField(fieldTranslatedTitle);
    if Input('Import picture from DVDNet.ru', 'Enter the title of the movie:', MovieName) then
    begin
      MovieName2:=MovieName;
      MovieName:=StringReplace(MovieName, '’', Chr(39));
			MovieName:=AnsiLowerCase(MovieName);
			MovieName:=AnsiUpFirstLetter(MovieName);
			if pos('The ', MovieName)=1 then MovieName:=StringReplace(MovieName, 'The ', '');
			AnalyzePage('http://www.dvdnet.ru/index.php?p=9&searching=y&checkform=y&search='+UrlEncode(MovieName));
    end
  else
    ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.0)');
  end;
end.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

thanks :)
It seems that there are lots of new scripts from you
Dmitry501
Posts: 26
Joined: 2003-08-13 02:35:10

Post by Dmitry501 »

thanks
It seems that there are lots of new scripts from you
I have written a little... :)
Guest

Post by Guest »

Скажите Дмитрий, а у Вас нет версии этого скрипта, что-бы с 'http://www.dvdnet.ru/' скачивать всю инфу, а не только увеличенную картинку?
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Please write in English, not in HTML Entities :hihi:
wheelyy69
Posts: 11
Joined: 2003-09-22 13:20:48

Post by wheelyy69 »

PTDR :lol: :lol: :lol:


Is it a russian keyboard ?
Dmitry501
Posts: 26
Joined: 2003-08-13 02:35:10

Post by Dmitry501 »

:lol:(Íàïèøè íîðìàëüíî!)
SiburNY
Posts: 17
Joined: 2002-11-13 00:12:12

Post by SiburNY »

It was in russian, because script is for russian web-site.
He intended to say following:
Ñêàæèòå Äìèòðèé, à ó Âàñ íåò âåðñèè ýòîãî ñêðèïòà, ÷òî-áû ñ 'http://www.dvdnet.ru/' ñêà÷èâàòü âñþ èíôó, à íå òîëüêî óâåëè÷åííóþ êàðòèíêó?
Ìåíÿ ýòî òîæå èíòåðåñóåò ;)
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Well, for me it does not change anything :D I see "random" accentuated characters (since I use west-european characters set)
Dmitry501
Posts: 26
Joined: 2003-08-13 02:35:10

Post by Dmitry501 »

to SiburNY:
Íåò, íî åñëè òåáå î÷åíü íóæíî, òî ìîãó íàïèñàòü...
No but if it is very necessary for you I can write...
SiburNY
Posts: 17
Joined: 2002-11-13 00:12:12

Post by SiburNY »

Dmitry501 wrote:to SiburNY:
Íåò, íî åñëè òåáå î÷åíü íóæíî, òî ìîãó íàïèñàòü...
No but if it is very necessary for you I can write...
Rus: ß íå ãîðþ, ïðîñòî åñëè åñòü âñå â îäíîì, òî ïî÷åìó áû íå ïîëüçîâàòü :). À åñëè íåòó, òîãäà íå òðàòü âðåìÿ :). Ïàñèáà âñå ðàâíî.
Eng: I'm not desperate to have it, but if you have written already, I don't mind having all-in-one script :). If you haven't, so don't bother yourself :). Thanks anyway.
Dmitry501
Posts: 26
Joined: 2003-08-13 02:35:10

Post by Dmitry501 »

Rus: ß íå ãîðþ, ïðîñòî åñëè åñòü âñå â îäíîì, òî ïî÷åìó áû íå ïîëüçîâàòü . À åñëè íåòó, òîãäà íå òðàòü âðåìÿ . Ïàñèáà âñå ðàâíî.
Eng: I'm not desperate to have it, but if you have written already, I don't mind having all-in-one script . If you haven't, so don't bother yourself . Thanks anyway.
RUS: Ó ìåíÿ åñòü áîëüøîé ñêðèïò Kamika êîòîðûé ïîëó÷àåò èíôîðìàöèþ èç dvd.net, movieguide.ru, soyuz.ru. ß èç íåãî âûäåðíóë ÷àñòü, êîòîðàÿ çàãðóæàåò êàðòèíêè. Ñàìè îïèñàíèÿ ÿ çàãðóæàþ èç ñêðèïòà sharereactor.ru, dvdspecial.ru, videoguide.ru À âîò áîëüøèå êàðòèíêè ëó÷øå âñåãî íà dvdnet.ru...
Çàâòðà îïóáëèêóþ ñêðèïò, êîòîðûé èìïîðòèðóåò âñþ èíôó èç dvd.net
ENG: I have big script Kamika which receives the information from dvd.net, movieguide.ru, soyuz.ru. I from him have pulled out a part which loads a picture. I load descriptions from a script sharereactor.ru, dvdspecial.ru, videoguide.ru And big a picture in the best way on dvdnet.ru...
Tomorrow I shall publish a script which imports all info from dvd.net
SiburNY
Posts: 17
Joined: 2002-11-13 00:12:12

Post by SiburNY »

Rus: Òîãäà ñóïåð :) ß ñ óäîâîëüñòâèåì ïîòåñòèðóþ è ïîòîì ïîïîëüçóþ :). Ïàñèáà.

Eng: That's cool :) I would love to test it and thet to use it :). Thanks.
timmy

?

Post by timmy »

This script seems to only import movie name for me.... Doesnt import any covers ;/
Post Reply