Opened 15 years ago

Closed 15 years ago

#5917 closed enhancement (fixed)

themoviedb.org grabber for mythvideo

Reported by: wstewart@… Owned by: stuartm
Priority: minor Milestone: 0.22
Component: mythvideo Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

Script to grab movie data from themoviedb.org.

At this point, this is a prototype script. It has been tested to the point that it produces output like the imdb.pl script. I have not tested it directly with mythvideo.

It does not provide writer, country or rating information as so far this not available from the database.

Fetching director and cast information may give warnings as some movies a person may have several roles. Code needs to be changed to account for this.

At this point I am posting it so the effort is not lost and there is no duplication of effort. The script is not quite ready for incorporation to svn.

Attachments (7)

tmdb.pl (8.6 KB) - added by wstewart@… 15 years ago.
Prototype script
tmdb.2.pl (8.5 KB) - added by stuartm 15 years ago.
Updated version of script fixing several bugs
tmdb.3.pl (8.6 KB) - added by stuartm 15 years ago.
Fixes the cast and category warnings
tmdb.4.pl (9.9 KB) - added by wstewart@… 15 years ago.
see comment
tmdb.5.pl (10.5 KB) - added by wstewart@… 15 years ago.
updated
tmdb.6.pl (10.5 KB) - added by wstewart@… 15 years ago.
Fix for country error message when there is no country
tmdb.7.pl (10.9 KB) - added by stuartm 15 years ago.
Fix more errors when various pieces of data are missing from the reply

Download all attachments as: .zip

Change History (21)

Changed 15 years ago by wstewart@…

Attachment: tmdb.pl added

Prototype script

Changed 15 years ago by stuartm

Attachment: tmdb.2.pl added

Updated version of script fixing several bugs

comment:1 Changed 15 years ago by stuartm

Milestone: unknown0.22
Version: unknownhead

I've attached an updated script with all the bugs I ran into now fixed. I've removed the fallback to IMDB posters, but as a small compensation it will download the 'fan art' instead if no posters are available.

The poster/artwork download stuff could be smarter, returning the mid sized images rather than the largest if available. In future the fan art should probably have it's own path (-A/-F?) so that mythvideo can download both, leaving the theme to decide which is displayed. Since each has a very different aspect ratio I can't see themes handling posters/art interchangeably.

comment:2 Changed 15 years ago by wstewart@…

Thanks Stuart!! The issue of warnings on director and cast remains. If a person has multiple roles, it will give a warning, not sure how mythvideo will react to a little extra text in the script output. The warning is the nature of how XML::Simple parses the xml and provides the results.

I`ll look at adding a separate option for the fan art, I believe in other media software the fan art is used as a background. Would be cool if mythvideo would in the future support dynamic backgrounds based on this.

Changed 15 years ago by stuartm

Attachment: tmdb.3.pl added

Fixes the cast and category warnings

comment:3 Changed 15 years ago by stuartm

Attached a third version which fixes the cast warnings.

Hit one more bug along the way, but I've forgotten what I was searching at the time so I can't fix it yet.

There is an API bug in the form of unescaped, illegal XML characters which I've reported, but it prevents us from obtaining an results containing an ampersand character. This might be films with an ampersand in their title, or any search which returns matches including an ampersand. Can't be fixed on our end.

Changed 15 years ago by wstewart@…

Attachment: tmdb.4.pl added

see comment

comment:4 Changed 15 years ago by wstewart@…

updated script.

  • Add Stuart as an author (hope I got your last name right).
  • Fix a bug when searching for movie (-M option) that returns an error if there are no search results. Now nothing is printed if there are no search results
  • Pick the mid size poster first
  • Add -B option to display the backdrop(s). Should give list if there is more than one.

comment:5 Changed 15 years ago by wstewart@…

I've posted in the themoviedb forum if the country, writer and rating (ie. PG, R) will be available.

comment:6 Changed 15 years ago by anonymous

Version 4 introduces new errors, but I haven't had time to fix them yet.

comment:7 Changed 15 years ago by wstewart@…

what are the errors? Could only be in the poster generation I guess.

I plan another version tonight to remove the "options" for the -M search command since they are not used and can be used, and update to add the writers.

Country and rating (PG, R), I am told will be added to tmdb later.

comment:8 Changed 15 years ago by stuartm

Search for "Crimson Tide" Use of uninitialized value in string eq at tmdb.pl line 189

Search for "Gerry" Not an ARRAY reference at tmdb.pl line 123.

Country and rating (PG, R), I am told will be added to tmdb later.

Country has been added according to the forum.

Changed 15 years ago by wstewart@…

Attachment: tmdb.5.pl added

updated

comment:9 Changed 15 years ago by wstewart@…

Updated, I think I fixed the two errors. Added country, although I guess it should be treated as a list, may give error if there is a list.

Fixed backdrop cause I wanted it to return a list of the backdrops.

Removed options for search -M.

comment:10 Changed 15 years ago by stuartm

Use of uninitialized value $country in concatenation (.) or string at /usr/local/share/mythtv/mythvideo/scripts/tmdb.pl line 166.

Changed 15 years ago by wstewart@…

Attachment: tmdb.6.pl added

Fix for country error message when there is no country

comment:11 Changed 15 years ago by wstewart@…

Should fix the country problem. Question on how mythvideo with handle the country if missing. Should we print "countries:" when there are none, or just omit it in the output as I am now?

Need to update if there are more than one country. Technically the way the XML is there could be several. I consider one only now, may give error if there is more than one.

Changed 15 years ago by stuartm

Attachment: tmdb.7.pl added

Fix more errors when various pieces of data are missing from the reply

comment:12 Changed 15 years ago by stuartm

Attached version 7 which fixes some more errors and warnings.

comment:13 Changed 15 years ago by stuartm

Owner: changed from Anduin Withers to stuartm
Status: newaccepted

comment:14 Changed 15 years ago by stuartm

Resolution: fixed
Status: acceptedclosed

(In [19251]) Replaces IMDB grabber with themoviedb.org grabber as the default in trunk. This commit doesn't change existing settings or remove the IMDB script yet, I'll do that in a few days once any kinks with the TMDB script have been worked out. If you have an existing install and wish to switch to tmdb.pl then edit the grabber commands accordingly.

Closes #5917

Note: See TracTickets for help on using tickets.