IMDB script request

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
DerekLee1
Posts: 6
Joined: 2008-01-29 20:30:17

IMDB script request

Post by DerekLee1 »

Can somebody modify the IMDB script to offer the option to put the aspect ratio in the resolution field? Would be MUCH appreciated!!
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

No problem.

New IMDB script version 3.30:
http://www.bad4u.741.com/full/IMDB.ifs (copy link into a NEW browser window !)

I took the opportunity to enhance the script a little bit more and added two new options:
1. option AspectRatio : you can choose between no import, import to field 'video format' or field 'resolution'
2. option MultipleValuesAudioFormat : imports IMDB sound mix listings to field 'audio format', you can choose between different formats for the list

@Antoine: I hope you agree with this new options, the fields have not been in use before. The options list has been sorted to an alphabetic order (if you don't like this, I can bring it to old order again, but it was quite uncomfortable to read after growing to current size). Nothing else has been changed. ;)
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

bad4u wrote: @Antoine: I hope you agree with this new options, the fields have not been in use before.
Sure. I would just have them disabled by default, to not interfere with the info imported from files (maybe it is already the case - I did not check the script).
Thanks for your work ;)
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

To disable them by default, I will need to add one more option setting. Option MultipleValuesAudioFormat uses the same list function that is used for genre, country etc. and so cannot be set to disabled. I'll add this tonight ;)
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Well, user can still disable the importation of that field if he wants, you can keep it then rather than add a new option for that.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

New IMDB script version 3.31:
http://www.bad4u.741.com/full/IMDB.ifs (copy link into a NEW browser window !)

I did not need to add a new option, I just added two additional lines of code to the function 'ImportList'. Now it's possible to disable import on all MultipleValues options like genre, country, audio format..

Import of aspect ratio and audio format is still enabled by default, cause to me it seems the better choice for most users that else might miss the new options - and it can be easily disabled by those who use IMDB in combination with import infos from video files. If you prefer import disabled by default, please change the default settings for options AspectRatio and MultipleValuesAudioFormat before you upload the file ;)
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Thanks.
As you say, maybe it is better to have these options enabled by default indeed...
doctormaligno
Posts: 10
Joined: 2008-02-01 02:17:43

Post by doctormaligno »

Hi, first of all, thanks for this great software, ive been using it for years. Im a movie fan and collector and i love it. Sorry, i needed to say so.

I was updating the scripts when my internet connection went down. Then, imdb script was gone when i restarted AMC. I went to the website and downloaded the lastest version of it, and now instead of the producers im getting the writers. Where can i get the other version where everything was working fine?

Thanks a lot in advance.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

doctormaligno wrote:I went to the website and downloaded the lastest version of it, and now instead of the producers im getting the writers. Where can i get the other version where everything was working fine?
You can change that on IMDB options, it is neither a different script version, nor has the import of producer been changed. The import of writers instead of producers seems to be the default setting, because only writers are listed on films main page.

Open the 'scripting' window where all the scripts are listed. Mark the IMDB script. On the right side of the window you will find an option list for the script. Change settings for 'Producer'. That's it ;)
doctormaligno
Posts: 10
Joined: 2008-02-01 02:17:43

Post by doctormaligno »

Thank for your fast answer and sorry for wasting your time. It's true what you're saying, i remember doing that ages ago. I tried everything before bothering here but all of it was useless. What an ass!

Merci.
DerekLee1
Posts: 6
Joined: 2008-01-29 20:30:17

Post by DerekLee1 »

Fantastic! Thank you SO much! The only thing I can think of to improve this software now would be the ability to rearrange the panes. But that's just being nitpicky. This softwrae ROCKS.
Sorin
Posts: 24
Joined: 2006-03-22 21:05:25

Post by Sorin »

one petition @ bad4u (or other genial script-writers)

i think that one more options "3 -> Take first two values for Category, separated by slashes" in sections "MultipleValuesCategory" will be usefully.

so, if and when u have little time maybe this small adition would be added?

thanks anyway!
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Sorin wrote:i think that one more options "3 -> Take first two values for Category, separated by slashes" in sections "MultipleValuesCategory" will be usefully.
Option 3 is used for "Do not import xxx" ;)

Sure it is possible to add another option for that, but does it really make sense ? On IMDb the genres are sorted alphabetically, not on relevance, so you might miss the most important genres then (i.e. Armageddon would appear on Action/Drama only, not on SciFi).

So I don't like the idea to add this to the IMDb script (at least as there are not more people or antp asking for it). But you can change the script easy in two steps :

1. Open IMDB script on AMCs' editor and search the function ImportList, then copy the code between the lines // START MODIFICATION // and // END MODIFICATION // on the same position in your script:

Code: Select all

function ImportList(PageText: string; MultipleValues: Integer; StartTag: string): string;
var
  Value, Value2: string;
begin
  if MultipleValues = 0 then
  begin
    Value := TextBetween(PageText, StartTag, '</a>');
    Value2 := TextAfter(Value, '">');
  end
  else
  begin
    Value := TextBetween(PageText, StartTag, #13#10);
    Value2 := TextBefore(Value, '<a class="tn15more inline"', '');
    if Value2 = '' then
      Value2 := Value;
    Value2 := TextAfter(Value2, '">');
    HTMLRemoveTags(Value2);
    if MultipleValues = 1 then
      Value2 := StringReplace(Value2, ' / ', ', ');
    if MultipleValues = 3 then
      Value2 := '';

// START MODIFICATION //
    if MultipleValues = 4 then
      begin
        Value := TextBetween(PageText, StartTag, '</a>');
        Value2 := TextAfter(Value, '">');
        Value := TextBetween(RemainingText, StartTag, '</a>');
        Value2 := Value2 + ' / ' + TextAfter(Value, '">');
      end;
// END MODIFICATION //
      
  end;
  HTMLDecode(Value2);
  Result := Trim(Value2);
end;
2. Then hit properties button from the editor, choose MultipleValuesCategory and a fourth option "4 - Import first two Genres, separated by slashes". Save and you are ready to go.

If you don't get it working I will help you with a downloadable file, but I'd prefer if you can do this modification by yourself - as you will need to add it again when IMDb script needs to be updated in future ;)
Sorin
Posts: 24
Joined: 2006-03-22 21:05:25

Post by Sorin »

bad4u wrote:Sure it is possible to add another option for that, but does it really make sense ? On IMDb the genres are sorted alphabetically, not on relevance, so you might miss the most important genres then (i.e. Armageddon would appear on Action/Drama only, not on SciFi).
first, thanks for your quick and curious answer. hm, yes... i agree with your notice, in generaly. but, i need this option for specific case.

manualy modification of the script is ok for me.

but... after i edit the script & copy the code between the lines in MultipleValuesCategory section still dont have fourth option.

so, where is a fault?

thanks again!
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

:)

Are you sure you have latest IMDB script version 3.31 ? You are talking about a fourth option, but since version 3.31 the fourth option is used to disable import of this field. make sure you have latest version before you begin editing: On scripts listing page mark the IMDb script and look for its version information on the left bottom corner. If yours is older than 3.31 please download the current version from http://update.antp.be/amc/scripts/IMDB.ifs or through script [ UPDATE_SCRIPTS ].

If you did not see your fifth option ( = number '4', as options start with '0') on "MultipleValuesCategory" after editing the script, you probably missed editing script properties after copying the code. Or did you use an external editor when editing the script ? Then you might miss the script properties section.

After you copied the code into the script, you need to tell the script about the new option : You must be still in editor mode, then hit the button 'properties' on the top of the window, so that another window will pop up. On the left bottom corner of this script properties window you will see a list with the different options of the script. Now scroll this window to the option MultipleValuesCategory, click on it and edit the 'Available values for selected option'. Here you can see the other option settings. Add a '4' and a description for this new option (like 'Import first two Genres, separated by slashes').

If it still does not work for you, I will upload the modified script this evening ;)
Sorin
Posts: 24
Joined: 2006-03-22 21:05:25

Post by Sorin »

everything is ok now.

i miss this section
bad4u wrote:You must be still in editor mode On the left bottom corner of this script properties window you will see a list with the different options of the script. Now scroll this window to the option MultipleValuesCategory, click on it and edit the 'Available values for selected option'...
for this
bad4u wrote:You are talking about a fourth option, but since version 3.31 the fourth option is used to disable import of this field
i mean fifth option, but wrote fourth instead of number '4', as options start with '0'.

thanks again & excuse for bothering! ;)
Post Reply