English > Scripts and Templates
AllRovi movie script
rick.ca:
I think I've fixed everything mentioned. I appreciate the comments, but I hope you guys appreciate how many brain cells this is costing me... ;)
Version 15 attached (and to top post). Changes:
• changed 'Synopsis' to prevent adding of only a copyright notice
• added GET_POSTER option
• ...use to disable getting poster for one record if bad image URL is causing HTTP 404 error
• fixed 'Themes' handling of values behind 'more' button (was duplicating/skipping values)
• fixed 'Themes' handling of lone theme value (i.e., only button under 'Explore Related Movies')
• changed 'Genres' as recommended by Ivek (works for custom field; mfGenres not tested)
• converted spaces to tabs for script readability and easier editing
[attachment deleted by admin]
rick.ca:
--- Quote from: RazorHall on July 31, 2011, 08:34:03 pm ---So I'd have to go in and replace that section every time a new version was released, yes?
--- End quote ---
I'm not sure what you mean by this. If you're making personal modifications, then keeping it up-to-date can be a PITA. To the extent possible, I recommend doing whatever you can to avoid differences. For example, use the same custom field names as used in the script. (That reminds me—I need to review those to ensure we're using a sensible name in all cases—normally, whatever Rovi calls it.) If there are other essential differences, I recommend using a text editor that does a file comparison. Then you can see the differences and quickly modify one or the other to create an updated personal version.
If you have any modifications you would like to share, we can add them to the script in the same way there are a few RICK_CA options. BTW, I trust no one minds that's 'true' by default. :)
RazorHall:
--- Quote from: rick.ca on August 01, 2011, 02:25:23 am ---
--- Quote from: RazorHall on July 31, 2011, 08:34:03 pm ---So I'd have to go in and replace that section every time a new version was released, yes?
--- End quote ---
I'm not sure what you mean by this.
--- End quote ---
I was referring to Ivek's variation on the code to get those missing themes under the "More" button, a few posts earlier.
RazorHall:
Really liking Version 15 so far. :)
Here's an odd one... I can't get the Rovi Rating to download for the movie Top Model. I can easily edit the rating myself, but I've always used the "Additional Rating" field, and where every other movie has "AllMovie Rating" overwritten with "Rovi Rating" as the info is downloaded/updated, this one still shows "AllMovie Rating".
EDIT: Found another one, The Dallas Connection, that's behaving as above.
rick.ca:
--- Quote ---Here's an odd one... I can't get the Rovi Rating to download for the movie Top Model.
--- End quote ---
Although it may seem odd, it does reveal something important. We don't yet have a very good understanding of how the fundamental processing flow of the script is supposed to work. Your Top Model rating is not being updated because nothing is being updated. Following is the ParsePage routine at the end of the script (most of my musings are for my own and Ivek's benefit)...
--- Code: ---function ParsePage(HTML : String; URL : AnsiString) : Cardinal;
begin
HTML := HTMLToText(HTML);
HTML := StringReplace (HTML, 'http://allrovi.com', 'http://www.allrovi.com', True, True, False);
if Pos('Search Results for', HTML) > 0 then begin
ParseSearchResults(HTML);
Result := prList;
Exit;
end else
if Pos('- Cast, Reviews, Summary, and Awards - AllRovi</title>', HTML) > 0 then
ParseMovie(URL, HTML)
else
if Pos('- Review - AllRovi</title>', HTML) > 0 then
ParseReview(HTML)
else
if Pos('- Cast and Crew - AllRovi</title>', HTML) > 0 then
ParseCast(HTML)
else
if Pos('- Releases - AllRovi</title>', HTML) > 0 then
ParseDVDReleases(HTML);
Mode := NextMode(Mode);
--- End code ---
The if-then-else section is testing for possible forms of page title, which presumably indicate what tabs exist on the page. The most common one, "Cast, Reviews, Summary, and Awards," means everything is there. [Edit1: And it seems this is often used even if all the information is not there.] So ParseMovie is called. I don't really understand how, but the other parts somehow get processed in subsequent "Modes." In the case of Top Model, the "Cast and Crew" page title means there's no synopsis or review. So ParseCast is called. It works, but nothing else happens. The if-then-else logic used here is simply wrong and ineffective.
[Edit2:] Sorry. Now I get it. On each change of Mode, a new page (i.e., main, review, cast and crew, releases) is downloaded, and the if-then-else section is testing for which page is loaded. I don't understand why that can't be determined by Mode, but I've tried as see that it can't (or, at least, I couldn't).
Unfortunately, I don't have a clue what to replace it with. If I try an unconditional ParseMovie(URL, HTML), it seems everything is processed three times—once for each of the main page and the two tabs—and the three URLs are saved. My guess is the script doesn't properly follow the original design where each "Mode" is run separately in turn. But it's over my head. If Ivek can't figure it out, we'll need nostra's help (which probably won't come any time soon).
[Edit2:] So the problem is that movies like these examples have main pages with Cast and Crew titles. As a result, ParseCast is done, but ParseMovie is not. Somehow, this situation needs to be detected, and the same page processed by both... :-\
The good news is the proportion of movies affected seems to be very small. Of my 2200 movies, there's only about a dozen for which there's no Cast data. Only six without a Synopsis (one of those is Top Model). Obviously these are rare, and for most of them I wouldn't expect to find much good data anyway. When Rovi's data is incomplete, the quality of what is there often seems questionable. Nevertheless, I would very much like to see the script working properly. It's annoying to have to wonder whether the data retrieved is all there is—or the result of a script error.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version