IMDB

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.
dkov
Posts: 2
Joined: 2007-03-27 12:43:08

Post by dkov »

It works now.

Thank you for the quick help.
Moerges
Posts: 9
Joined: 2007-02-19 14:15:13

Post by Moerges »

Thank you very much for your work. :)

Btw, does picture import work now, or does it still need to be fixed?
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I have no idea if it works or not: I haven't yet checked that part of the script.
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Finished with picture, classification and MPAA rating. Now whole script should work. So I'll wait few days for bug reports, then I'll consider that script as being the "official" one.
https://forum.antp.be/users/antp/IMDB.ifs
Thermal Ions
Posts: 58
Joined: 2006-12-08 18:19:18
Location: The Land Down Under

Post by Thermal Ions »

Thanks for your work on this Antoine
Image
Thermal Ions
Posts: 58
Joined: 2006-12-08 18:19:18
Location: The Land Down Under

Post by Thermal Ions »

Been testing out the script a little and came across problem of blank lines in beginning of Comments field, and IMDB TRIVIA heading not being correct (left over text from the actors list is inserted) if Comments field is blank.

Blank lines seems to be fixed by making a change at the end of the Comments section of code.
Change

Code: Select all

    if (GetOption('CommentType') = 2) then
      SetField(fieldComments, #13#10);
to

Code: Select all

    if (GetOption('CommentType') = 2) then
      SetField(fieldComments, '');
IMDB TRIVIA Heading fixed by changing code towards end of the Trivia section.
Change

Code: Select all

      case GetOption('Trivia') of
        1:
          begin
            if GetField(fieldDescription) <> '' then
              Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB TRIVIA: ' + Value
            else
              Value :=  'IMDB ' + Value2 + ': ' + Value;        // <-- changing this line
            SetField(fieldDescription, Value);
          end;
        2:
          begin
            if GetField(fieldComments) <> '' then
              Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB TRIVIA: ' + Value
            else
              Value :=  'IMDB ' + Value2 + ': ' + Value;        // <-- changing this line
            SetField(fieldComments, Value);
          end;
to

Code: Select all

      case GetOption('Trivia') of
        1:
          begin
            if GetField(fieldDescription) <> '' then
              Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB TRIVIA: ' + Value
            else
              Value :=  'IMDB TRIVIA: ' + Value;        // <-- changed this line
            SetField(fieldDescription, Value);
          end;
        2:
          begin
            if GetField(fieldComments) <> '' then
              Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB TRIVIA: ' + Value
            else
              Value :=  'IMDB TRIVIA: ' + Value;        // <-- changed this line
            SetField(fieldComments, Value);
          end;
Cheers.......Thermal
Thermal's Movie db / TV Series db
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Thanks. These were bugs due to some changes that I made (e.g. Value2 that I didn't use anymore) and I did not test all the cases. I'll apply your code directly ;)
I moved the script to www.antp.be/temp/scripts/IMDB.ifs as I noticed that by mistake a previous temporary version of it was there :ha: Strange that nobody sent me report by e-mail about that script, as it was not working very well.
LeMoi
Posts: 171
Joined: 2006-04-09 11:26:43

Post by LeMoi »

Pour un film comme "8 femmes", j'obtiens comme producteur :
Stéphane Célérier, Olivier Delbosc, Marc Missonnier
Normal ?

EDIT : zut quand je colle ici ça passe ^^
à la passe de é, j'ai le code html "é" dans AMC
EDIT 2 : zut ça passe vraiment pas ^^
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

& eacute ; sans les espaces ? :D
J'ai rajouté une ligne, ça devrait être corrigé. Il se peut que la même chose se produise pour d'autres champs.
LeMoi
Posts: 171
Joined: 2006-04-09 11:26:43

Post by LeMoi »

Oui c'était ça ^^
Merci :)
tottem
Posts: 3
Joined: 2007-04-04 15:34:10

Post by tottem »

Maybe I,m doing something wrong, but still not getting de director,s name with your script.

I can get director´s name Using the new auto.imdb.com.ifs from HappyTalk, but I prefer yours, I think is faster.

Any help?

thanx
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Fixed: they replaced "Directed by" by "Director:"
alexch_gr
Posts: 5
Joined: 2007-03-05 14:18:22

Post by alexch_gr »

They also replaced "writing credits" with "writer".
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Thanks
Moerges
Posts: 9
Joined: 2007-02-19 14:15:13

Post by Moerges »

Firstly, thank you, antp, for updating the script. :)

Secondly, I think there's a problem with the Director/Writer part - the site adapts to the number (only one or more than one) of names, so if a movie has more than one Director/Writer, IMDb displays "Directors:/Writers:"

(for example: http://imdb.com/title/tt0249241/)

With "Director:/Writer:" in the script, it wouldn't import the names after "Directors:/Writers:", would it?
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I did it for Writer, now it is done for Director too.
Moerges
Posts: 9
Joined: 2007-02-19 14:15:13

Post by Moerges »

Awesome, thank you! :)
spanky6666
Posts: 1
Joined: 2007-04-11 17:22:11
Location: Belgium

Post by spanky6666 »

Hi,

I'm new to this forum but I'm using your Movie Catalog software for many years now and I'm VERY CONTENT with it :-)
Without this fine piece of software my DVD-VHS catalog would be unmanageable!
Especially the zweckform_4737 print option is very neat :-)

Many thanks for your new IMDB-script antp !
Thermal Ions
Posts: 58
Joined: 2006-12-08 18:19:18
Location: The Land Down Under

Post by Thermal Ions »

Been at it again - fiddling with antp's IMDB script. :shaking:

I found that a spoiler warning sometimes appears in the Trivia list, and presently isn't dealt with very cleanly. To tidy it up insert, the following line:

Code: Select all

      Value := StringReplace(Value, '>>> WARNING: Here Be Spoilers <<<', #13#10 + '>>> WARNING: Here Be Spoilers <<< ');
as follows:

Code: Select all

      Value := StringReplace(Value, '<li>', #13#10 + '- ');
      Value := StringReplace(Value, '>>> WARNING: Here Be Spoilers <<<', #13#10 + '>>> WARNING: Here Be Spoilers <<< ');
      HTMLRemoveTags(Value);
      HTMLDecode(Value);
      case GetOption('Trivia') of
I've also been looking at IMDB's new page layout, and decided it would be pretty easy to adapt antp's Trivia code to have the script also download the Goofs, Crazy Credits, and Movie Connections. So if you want to add this functionality, then feel free to add all of the below sections of code:

I've got too many other personal tweaks in my IMDB script to just link a replacement file - sorry. It's tested on over 150 movies so you could possibly consider implementing it in the standard script if you like Ant.

At the end of the [Options] section:

Code: Select all

Goofs=2|0|0=Do not import goofs|1=Import goofs to Description field, after the summary|2=Import goofs to Comments field, after the comments
MovieConnections=2|0|0=Do not import movie connections|1=Import movie connections to Description field, after the summary|2=Import movie connections to Comments field, after the comments
CrazyCredits=2|0|0=Do not import crazy credits|1=Import crazy credits to Description field, after the summary|2=Import crazy credits to Comments field, after the comments
After the existing call to the Awards procedure, add similar calls to the the new Goofs, Crazy Credits, and Movie Connections procedures:

Code: Select all

  // Awards
  if (GetOption('Awards') > 0) then
  begin
    ImportAwards();
  end;
  
  // Goofs             
  if (GetOption('Goofs') > 0) then
  begin
    ImportGoofs();
  end;

  // Crazy Credits         
  if (GetOption('CrazyCredits') > 0) then
  begin
    ImportCrazyCredits();
  end;

  // Movie Connections     
  if (GetOption('MovieConnections') > 0) then
  begin
    ImportConnections();
  end;
And finally add the following procedures between the end of the ImportAwards procedure and the "// ***** beginning of the program *****"

Code: Select all

// Procedure - ImportGoofs
procedure ImportGoofs;
var
  FullValue, Value : string;
begin
  sleep(50);
  Value := MovieUrl;
  FullValue := GetPage(Value+'/goofs');
  Value := TextBetween(FullValue, '<ul class="trivia">', '<div align="center"> <!--');
  if Value <> '' then
  begin
    Value := StringReplace(Value, #13#10, '');
    while Pos('  ', Value) > 0 do
      Value := StringReplace(Value, '  ', '');
    while Pos('<li> ', Value) > 0 do
      Value := StringReplace(Value, '<li> ', '<li>');
    Value := StringReplace(Value, '<li>', #13#10 + '- ');
    Value := StringReplace(Value, '>>> WARNING: Here Be Spoilers <<<', #13#10 + '>>> WARNING: Here Be Spoilers <<< ');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    case GetOption('Goofs') of
      1:
        begin
          if GetField(fieldDescription) <> '' then
            Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB GOOFS: ' + Value
          else
            Value :=  'IMDB GOOFS: ' + Value;
          SetField(fieldDescription, Value);
        end;
      2:
        begin
          if GetField(fieldComments) <> '' then
            Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB GOOFS: ' + Value
          else
            Value :=  'IMDB GOOFS: ' + Value;
          SetField(fieldComments, Value);
        end;
    end;
  end;
end;

// Procedure - CrazyCredits
procedure ImportCrazyCredits;
var
  FullValue, Value : string;
begin
  sleep(50);
  Value := MovieUrl;
  FullValue := GetPage(Value+'/crazycredits');
  Value := TextBetween(FullValue, '<pre>', '</pre>');
  if length(Value) > 4 then
  begin
    Value:= StringReplace(Value, #13#10, ' ');
    while Pos('  ', Value) > 0 do
      Value := StringReplace(Value, '  ', '');
      Value := StringReplace(Value, '<br><br>', #13#10 + '- ');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    Value := '- ' + FullTrim(Value);
    case GetOption('CrazyCredits') of
      1:
        begin
          if GetField(fieldDescription) <> '' then
            Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB CRAZY CREDITS: ' + #13#10 + Value
          else
            Value :=  'IMDB CRAZY CREDITS: ' + #13#10 + Value;
          SetField(fieldDescription, Value);
        end;
      2:
        begin
          if GetField(fieldComments) <> '' then
            Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB CRAZY CREDITS: ' + #13#10 + Value
          else
            Value :=  'IMDB CRAZY CREDITS: ' + #13#10 + Value;
          SetField(fieldComments, Value);
        end;
    end;
  end;
end;

// Procedure - ImportConnections
procedure ImportConnections;
var
  FullValue, Value : string;
begin
  sleep(50);
  Value := MovieUrl;
  FullValue := GetPage(Value+'/movieconnections');
  Value := TextBetween(FullValue, '<div id="tn15content">', '<div align="center"> <!--');
  if Value <> '' then
  begin
    Value := StringReplace(Value, #13#10, '');
    while Pos('  ', Value) > 0 do
      Value := StringReplace(Value, '  ', '');
    Value := StringReplace(Value, '<h5>', #13#10);
    Value := StringReplace(Value, '</h5>', ':' + #13#10);
    Value := StringReplace(Value, '<br/>', #13#10);
    Value := StringReplace(Value, ' -  ', '- ');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    Value := FullTrim(Value);
    case GetOption('MovieConnections') of
      1:
        begin
          if GetField(fieldDescription) <> '' then
            Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB MOVIE CONNECTIONS: ' + #13#10 + Value
          else
            Value :=  'IMDB MOVIE CONNECTIONS: ' + #13#10 + Value;
          SetField(fieldDescription, Value);
        end;
      2:
        begin
          if GetField(fieldComments) <> '' then
            Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB MOVIE CONNECTIONS: ' + #13#10 + Value
          else
            Value :=  'IMDB MOVIE CONNECTIONS: ' + #13#10 + Value;
          SetField(fieldComments, Value);
        end;
    end;
  end;
end;
Cheers.......Thermal
Thermal's Movie & TV Series db
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Maybe it would be better to try to make a function that works for all these similar page, instead of having a nearly-identical code duplicated?
Post Reply