IMDB Import doesn't work anymore

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.
Mike

IMDB Import doesn't work anymore

Post by Mike »

can anyone modify the scripts, thanks?
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

what's the problem _exactly_ ?
latest available version works fine with most of the movies.
Elman

find doesn't work

Post by Elman »

Doesn't work if your name matches more than one movie. Try new Texas Chainsaw Massacre. So I guess 'find' script doesn't work well.
HIW

IMDB script

Post by HIW »

IMDb.com changed design of search page.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

hmmm quite strange.
It was working one or two days ago.
I will check that this evening.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Here are the updated scripts :
http://www.antp.be/temp/IMDB.ifs
http://www.antp.be/temp/IMDB%20(pic).ifs
http://www.antp.be/temp/IMDB%20(large%20pic).ifs
http://www.antp.be/temp/IMDB%20(batch).ifs

If you find movies that show IMDB-related errors (i.e. no about pictures not found on Amazon), do not hesitate to post their title ;)
ricardopetruza

Post by ricardopetruza »

Thx antp! :)
ricduarte
Posts: 5
Joined: 2003-12-21 17:38:39
Location: porto, portugal
Contact:

Post by ricduarte »

Hi, thanks for the updates on the scripts.

One movie I added and did not show the picture: Foolproof (2003)

However, I was able to get a picture running the Yahoo Picture Grap sript just after the imdb script.

Regards,

ricduarte
Mandos

Post by Mandos »

Thank you very much for the update!
Elman

Post by Elman »

Thank you very much. Keep up great work!
Ikkeee

Post by Ikkeee »

Very nice dude! :D

Major thank you
Zbyna
Posts: 8
Joined: 2003-11-20 07:04:24
Location: Czech republic
Contact:

Post by Zbyna »

The Large pics isn't working at my AMC.
A Have a version downloaded from links sended last few replies.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

For which movie for example ?
I've tested few and they work...
Zbyna
Posts: 8
Joined: 2003-11-20 07:04:24
Location: Czech republic
Contact:

Post by Zbyna »

You're right it works, mostly, but on "Z pekla stesti" it isn't.
It's just one movie, take it easy. But I thought that it's not working. Sorry.
Mguel
Posts: 39
Joined: 2003-01-28 10:48:14

Post by Mguel »

Hi, I've noticed that on some movies I get: "<a href="plotsummary">(more)</a" at the end of the description. I'm using the http://www.antp.be/temp/IMDB%20(pic).ifs linked on this post with short description (DescriptionToImport = 1; ).

I've investigated a bit and noticed that this happens on pages where the string "Plot Summary:" is found (i.e. for "Prey for Rock & Roll" movie), but not on the ones that it is used instead the "Plot Outline:" (i.e. Gladiator (2002)). Tried to change some things to make it work but can't do it... nor found the answer searching the forums.

Edit: Trying and trying, guessing and guessing, I manage to make it work. :D

As I'm not a programmer I'm not sure if this is correct or is the orthodox way to have it done. Viewing the source of pages in which it didn't work (with plot summary) I saw that the "<a href" (looked in EndPos := pos('<a href', Line); ) was on a new line. So I added the following code to the script after it looked for '<a href' on the same line, but before it looked for '<br><br>' (added and not replaced since I'm not sure if all the "plot summary" ones have the "<a href="plotsummary">(more)</a" on a new line):

if EndPos < 1 then
begin
Line := Line + Page.GetString(LineNr+1);
EndPos := pos('<a href', Line);

...
...
end;

So the final description code is:

Code: Select all

  //Description
  LineNr := FindLine('Plot Summary:', Page, 0);
  if LineNr < 1 then
    LineNr := FindLine('Plot Outline:', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    BeginPos := pos('</b>', Line) + 5;
    EndPos := pos('<a href', Line);
   if EndPos < 1 then
    begin
      Line := Line + Page.GetString(LineNr+1);
    EndPos := pos('<a href', Line);
    if EndPos < 1 then
    begin
      Line := Line + Page.GetString(LineNr+1);
      EndPos := pos('<br><br>', Line);
      if EndPos < 1 then
        EndPos := Length(Line);
    end;
  end;
    Value := copy(Line, BeginPos, EndPos - BeginPos);
    HTMLDecode(Value);
    case DescrImport of
      0:
        begin
          PickListClear;
          PickListAdd(Value);
          GetDescriptions(GetField(fieldURL) + 'plotsummary');
          if PickListExec('Select a description for "' + MovieName + '"', Value) then
            SetField(fieldDescription, Value);
        end;
      1:
        SetField(fieldDescription, Value);
      2:
        SetField(fieldDescription, GetDescriptions(MovieURL + 'plotsummary'));
    end;
  end;
Please correct me if I'm wrong.
Best regards,
Mguel
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

hmmm so in some case you get 3 lines ? It may be a problem.
I think it would be better to correct the script this way :

Code: Select all

  //Description
  LineNr := FindLine('Plot Summary:', Page, 0);
  if LineNr < 1 then
    LineNr := FindLine('Plot Outline:', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    BeginPos := pos('</b>', Line) + 5;
    EndPos := pos('<a href', Line);
    if EndPos < 1 then
    begin
      Line := Line + Page.GetString(LineNr+1);
      EndPos := pos('<br><br>', Line);
      if EndPos < 1 then
        EndPos := pos('<a href', Line);
      if EndPos < 1 then
        EndPos := Length(Line);
    end;
    Value := copy(Line, BeginPos, EndPos - BeginPos);
[...]etc.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

But I do not have problems with the version included with latest AMC version actually.
Maybe that the script on my site (in the "temp" folder) is quite old.
Do you use AMC 3.4.3 ? If yes, the script included with this one is the newest one.
Mguel
Posts: 39
Joined: 2003-01-28 10:48:14

Post by Mguel »

Thanks for the code and explanation!

You're right, I use 3.4.2. I didn't update since the changelog was a bug fix with some P4 (which I don't have) and 3.4.2 was working fine for me, so wanted to wait for another release to update.

Nevertheless, for the next time, I'll update the scripts at least (I thought the ones linked here where the latest). ;)

Regards,
Mguel
prayer

Post by prayer »

hi,
have one question. just yesterday i used imdb script without any probs
but now, when i try to get info for any movie - it does not return picture.
that's just bug or imdb changes a bit?
ty
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Maybe that IMDB changed, yes, I have the problem too.
I will check that when I've few time.
Post Reply