Opened 10 years ago

Closed 10 years ago

#6219 closed defect (fixed)

Fix for python imdb script to work with IMDbPY 3.9

Reported by: jyavenard@… Owned by: Anduin Withers
Priority: minor Milestone: unknown
Component: Plugin - MythVideo Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

After upgrading to IMDbPY 3.9, I've noticed that when doing an IMDB search in MythTV, in the resulting meta-data the content of the "plot" field was made of only one word.

After investigation, I've found that in IMDBPY 3.6 (which ships with Ubuntu 8.10) returns the plot in the format: Author::plot_content with with 3.9 it is: plot_content::Author

The Mythvideo's imdbpy.py script assumes that the plot field is always in the form: Author::plot_content

The patch attached is a small work-around ; it checks the length of either the description or the author and we assume that the longest is the actual description

Attachments (5)

imdb_script.patch (1.3 KB) - added by jyavenard@… 10 years ago.
imdb_script3.patch (4.4 KB) - added by jyavenard@… 10 years ago.
Addition fixes
imdb_script4.patch (9.2 KB) - added by jyavenard@… 10 years ago.
Add retries parameter.. scripts can't generate exceptions now
imdb_script5.patch (12.2 KB) - added by jyavenard@… 10 years ago.
Using new Python bindings, properly fill genres, cast and country
imdb_script6.patch (11.5 KB) - added by Raymond Wagner <raymond@…> 10 years ago.

Download all attachments as: .zip

Change History (11)

Changed 10 years ago by jyavenard@…

Attachment: imdb_script.patch added

Changed 10 years ago by jyavenard@…

Attachment: imdb_script3.patch added

Addition fixes

comment:1 Changed 10 years ago by jyavenard@…

Added more fixes in the various python imdb scripts.

imdb.py: -fixes exception if no references could be found in IMDb when searching for a title -Now works with IMDbPY 3.9

find_meta.py: -Added fixes to find more data based on the file name -Fixed some TV episodes title resolution -Often IMDb generated an error 500 (internal server error) ; so the script find_meta.pl would end early. Added a quick work around ; if retrieval from IMDb generated an error ; then the query is started one more time just in case. This has solved all my issues so far. Ideally you would want to make the number of retry an optional argument

fetch_poster.py: -Similar as find_meta.py ; will always try a second time in case of an error ...

Changed 10 years ago by jyavenard@…

Attachment: imdb_script4.patch added

Add retries parameter.. scripts can't generate exceptions now

comment:2 Changed 10 years ago by jyavenard@…

Implemented what I earlier suggested: ability to configure how many retries to be performed should there is an error while retrieving the data from IMDb or from movieposter.com. By default it will retry up to 3 times, with a 5s wait between each try.

Also changed the find_meta and fetch_poster to not generate an exception should there been an error while retrieving the data.

That way you can be sure that if you scan a whole directory, all files will be looked at and not stop in the middle due to an error.

comment:3 Changed 10 years ago by jyavenard@…

Forgot to mention another fix: imdbpy would always display the IMDb entry twice per find...

comment:4 Changed 10 years ago by jyavenard@…

Using python-binding as submitted with ticket #6245 :

This version of find_metadata now behaves like the MythVideo? manager when adding metadata. It properly fills the Cast, Genres (multiple) and Country in MythDB.

Category is now filled as Unknown.

Changed 10 years ago by jyavenard@…

Attachment: imdb_script5.patch added

Using new Python bindings, properly fill genres, cast and country

Changed 10 years ago by Raymond Wagner <raymond@…>

Attachment: imdb_script6.patch added

comment:5 Changed 10 years ago by Raymond Wagner <raymond@…>

Slight tweek for >= IMDbPY 3.9's handling of plots in imdbpy.py.

comment:6 Changed 10 years ago by robertm

Resolution: fixed
Status: newclosed

(In [21245]) Closes #6219. Fix imdbpy.py to work with IMDBpy 3.9. Note that this script works with the downloadable (TOS-approved) IMDB database, and does not indicate a return to using IMDb in Myth. Patch from Jean-Yves Avenard, some assistance from Raymond Wagner, thanks to both.

Note: See TracTickets for help on using tickets.