Author Topic: AllRovi movie script  (Read 29176 times)

0 Members and 1 Guest are viewing this topic.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllRovi movie script
« Reply #80 on: July 27, 2011, 02:31:42 am »
AllMovie fans will find the attached list of links interesting. Remove the TXT extension and open it in a browser. Now if I could only get the script to save these instead of just the terms... :-\

[attachment deleted by admin]

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllRovi movie script
« Reply #81 on: July 27, 2011, 10:00:41 am »
Version 10 attached (and to top post). Changes:

• added GET_DURATION option to write 'Run time' to mfDuration
• added Ivek's 'Rovi Awards' link
• added 'Attributes' (values pulled from 'Characteristics')

[attachment deleted by admin]

Offline minolotus

  • User
  • ***
  • Posts: 69
    • View Profile
Re: AllRovi movie script
« Reply #82 on: July 27, 2011, 08:33:28 pm »
AllMovie fans will find the attached list of links interesting. Remove the TXT extension and open it in a browser. Now if I could only get the script to save these instead of just the terms... :-\

Oh no, that wasn't fair. Now, I have the blues thinking about the good old days with allmovie  :'(

Version 10 attached (and to top post). Changes:
• added 'Attributes' (values pulled from 'Characteristics')

Thanks, that works great. One additional question (I am sure if this has been discussed already): Is it possible to remove these items from the characteristics field?
« Last Edit: July 27, 2011, 08:48:22 pm by minolotus »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllRovi movie script
« Reply #83 on: July 28, 2011, 01:47:51 am »
Quote
Is it possible to remove these items from the characteristics field?

Maybe. I was going to, but wasn't sure how it should be done. I was reluctant to change the content of a field that might be expected to remain the same as the source. (Had I been able to pull it apart completely, I still would have saved the entire Characteristics field intact.) Some may not want to bother with a separate Attributes field, so removing them would have to be optional.

Could I interest you in AllMovie Mood Links instead? ;D

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: AllRovi movie script
« Reply #84 on: July 28, 2011, 05:14:48 am »
AllMovie fans will find the attached list of links interesting. Remove the TXT extension and open it in a browser. Now if I could only get the script to save these instead of just the terms... :-\
Thank you for this
Version 10 attached (and to top post). Changes:

• added GET_DURATION option to write 'Run time' to mfDuration
• added Ivek's 'Rovi Awards' link
• added 'Attributes' (values pulled from 'Characteristics')
and this

Quote
Could I interest you in AllMovie Mood Links instead?
Why not, it would be interesting looking at Moods field.
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline minolotus

  • User
  • ***
  • Posts: 69
    • View Profile
Re: AllRovi movie script
« Reply #85 on: July 28, 2011, 06:22:32 pm »
Could I interest you in AllMovie Mood Links instead? ;D

Good reply  ;D

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: AllRovi movie script
« Reply #86 on: July 28, 2011, 06:55:43 pm »
For Moods here is code:

Code: [Select]
//Characteristics  
 //modified by rick.ca 07/09/2011
 TmpStr := HTMLValues(HTML,
'<h3>characteristics</h3>', '<div class="promo-frame">',
'>- ', '</div>',
', ', EndPos);
AddCustomFieldValueByName('Characteristics', TmpStr);

//Added by rick.ca 07/26/2011 to pull 'Attributes' from 'Characteristics'
 TmpStr1 := ''
 if Pos('High Artistic Quality', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'High Artistic Quality';
 if Pos('High Budget', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'High Budget';
 if Pos('High Historical Importance', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'High Historical Importance';
 if Pos('High Production Values', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'High Production Values';
 if Pos('Low Artistic Quality', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'Low Artistic Quality';
 if Pos('Low Budget', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'Low Budget';
 if Pos('Low Production Values', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'Low Production Values';
 if Pos('Cult Film', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'Cult Film';
 if Pos('Sleeper', TmpStr) > 0 then TmpStr1 := TmpStr1 + ', ' + 'Sleeper';
 AddCustomFieldValueByName('Attributes', TmpStr1);


//Added by Ivek23 07/28/2011 to pull 'Moods' from 'Characteristics'
 TmpStr2 := ''
 if Pos('A Good Cry', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'A Good Cry';
 if Pos('A World of Its Own', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'A World of Its Own';
 if Pos('Abandon All Hope', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Abandon All Hope';
 if Pos('Adrenaline Rush', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Adrenaline Rush';
 if Pos('Angsty', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Angsty';
 if Pos('Bad Taste', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Bad Taste';
 if Pos('Blood and Gore', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Blood and Gore';
 if Pos('Button Pushers', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Button Pushers';
 if Pos('Carnal Knowledge', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Carnal Knowledge';
 if Pos('Comedy on the Edge', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Comedy on the Edge';
 if Pos('Estrogen Shot', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Estrogen Shot';
 if Pos('Eyepoppers', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Eyepoppers';
 if Pos('Fantastic Reality', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Fantastic Reality';
 if Pos('Flames of Passion', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Flames of Passion';
 if Pos('Food for Thought', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Food for Thought';
 if Pos('For Love of Country', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'For Love of Country';
 if Pos('Gutbusters', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Gutbusters';
 if Pos('Head Trips', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Head Trips';
 if Pos('High on Emotion', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'High on Emotion';
 if Pos('In a Minor Key', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'In a Minor Key';
 if Pos('In the Mood for Love', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'In the Mood for Love';
 if Pos('Just for Fun', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Just for Fun';
 if Pos('Just for Laughs', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Just for Laughs';
 if Pos('Just for Laughs', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Just for Laughs';
 if Pos('Memory Lane', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Memory Lane';
 if Pos('Mindbenders', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Mindbenders';
 if Pos('Mood Enhancers', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Mood Enhancers';
 if Pos('Nail-biters', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Nail-biters';
 if Pos('Off the Beaten Path', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Off the Beaten Path';
 if Pos('Only Human', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Only Human';
 if Pos('Other Dimensions', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Other Dimensions';
 if Pos('Pick-Me-Ups', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Pick-Me-Ups';
 if Pos('Slow Burn', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Slow Burn';
 if Pos('Spellbinders', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Spellbinders';
 if Pos('Strictly Speaking', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Strictly Speaking';
 if Pos('Thrill Rides', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Thrill Rides';
 if Pos('Tough Guys', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Tough Guys';
 if Pos('Trashy', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Trashy';
 if Pos('Triumph of the Geeks', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Triumph of the Geeks';
 if Pos('Triumph of the Spirit', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Triumph of the Spirit';
 if Pos('Uncomfortable Viewing', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Uncomfortable Viewing';
 if Pos('Unloveables', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Unloveables';
 if Pos('Young and Old Alike', TmpStr) > 0 then TmpStr2 := TmpStr2 + ', ' + 'Young and Old Alike';
 AddCustomFieldValueByName('Moods', TmpStr2);
« Last Edit: July 28, 2011, 07:05:46 pm by Ivek23 »
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllRovi movie script
« Reply #87 on: July 28, 2011, 10:43:42 pm »
Rick.ca, Do you have a problem with the series that AllRovi Movie Script is transferred all the info data, test this one movie (series) Title: Beverly Hills 90210 [TV Series] (1990)? If you do not pass, it (will) be moved to the Description tag end of the AMG ID tag in AllRovi script, for me it's working.

I've fixed 'Description' and 'Awards' so if there's no data the field is skipped. I tried but failed to figure out why the data that is available (other than 'Title' and 'Year') is not added for this series record. I hope there's not many others like it. :(

Version 11 attached (and to top post). Changes:

• changed 'Synopsis' to skip if there isn't one
• changed 'Awards' to skip if there are none
• added Ivek's 'Moods' (values pulled from 'Characteristics')
• changed MPAA rating' format to caps without underscores (e.g., 'pg_13' to 'PG13')


[attachment deleted by admin]

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllRovi movie script
« Reply #88 on: July 30, 2011, 02:21:02 am »
Due to overwhelming popular demand...

Version 12 attached (and to top post). Changes:

• added 'Mood links' (hyperlinks to AllMovie mood pages--if available in WayBack archive)
• fixed error in 'Synopsis' preventing it from being saved

'Mood links' are without warranty. They'll work as long as the WayBack Machine can find the pages in it's archive. It only has 23 of 41 mood values I'm aware of to begin with. And none of those, of course, will ever be updated. Like 'Moods', values are pulled from the 'Characteristics' field—which doesn't necessarily include all the moods previously assigned by AllMovies. Mood values found in 'Characteristics' for which there is no link are saved as plain text—so the content will be the same as 'Moods'. 'Mood links' must be a memo-type field for the hyperlinks to work.

'Mood links' are not very practical, but provide a small way for us to thumb our noses at Rovi. ;D

[attachment deleted by admin]

Offline RazorHall

  • User
  • ***
  • Posts: 50
    • View Profile
Re: AllRovi movie script
« Reply #89 on: July 30, 2011, 03:48:20 am »
Thanks again for your work on this script.  Great stuff!  There is one small issue I'm seeing now and then... As I'm going down my list, updating each movie, occasionally I'll come across one that isn't getting the characteristics information.  The film Ab-Normal Beauty is one example.  Any thoughts on what might be causing this?

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllRovi movie script
« Reply #90 on: July 30, 2011, 08:05:34 am »
Ab Normal Beauty suggests a rare situation where there are Characteristics, but nothing at all after them on the tab. The following change will fix that. Hopefully, it will work for everything else too.  :-\

Code: [Select]
//Characteristics 
 //modified by rick.ca 07/29/2011 for records with nothing after 'Characteristics'
 TmpStr := HTMLValues(HTML,
'<h3>characteristics</h3>', '<!--[if !IE 7]><!-->', //ItemEnd was '<div class="promo-frame">'
'>- ', '</div>',
', ', EndPos);
AddCustomFieldValueByName('Characteristics', TmpStr);

Please try this to see if it fixes all the cases where you noticed the problem.

Offline RazorHall

  • User
  • ***
  • Posts: 50
    • View Profile
Re: AllRovi movie script
« Reply #91 on: July 30, 2011, 02:37:35 pm »
That did the trick in the vast majority of cases, but the problem still pops up on rare occasions (Bounty Huntress 2, for example).
« Last Edit: July 30, 2011, 02:47:35 pm by RazorHall »

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: AllRovi movie script
« Reply #92 on: July 30, 2011, 05:26:01 pm »
That did the trick in the vast majority of cases, but the problem still pops up on rare occasions (Bounty Huntress 2, for example).

Try this code
Code: [Select]
//Themes (Category)
 //modified by rick.ca 07/09/2011
 //modified by Ivek23 07/30/2011
 TmpStr := HTMLValues(HTML,
'data-typeOp=', '</div>',
'">', '</button>',
', ', EndPos);

if GET_THEMES then
AddFieldValue(mfCategory, TmpStr);
 AddCustomFieldValueByName('Themesr', TmpStr)

This movie 10 Things I Hate About You (1999) also has a button "more" there, now that this is already correct, it would not be bad to add the option is what is hidden under the "more" button.

BTW:
It should be Synopsis move the location of the AMG ID,
Code: [Select]
//AMG ID
 AddCustomFieldValueByName('AMG WID', HTMLValues(HTML,
                             '<dt>AMG ID</dt>', '</dd>',
                '<pre>', '</pre>',
                ', ', EndPos));


//Description
//modified by Ivek23 and rick.ca 07/09/2011
 curPos := PosFrom('<span>', HTML, curPos);
 endPos := PosFrom('</span>', HTML, curPos);
 TmpStr5 := TextBetween(HTML, '<span>', '</span>', True, curPos);

 curPos := PosFrom('<span>by', HTML, curPos);
 endPos := PosFrom('</span>', HTML, curPos);
 if RICK_CA then
TmpStr3 := TextBetween(HTML, '<span>by ', '</span>', True, curPos)
 else
TmpStr3 := TextBetween(HTML, '<span>', '</span>', True, curPos);

 curPos := PosFrom('<strong>', HTML, curPos);
 endPos := PosFrom('</strong>', HTML, curPos);
 TmpStr4 := TextBetween(HTML, '<strong>', '</strong>', True, curPos);

 curPos := PosFrom('<p>', HTML, curPos);
 endPos := PosFrom('</p>', HTML, curPos);
 TmpStr := Copy(HTML, curPos, EndPos - curPos);
 TmpStr1 := StringReplace(TmpStr, ' -- ', '—', True, True, False);
 TmpStr2 := StringReplace(TmpStr1, ' --- ', '—', True, True, False);
 TmpStr := StringReplace(TmpStr2, '--', '—', True, True, False);
 TmpStr1 := StringReplace(TmpStr, #13#13#13#13, #13#10#13#10, True, True, False);
 TmpStr2 := RemoveTagsEx(TmpStr1);

 if TmpStr4 = 'synopsis' then
if RICK_CA then
AddFieldValue(mfDescription, TmpStr2 + #13 + '—' + TmpStr3)
else
AddFieldValue(mfDescription, '  ~~  ' + TmpStr4 + '  ~~  ' + #13 + TmpStr2 + #13 + ' - ' + TmpStr3 )          
 else
LogMessage('No Synopsis available');

end;
it will be fine, because I have done so (as well as original AllMovie script Description was at the end) and I have no problems in the functioning of the script and when the later will not more problems.

Edit: .... Description was at the end above procedure ParseSearchResults).
« Last Edit: July 31, 2011, 05:09:36 am by Ivek23 »
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline RazorHall

  • User
  • ***
  • Posts: 50
    • View Profile
Re: AllRovi movie script
« Reply #93 on: July 30, 2011, 06:57:16 pm »
Try this code

Unfortunately there seems to be no change after using that code.

EDIT: Actually, I see now that it is getting more information into the Category field of some movies, so thanks for that.  :)  Still having the above issue with the Characteristics field on a select few movies, though.
« Last Edit: July 30, 2011, 07:30:33 pm by RazorHall »

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: AllRovi movie script
« Reply #94 on: July 30, 2011, 08:06:36 pm »
Quote
Still having the above issue with the Characteristics field on a select few movies, though.
What are the problems then there.
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline RazorHall

  • User
  • ***
  • Posts: 50
    • View Profile
Re: AllRovi movie script
« Reply #95 on: July 30, 2011, 08:19:27 pm »
What are the problems then there.

It's pretty rare, but I'm finding a few movies that aren't downloading the Characteristics information.  As mentioned above, Bounty Huntress 2 is an example of this.
« Last Edit: July 31, 2011, 03:19:26 am by RazorHall »

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: AllRovi movie script
« Reply #96 on: July 30, 2011, 08:51:08 pm »

This movie 10 Things I Hate About You (1999) also has a button "more" there, now that this is already correct, it would not be bad to add the option is what is hidden under the "more" button.

BTW:
It should be Synopsis move the location of the AMG ID,
Code: [Select]
//AMG ID
 AddCustomFieldValueByName('AMG WID', HTMLValues(HTML,
                             '<dt>AMG ID</dt>', '</dd>',
                '<pre>', '</pre>',
                ', ', EndPos));


//Description
//modified by Ivek23 and rick.ca 07/09/2011
 curPos := PosFrom('<span>', HTML, curPos);
 endPos := PosFrom('</span>', HTML, curPos);
 TmpStr5 := TextBetween(HTML, '<span>', '</span>', True, curPos);

 curPos := PosFrom('<span>by', HTML, curPos);
 endPos := PosFrom('</span>', HTML, curPos);
 if RICK_CA then
TmpStr3 := TextBetween(HTML, '<span>by ', '</span>', True, curPos)
 else
TmpStr3 := TextBetween(HTML, '<span>', '</span>', True, curPos);

 curPos := PosFrom('<strong>', HTML, curPos);
 endPos := PosFrom('</strong>', HTML, curPos);
 TmpStr4 := TextBetween(HTML, '<strong>', '</strong>', True, curPos);

 curPos := PosFrom('<p>', HTML, curPos);
 endPos := PosFrom('</p>', HTML, curPos);
 TmpStr := Copy(HTML, curPos, EndPos - curPos);
 TmpStr1 := StringReplace(TmpStr, ' -- ', '—', True, True, False);
 TmpStr2 := StringReplace(TmpStr1, ' --- ', '—', True, True, False);
 TmpStr := StringReplace(TmpStr2, '--', '—', True, True, False);
 TmpStr1 := StringReplace(TmpStr, #13#13#13#13, #13#10#13#10, True, True, False);
 TmpStr2 := RemoveTagsEx(TmpStr1);

 if TmpStr4 = 'synopsis' then
if RICK_CA then
AddFieldValue(mfDescription, TmpStr2 + #13 + '—' + TmpStr3)
else
AddFieldValue(mfDescription, '  ~~  ' + TmpStr4 + '  ~~  ' + #13 + TmpStr2 + #13 + ' - ' + TmpStr3 )          
 else
LogMessage('No Synopsis available');

end;
it will be fine, because I have done so (as well as original AllMovie script Description was at the end) and I have no problems in the functioning of the script and when the later will not more problems.

Edit: .... Description was at the end above procedure ParseSearchResults).

Do it like this as described here, and you'll see what happens then (btw: the previous version of the script before THIS change what you do, make a copy of your script and save it to a new folder,if anything it would be okay as it should be that you got a copy of the script is still available).
« Last Edit: July 31, 2011, 05:10:36 am by Ivek23 »
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline RazorHall

  • User
  • ***
  • Posts: 50
    • View Profile
Re: AllRovi movie script
« Reply #97 on: July 30, 2011, 09:49:43 pm »
When I move the AMG ID paragraph to where you have it, and place the "end;" after the Description section, the AllRovi plugin doesn't even show up as an option under Import anymore.   ???

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllRovi movie script
« Reply #98 on: July 31, 2011, 12:12:47 am »
Quote
When I move the AMG ID paragraph to where you have it, and place the "end;" after the Description section, the AllRovi plugin doesn't even show up as an option under Import anymore.

That will happen if the script causes an error in the program. If using the program with the -debug switch (recommended), the script can be recompiled from the Log (on the Help menu). If the Log is not available, restart the program. In either case, the script configuration is reset to the default (i.e., Overwrite fields... will need resetting).

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllRovi movie script
« Reply #99 on: July 31, 2011, 12:19:33 am »
Version 13 attached (and to top post). Changes:

• fixed 'Characteristics' for rare records with nothing after that section
• introduced 'SavedPos' variables for recalling last good 'LastPos' when expected section not found
• added 'Genre links' for option to save Genres in a memo field as links
• changed name of PVD field from 'Types' to 'Sub-Genres' for consistency, and
• added 'Sub-Genre links' for option to save them in a memo field as links

[attachment deleted by admin]