[REQ] ofdb.de FIX! 2 fields doesnt 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.
Post Reply
Legion
Posts: 11
Joined: 2006-09-10 09:03:23

[REQ] ofdb.de FIX! 2 fields doesnt work anymore!

Post by Legion »

Hi there,

the ofdb.de-Script has 2 little errors, it works fine at all, instead of the "actors" and "regie" field. They stay empty, even there is a input for it.

I tried to fix it by myself, but i am yet not skilled enough to do this. At all I think, it is just a little error to fix. So it would be nice, if someone has some minutes to do this.

Here you can donwload the ofdb.de script: http://www.antp.be/temp/scripts/

Thank you very much for any help!!

Greetings,
Legion
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Fixed.

You can download the fixed script here: [download link deleted, look following postings]
(this is a temporary address only for some days - hit 'GMX MediaCenter starten', choose ofdb(DE).ifs - Datei - download)


*** Would be nice to upload this script to antp website :) ***


Some more Information:

The missing data for director & actors is caused by the variable 'BeginPos' always set to '0', as ofdb.de changed the links for director and actors inside the html code from

<a href="view.php?page=liste&Name=Director">

to

<a href='view.php?page=liste&Name=Director%F3'>

When the script imports this line the control list for variables shows a different result :

<a href="view.php?page=liste&Name=Director%F3">

Problem: The script cannot find the position of the " in this line. This error seems to be caused by the ' symbol in the website's html code - a symbol that movie catalog cannot import, because it uses the ' ' symbols to limit strings within the variables (and one ' between two ' ' doesn't work).

Sorry, complicated to explain .. I shouldn't try to ;)
Last edited by bad4u on 2006-12-25 14:10:45, edited 1 time in total.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Fixed the 'Country' field, too.

It imported only one country instead of all (recognized it when testing 'Bandidas')
Legion
Posts: 11
Joined: 2006-09-10 09:03:23

Post by Legion »

Many, many Thanks for fixing it, bad4u ;)

And also thanks for that good and detailed Info, how you fixed it. Now i got it ;)

Greetings & have a nice Xmas
Legion
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

bad4u wrote:
*** Would be nice to upload this script to antp website :) ***
Thanks ;)
I added it to www.antp.be/temp/scripts/
Kikaba
Posts: 4
Joined: 2006-08-30 13:37:09

Post by Kikaba »

sensationell
merci
Legion
Posts: 11
Joined: 2006-09-10 09:03:23

Post by Legion »

Houston, we have a problem (again) ;)

Well, Actors field doesn't work anymore. It only fills just a few actors in the field, then it shows " [mehr] " and thats it. Here you can see the error:

Image

Would be really nice, if someone could fix it!

Many thanks in advance.

Regards,
Legion
yeti
Posts: 60
Joined: 2003-09-14 15:50:05

Post by yeti »

I've fixed this some weeks ago. You can download the script at

http://home.arcor.de/aspg/files/OFDb-DE.rar

edit: The script reads the detail page to get the full Actors list!

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

Post by antp »

Thanks, I added it with the other scripts.
Legion
Posts: 11
Joined: 2006-09-10 09:03:23

Post by Legion »

Many Thanks for your work!!

Regards,
Legion
yeti
Posts: 60
Joined: 2003-09-14 15:50:05

Post by yeti »

Hi,

I've updated the OFDB.de-Script again.

Code: Select all

1.0.2 (03/06/2007) by yeti
- Chg: Code cleanup
- New: Option to import the description as is, include all line feeds.
  Standard is reformat as before.
- Fix: The last change in actors loading from the cast/crew details page
  reads the crew names too :( Hope I've finally fixed this now.
Same download link as before.

Antoine, please update it on your server.
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

done
DarkS
Posts: 9
Joined: 2004-10-15 23:47:24

Post by DarkS »

Hmm. Its strange no one mentioned this problem yet, but the current OFDB script doesn't work if there are just a few actors (without "[mehr]" part) on the page. Then it imports just an empty string instead of actors names. To prevent this behavior you have to comment out (or delete) line 158 in the script.

Here's the part of the code (second line) that I mean:

Code: Select all

     begin
       //Line := TextBefore(Line, '<font style="font-size: 11px;"', '');
       Line := StringReplace(Line, '<br><a', ', <br><a');
       HTMLRemoveTags(Line);
       SetField(fieldActors, Line);
     end;
Maybe you can fix it in your script.
yeti
Posts: 60
Joined: 2003-09-14 15:50:05

Post by yeti »

You are right. Thanks. I uploaded an updated script.

http://home.arcor.de/aspg/files/OFDb-DE.rar

Because I've tested this for the version 1.0.2, I think ofdb has changed the page after my release. But most of my movies have a [mehr]-Link, so I didn't find out this bug.

Bye,
yeti
DarkS
Posts: 9
Joined: 2004-10-15 23:47:24

Post by DarkS »

There is another bug in OFDB script. This time within the description part. The behavior is the same as it was with actors.

To fix this bug replace following code (line 181)

Code: Select all

  // Description
  LineNr := Findline('<b>Inhalt:</b>', Page, 0);
  if LineNr > -1 then
  begin
    LineNr := Findline('<a href="view.php?page=inhalt', Page, 0);
    Line := Page.GetString(LineNr);
    BeginPos := Pos('<a href="view.php?page=inhalt', Line) + 9;
    EndPos := Pos('"><b>[mehr]', Line);
    Value := Copy(Line, BeginPos, EndPos - BeginPos);
    GetDescriptions(Value);
  end;
with this

Code: Select all

  // Description
  LineNr := Findline('<b>Inhalt:</b>', Page, 0);
  LineNrTmp := LineNr;
  if LineNr > -1 then
  begin
    LineNr := Findline('<a href="view.php?page=inhalt', Page, 0);
    if LineNr > -1 then
    begin //"[mehr]" part exists
      Line := Page.GetString(LineNr);
      BeginPos := Pos('<a href="view.php?page=inhalt', Line) + 9;
      EndPos := Pos('"><b>[mehr]', Line);
      Value := Copy(Line, BeginPos, EndPos - BeginPos);
      GetDescriptions(Value);
    end else
    begin //No "[mehr]" part exists
      Line := Page.GetString(LineNrTmp);
      Value := TextBetween(Line, '<b>Inhalt:</b>', '</p></font></td>');
      SetField(fieldDescription, FullTrim(Value));
    end;
  end;
and define a new Integer variable "LineNrTmp" in line 69.

I hope it can't happen that a description without [mehr] part goes over multiple lines. Because for this situation this fix wouldn't work as well.
Post Reply