Sharereactor (RU) (large picture) doesn't work 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
Andy-Hammer

Sharereactor (RU) (large picture) doesn't work picture

Post by Andy-Hammer »

Hello.

Everything fine with this script, but pic doesn't work at all. Made this message about error "HTTP/1.1 403 Forbidden" May be somebody can help me ?

THX.
Lion

Post by Lion »

Same here. Any suggestions anyone?
Alexandr

Post by Alexandr »

[RUS] Присоединяюсь к предыдущему сообщению.
[ENG] Anybody please fix that bug!
Guest

Post by Guest »

Hm... Ok, i see :)

Õîðîøî, ãëÿíó, êàê âðåìÿ áóäåò. :)
Andy-Hammer

Post by Andy-Hammer »

[RUS] Спасибо за ранее. А то надоело лазить на сайт и сохранять картинку вручную. И как назло еще и DVDNet.ru прикрыли. А там были супер обложки.
drobus
Posts: 1
Joined: 2005-02-06 20:20:29

Post by drobus »

[RUS]
Подправил скрипт. Получилось сразу два :)
  • ShareReactor (RU) (large pic - DVD).ifs - качает картинку, но не трогает информацию о файле
    ShareReactor (RU) (large pic - file info).ifs - качает и картику и информацию и файле
За баги лучше не бить, а писать в PM. Постараюсь исправить. К сообщению Гостя от 2005-02-02 не имею никакого отношения, может у него лучше получится.

ShareReactor (RU) (large pic - DVD).ifs

Code: Select all

// GETINFO SCRIPTING 
// Use only for sharereactor.ru releases 
(*************************************************** 
 *  Movie information import script for:           * 
 *    Sharereactor Russian,                        * 
 *    http://www.sharereactor.ru/                  * 
 *                                                 * 
 *  (c) 2003 By AIG                                * 
 *  corrected by KoSeA & Leonid_Z                  * 
 *                                                 * 
 *  Update: 18.06.2004                             * 
 *  - Fixed some false checkboxes                  * 
 *                                                 * 
 *  Known issues:                                  * 
 *  - time can't be added to catalog in some cases * 
 *                                                 * 
 *  For use with Ant Movie Catalog 3.4.3           * 
 *  http://www.antp.be/software/moviecatalog       * 
 *                                                 * 
 *  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 Sharereactorru; 
var 
  MovieName: 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; 
begin 
  Page := TStringList.Create; 
  Page.Text := GetPage(Address); 
  
    PickTreeClear; 
    LineNr := 0; 
    LineNr := FindLine('По вашему запросу отобрано', Page, LineNr); 
    if LineNr > -1 then 
    begin 
      PickTreeAdd('По вашему запросу отобрано', ''); 
      AddMoviesTitles(Page, LineNr); 
    end; 
  
    if PickTreeExec(Address) then 
     begin 
       Page.Free; 
       Page := TStringList.Create; 
       Page.Text := GetPage(Address); 
       SetField(fieldURL, Address); 
       AnalyzeMoviePage(Page) 
     end 
 Page.Free; 
end; 
 
procedure AnalyzeMoviePage(Page: TStringList); 
var 
  Line, Value, value1, cuchr: string; 
  LineNr, i: Integer;
  time_length: Integer;
  BeginPos, EndPos: Integer; 
 
begin 
 
  // Original Title & TranslatedTitle & Year 
 
   LineNr := FindLine('<TD VALIGN="TOP"><IMG SRC=', Page, 0);           // Картинка
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('SRC=', Line);
    if BeginPos > 0 then
      BeginPos := BeginPos + 5;
    EndPos := pos('></TD>', Line);
    if EndPos > 0 then
      EndPos := EndPos - 1;
    Value := copy(Line, BeginPos, EndPos - BeginPos );
    GetPicture(Value, False); 
   end

   LineNr := FindLine('&nbsp', Page, LineNr+1);    // Поиск имени фильма РУС 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('<H1>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 4; 
    EndPos := pos('</H1>', Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLRemoveTags(Value); 
    HTMLDecode(Value); 
    SetField(fieldTranslatedTitle, Value); 
   end
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);     // Переведенное название 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldOriginalTitle, Value); 
   end 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);       // Год выхода 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    SetField(fieldYear, Value); 
   end; 
 
   //Category 
   LineNr := FindLine('&nbsp', Page, LineNr+1);        // Жанр 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('("', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 2; 
    EndPos := pos('")', Line)-1; 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldCategory, Value); 
   end;
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);        // Режисcер 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldDirector,Value); 
   end 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);         // Актеры 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    HTMLRemoveTags(Value); 
 
 
   SetField(fieldActors,value); 
   end; 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);          // Описание 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldDescription, Value); 
   end; 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);          // Продюссер 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldProducer, Value); 
   end; 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);     // Продолжительность 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );
    time_length := strtoint( copy( Value, 0, 1 ), 0) * 60 + strtoint( copy( Value, 2, 3 ), 0 ) * 10 + strtoint( copy( Value, 3, 4 ), 0 );
    SetField(fieldLength, inttostr(time_length));
   end;
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);      // Язык 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldLanguages, Value); 
   end; 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);       // Комментарии 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldComments, Value); 
   end; 
 
  DisplayResults; 
end; 
 
 
procedure AddMoviesTitles(Page: TStringList; var LineNr: Integer); 
var 
  Line: string; 
  MovieTitle, MovieAddress: string; 
  StartPos,EndPos,AddPos: Integer; 
begin 
 
    LineNr := LineNr + 10; 
    Line := Page.GetString(LineNr); 
    StartPos := pos('<A', Line); 
 
repeat 
 
     
    if StartPos > 0 then 
    begin 
      StartPos:=StartPos+8; 
      EndPos := Length(Line); 
      Line:=copy(Line,StartPos,EndPos - StartPos); 
      MovieAddress := copy(Line, 2, pos('">', Line) -2 ); 
      StartPos := pos('">', Line) + 2; 
      MovieTitle := copy(Line, StartPos, pos('</A>', Line) - StartPos); 
      HTMLDecode(Movietitle); 
      PickTreeAdd(MovieTitle, 'http://sharereactor.ru' + MovieAddress); 
    end; 
 
    StartPos := Length(Movietitle)+StartPos; 
 
    StartPos := pos('<A', Line); 
 
  until  StartPos <= 0; 
end; 
 
begin 
  if CheckVersion(3,4,0) then 
  begin 
    MovieName := GetField(fieldOriginalTitle); 
    if MovieName = '' then 
      MovieName := GetField(fieldTranslatedTitle); 
    if Input('IMDb Import', 'Enter the title of the movie:', MovieName) then 
    begin 
      AnalyzePage('http://sharereactor.ru/cgi-bin/mzsearch.cgi?search='+UrlEncode(MovieName)); 
    end; 
  end else 
    ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.0)'); 
end. 
--------------------------------------------------------------------------------------------------------------------------------------------------------
ShareReactor (RU) (large pic - file info).ifs

Code: Select all

// GETINFO SCRIPTING 
// Use only for sharereactor.ru releases 
(*************************************************** 
 *  Movie information import script for:           * 
 *    Sharereactor Russian,                        * 
 *    http://www.sharereactor.ru/                  * 
 *                                                 * 
 *  (c) 2003 By AIG                                * 
 *  corrected by KoSeA & Leonid_Z                  * 
 *                                                 * 
 *  Update: 18.06.2004                             * 
 *  - Fixed some false checkboxes                  * 
 *                                                 * 
 *  Known issues:                                  * 
 *  - time can't be added to catalog in some cases * 
 *                                                 * 
 *  For use with Ant Movie Catalog 3.4.3           * 
 *  http://www.antp.be/software/moviecatalog       * 
 *                                                 * 
 *  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 Sharereactorru; 
var 
  MovieName: string; 
 
function TextBetween(WholeText: string; BeforeText: string; AfterText: string; var Found: integer ): string;
var 
  FoundPos: Integer; 
  WorkText: string; 
begin 
  Result := ''; 
  FoundPos := Pos(BeforeText, WholeText); 
  if FoundPos = 0 then 
    Exit; 
  WorkText := Copy(WholeText, FoundPos + Length(BeforeText), Length(WholeText)); 
  Found := FoundPos + Length(BeforeText);
  if AfterText = '\n' then begin
    FoundPos := Length(WorkText) + 1;
  end else begin
    FoundPos := Pos(AfterText, WorkText); 
  end;
  if FoundPos = 0 then 
    Exit; 
  Result := Copy(WorkText, 1, FoundPos - 1);
end;

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; 
begin 
  Page := TStringList.Create; 
  Page.Text := GetPage(Address); 
  
    PickTreeClear; 
    LineNr := 0; 
    LineNr := FindLine('По вашему запросу отобрано', Page, LineNr); 
    if LineNr > -1 then 
    begin 
      PickTreeAdd('По вашему запросу отобрано', ''); 
      AddMoviesTitles(Page, LineNr); 
    end; 
  
    if PickTreeExec(Address) then 
     begin 
       Page.Free; 
       Page := TStringList.Create; 
       Page.Text := GetPage(Address); 
       SetField(fieldURL, Address); 
       AnalyzeMoviePage(Page) 
     end 
 Page.Free; 
end; 
 
procedure AnalyzeMoviePage(Page: TStringList); 
var 
  Line, Value, value1, cuchr: string; 
  LineNr, i: Integer;
  time_length: Integer;
  FoundPos, FoundPos2: Integer; 
  BeginPos, EndPos: Integer; 
 
begin 
 
  // Original Title & TranslatedTitle & Year 
 
   LineNr := FindLine('<TD VALIGN="TOP"><IMG SRC=', Page, 0);           // Картинка
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('SRC=', Line);
    if BeginPos > 0 then
      BeginPos := BeginPos + 5;
    EndPos := pos('></TD>', Line);
    if EndPos > 0 then
      EndPos := EndPos - 1;
    Value := copy(Line, BeginPos, EndPos - BeginPos );
    GetPicture(Value, False); 
   end

   LineNr := FindLine('&nbsp', Page, LineNr+1);    // Поиск имени фильма РУС 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('<H1>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 4; 
    EndPos := pos('</H1>', Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLRemoveTags(Value); 
    HTMLDecode(Value); 
    SetField(fieldTranslatedTitle, Value); 
   end
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);     // Переведенное название 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldOriginalTitle, Value); 
   end 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);       // Год выхода 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    SetField(fieldYear, Value); 
   end; 
 
   //Category 
   LineNr := FindLine('&nbsp', Page, LineNr+1);        // Жанр 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('("', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 2; 
    EndPos := pos('")', Line)-1; 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldCategory, Value); 
   end;
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);        // Режисcер 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldDirector,Value); 
   end 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);         // Актеры 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    HTMLRemoveTags(Value); 
 
 
   SetField(fieldActors,value); 
   end; 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);          // Описание 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldDescription, Value); 
   end; 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);          // Продюссер 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldProducer, Value); 
   end; 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);     // Продолжительность 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );
    time_length := strtoint( copy( Value, 0, 1 ), 0) * 60 + strtoint( copy( Value, 2, 3 ), 0 ) * 10 + strtoint( copy( Value, 3, 4 ), 0 );
    SetField(fieldLength, inttostr(time_length));
   end;
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);      // Язык 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldLanguages, Value); 
   end; 
 
   LineNr := FindLine('&nbsp', Page, LineNr+1);       // Комментарии 
   Line := Page.GetString(LineNr); 
   if LineNr > -1 then 
   begin 
    BeginPos := pos('</B>', Line); 
    if BeginPos > 0 then 
      BeginPos := BeginPos + 5; 
    EndPos := Length(Line); 
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
    HTMLDecode(Value); 
    SetField(fieldComments, Value); 
   end; 

   LineNr := FindLine('&nbsp', Page, LineNr+1);       // Дополнительно
   LineNr := FindLine('&nbsp', Page, LineNr+1);       // Рейтинг
   if LineNr > -1 then 
   begin 
     Line := Page.GetString(LineNr); 
     Value := TextBetween(Line, '</B> ', '/10', FoundPos);
     if Value <> '' then begin
       HTMLDecode(Value); 
       for i := 0 to length(Value) do begin
         if copy(Value, i, 1) = '.' then begin
           Value := copy(Value, 1, i-1);
           break;
         end;
       end;
       SetField(fieldRating, Value);
     end;
   end; 
 
   LineNr := FindLine('<TABLE ', Page, LineNr+1);
   if LineNr > -1 then 
   begin
     LineNr := FindLine('&nbsp', Page, LineNr+1);        // Формат 
     Line := Page.GetString(LineNr); 
     if LineNr > -1 then 
     begin 
       BeginPos := pos('</B>', Line); 
       if BeginPos > 0 then 
         BeginPos := BeginPos + 5; 
       EndPos := Length(Line); 
       Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
       HTMLDecode(Value); 
       SetField(fieldVideoFormat, Value); 
     end; 

     LineNr := FindLine('&nbsp', Page, LineNr+1);        // Качество 
     Line := Page.GetString(LineNr); 
     if LineNr > -1 then 
     begin 
       BeginPos := pos('</B>', Line); 
       if BeginPos > 0 then 
         BeginPos := BeginPos + 5; 
       EndPos := Length(Line); 
       Value := copy(Line, BeginPos, EndPos - BeginPos+1 ); 
       HTMLDecode(Value); 
       SetField(fieldMediaType, Value); 
     end; 

     LineNr := FindLine('&nbsp', Page, LineNr+1);        // Видео
     Line := Page.GetString(LineNr); 
     if LineNr > -1 then 
     begin
       Value := TextBetween(Line, '</B> ', ';', FoundPos);
       if Value <> '' then begin
         Delete( Line, 1, FoundPos - 1 );
         HTMLDecode(Value); 
         SetField(fieldResolution, Value);
       end;
       Value := TextBetween(Line, '; ', ' fps', FoundPos);
       if Value <> '' then begin
         Delete( Line, 1, FoundPos - 1 );
         HTMLDecode(Value); 
         SetField(fieldFramerate, Value); 
       end;
       Value := TextBetween(Line, '; ', ' Кбит/с', FoundPos);
       if Value <> '' then begin
         Delete( Line, 1, FoundPos - 1 );
         HTMLDecode(Value);
         for i := 0 to length(Value) do begin
           if copy(Value, i, 1) = '.' then begin
             Value := copy(Value, 1, i-1);
             break;
           end;
         end;
         SetField(fieldVideoBitrate, Value); 
       end;
       Value := TextBetween(Line, '; ', '\n', FoundPos);
       if Value <> '' then begin
         Delete( Line, 1, FoundPos - 1 );
         HTMLDecode(Value); 
         SetField(fieldVideoFormat, Value); 
       end;
     end;

     LineNr := FindLine('&nbsp', Page, LineNr+1);        // Звук
     Line := Page.GetString(LineNr); 
     if LineNr > -1 then 
     begin
       Value := TextBetween(Line, '</B> ', ' kbit/s', FoundPos);
       if Value <> '' then begin
         Delete( Line, 1, FoundPos - 1 );
         FoundPos := Length(Value);
         for i := Length(Value) downto 0 do begin
           if (copy(Value, i, 1) < '0') or (copy(Value, i, 1) > '9') then begin
             Break; 
           end;
         end;
         Value := Left( Line, i-2 );
         HTMLDecode(Value); 
         SetField(fieldAudioFormat, Value);
         Delete( Line, 1, i-1 );
         Value := TextBetween(Line, ' ', ' kbit/s', FoundPos);
         if Value <> '' then begin
           HTMLDecode(Value); 
           SetField(fieldAudioBitrate, Value);
         end;
       end else begin
         Value := Trim(TextBetween(Line, '</B> ', '\n', FoundPos));
         HTMLDecode(Value); 
         SetField(fieldAudioFormat, Value);
       end;
     end;

     LineNr := FindLine('&nbsp', Page, LineNr+1);        // Размер
     Line := Page.GetString(LineNr); 
     if LineNr > -1 then 
     begin
       Value := TextBetween(Line, '</B> ', ' Мб', FoundPos);
       if Value <> '' then begin
         HTMLDecode(Value); 
         SetField(fieldSize, Value);
       end;
     end;

     LineNr := FindLine('&nbsp', Page, LineNr+1);        // Количество дисков
     Line := Page.GetString(LineNr); 
     if LineNr > -1 then 
     begin
       FoundPos := 0;
       i        := 0;
       while pos( 'href', Line ) > 0 do begin
         i := i+1;
         Delete( Line, 1, pos( 'href', Line ) + 2 );
       end;
       SetField(fieldDisks, inttostr(i));
     end;
   end;

  DisplayResults; 
end; 
 
 
procedure AddMoviesTitles(Page: TStringList; var LineNr: Integer); 
var 
  Line: string; 
  MovieTitle, MovieAddress: string; 
  StartPos,EndPos,AddPos: Integer; 
begin 
 
    LineNr := LineNr + 10; 
    Line := Page.GetString(LineNr); 
    StartPos := pos('<A', Line); 
 
repeat 
 
     
    if StartPos > 0 then 
    begin 
      StartPos:=StartPos+8; 
      EndPos := Length(Line); 
      Line:=copy(Line,StartPos,EndPos - StartPos); 
      MovieAddress := copy(Line, 2, pos('">', Line) -2 ); 
      StartPos := pos('">', Line) + 2; 
      MovieTitle := copy(Line, StartPos, pos('</A>', Line) - StartPos); 
      HTMLDecode(Movietitle); 
      PickTreeAdd(MovieTitle, 'http://sharereactor.ru' + MovieAddress); 
    end; 
 
    StartPos := Length(Movietitle)+StartPos; 
 
    StartPos := pos('<A', Line); 
 
  until  StartPos <= 0; 
end; 
 
begin 
  if CheckVersion(3,4,0) then 
  begin 
    MovieName := GetField(fieldOriginalTitle); 
    if MovieName = '' then 
      MovieName := GetField(fieldTranslatedTitle); 
    if Input('IMDb Import', 'Enter the title of the movie:', MovieName) then 
    begin 
      AnalyzePage('http://sharereactor.ru/cgi-bin/mzsearch.cgi?search='+UrlEncode(MovieName)); 
    end; 
  end else 
    ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.0)'); 
end.
Dmitry501
Posts: 26
Joined: 2003-08-13 02:35:10

Post by Dmitry501 »

drobus
[RUS]
Под гостем был я :)
Ну раз все поправил, то спасибо!
Andy-Hammer

Post by Andy-Hammer »

drobus
[RUS] Огромное спасибо! Все работает отлично. Намного лучше, чем было раньше :grinking:
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Do these scripts replace or complete this one ?
http://antp.be/temp/scripts/ShareReacto ... 20pic).ifs
(does this one still work ?)

If they have to be included in AMC, please send them to me by e-mail since I can't copy/paste correctly russian text with my european Windows ;)
Thanks.
Sanaa

Post by Sanaa »

Big thanx!!!
Sanaa
Posts: 2
Joined: 2005-09-16 15:56:41

Post by Sanaa »

Sharereactor changed syntaxis, script doesn't work again (different, unsuitable strings/fields)
Sanaa
Posts: 2
Joined: 2005-09-16 15:56:41

Post by Sanaa »

I find and replace wrong strings :

99str

Code: Select all

//Æàíð
   LineNr := FindLine('&nbsp', Page, LineNr+1);
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );
    HTMLDecode(Value);  
    SetField(fieldCategory, Value);  
   end;  
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Thanks
hnun
Posts: 1
Joined: 2007-10-26 13:36:53

Post by hnun »

Fixing get picture code (marked with begin/end picture fix comments)

Code: Select all


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

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

[Infos]
Authors=m a x
Title=Sharereactor.ru
Description=Import data & picture from Sharereactor.ru
Site=Sharereactor.ru
Language=RU
Version=1.03
Requires=3.5.0
Comments=Based on the script made for version 3.x by AIG corrected by KoSeA & Leonid_Z & m a x
License=
GetInfo=1

[Options]

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

program Sharereactorru;
var  
  MovieName: 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;  
begin  
  Page := TStringList.Create;  
  Page.Text := GetPage(Address);  
   
    PickTreeClear;  
    LineNr := 0;  
    LineNr := FindLine('По вашему запросу отобрано', Page, LineNr);  
    if LineNr > -1 then  
    begin  
      PickTreeAdd('По вашему запросу отобрано', '');  
      AddMoviesTitles(Page, LineNr);  
    end;  
   
    if PickTreeExec(Address) then  
     begin  
       Page.Free;  
       Page := TStringList.Create;  
       Page.Text := GetPage(Address);  
       SetField(fieldURL, Address);  
       AnalyzeMoviePage(Page)  
     end  
 Page.Free;  
end;  
  
procedure AnalyzeMoviePage(Page: TStringList);  
var  
  Line, Value, value1, cuchr: string;  
  LineNr, i: Integer;  
  BeginPos, EndPos: Integer;  
  
begin  
  
  // Original Title & TranslatedTitle & Year  

//Русское название
   LineNr := FindLine('<td><H1>', Page, 0);
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('<H1>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 4;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos-22 );  
    HTMLDecode(Value);  
    SetField(fieldTranslatedTitle, Value);  
   end  
  
//Оригинальное название  
   LineNr := FindLine('&nbsp', Page, LineNr+1);
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    HTMLDecode(Value);  
    SetField(fieldOriginalTitle, Value);  
   end  
  
//Год выхода  
   LineNr := FindLine('&nbsp', Page, LineNr+1);
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    SetField(fieldYear, Value);  
   end;  
  
//Жанр
   LineNr := FindLine('&nbsp', Page, LineNr+1);
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    HTMLDecode(Value);  
    SetField(fieldCategory, Value);  
   end;  
  
//Режисcер 
   LineNr := FindLine('&nbsp', Page, LineNr+1); 
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    HTMLDecode(Value);  
    SetField(fieldDirector,Value);  
   end  
  
//Актеры  
   LineNr := FindLine('&nbsp', Page, LineNr+1);
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    HTMLDecode(Value);  
    HTMLRemoveTags(Value);  
    SetField(fieldActors,value);  
   end;  

//Описание    
   LineNr := FindLine('&nbsp', Page, LineNr+1);
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    HTMLDecode(Value);  
    SetField(fieldDescription, Value);  
   end;  
  
//Продюссер
   LineNr := FindLine('&nbsp', Page, LineNr+1);  
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    HTMLDecode(Value);  
    SetField(fieldProducer, Value);  
   end;  
  
//Язык  
   LineNr := FindLine('Язык', Page, LineNr+1);  
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    HTMLDecode(Value);  
    SetField(fieldLanguages, Value);  
   end;  

//Комментарии    
   LineNr := FindLine('Примечания', Page, LineNr+1); 
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B>', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := Length(Line);  
    Value := copy(Line, BeginPos, EndPos - BeginPos+1 );  
    HTMLDecode(Value);
    HTMLRemoveTags(Value)
    SetField(fieldComments, Value);  
   end;  

//Оценка
   LineNr := FindLine('Оценка пользователей:', Page, LineNr+1);
   Line := Page.GetString(LineNr);  
   if LineNr > -1 then  
   begin  
    BeginPos := pos('</B> ', Line);  
    if BeginPos > 0 then  
      BeginPos := BeginPos + 5;  
    EndPos := pos('/10', Line);
    Value := copy(Line, BeginPos, EndPos - BeginPos );  
    SetField(fieldRating, Value);
//    IntToStr(Round(StrToFloat(Value))));
   end;  

// begin picture fix
//Картинка 
            LineNr := FindLine('<TD VALIGN="TOP"><IMG SRC=', Page, 0);
            Line := Page.GetString(LineNr);
            if LineNr > -1 then
            begin
              BeginPos := pos('SRC=', Line);
              if BeginPos > 0 then
                BeginPos := BeginPos+5; //+ 1;
              EndPos:=pos('.jpg', Line);
              if EndPos < 0 then
                EndPos:=pos('.gif', Line);
              Value := copy(Line, BeginPos, EndPos - BeginPos+4 );
              GetPicture(Value);
            end
// end picture fix

//  DisplayResults;  
end;  
  
  
procedure AddMoviesTitles(Page: TStringList; var LineNr: Integer);  
var  
  Line: string;  
  MovieTitle, MovieAddress: string;  
  StartPos,EndPos,AddPos: Integer;  
begin  
  
    LineNr := LineNr + 10;  
    Line := Page.GetString(LineNr);  
    StartPos := pos('<A', Line);  
  
repeat  
  
      
    if StartPos > 0 then  
    begin  
      StartPos:=StartPos+8;  
      EndPos := Length(Line);  
      Line:=copy(Line,StartPos,EndPos - StartPos);  
      MovieAddress := copy(Line, 2, pos('">', Line) -2 );  
      StartPos := pos('">', Line) + 2;  
      MovieTitle := copy(Line, StartPos, pos('</A>', Line) - StartPos);  
      HTMLDecode(Movietitle);  
      PickTreeAdd(MovieTitle, 'http://sharereactor.ru' + MovieAddress);  
    end;  
  
    StartPos := Length(Movietitle)+StartPos;  
  
    StartPos := pos('<A', Line);  
  
  until  StartPos <= 0;  
end;  
  
begin  
  if CheckVersion(3,5,0) then  
  begin  
    MovieName := GetField(fieldOriginalTitle);  
    if MovieName = '' then  
      MovieName := GetField(fieldTranslatedTitle);  
    if Input('Sharereactor.ru Import', 'Введите название фильма:', MovieName) then  
    begin  
      AnalyzePage('http://sharereactor.ru/cgi-bin/mzsearch.cgi?search='+UrlEncode(MovieName));  
    end;  
  end else  
    ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.5.0)');  
end.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Thanks
Post Reply