Ttvdb.py

From MythTV Official Wiki
Revision as of 22:37, 21 March 2009 by Rdv (talk | contribs)

Jump to: navigation, search
                     THIS PAGE IS A WORK IN PROGRESS

What is ttvdb.py

This python script is intended to perform TV series data lookups based on the thetvdb.comwiki

Downloading ttvdb.py set of scripts

Currently ttvdb.py does not ship with MythTV and only works with v0.22 revision 20232 or higher with a data base Schema Version: 1232 or higher. You will also need to apply the following patch #6346 and optionally: #6158

To download the ttvdb scripts (as a non-root user in a normal directory, such as the user's HOME directory): #6242 - ttvdb make sure to download the latest version (v0.8.9)

Installing ttvdb.py

The MythVideo scripts are typically installed in /usr/share/mythtv/mythvideo/scripts/ or /usr/local/share/mythtv/mythvideo/scripts/. When using mythvideo to download the TV series data ttvdb must be installed in your "...mythvideo/scripts/" directory.

With sudo privileges un-archive all tvdb archive files into your mythvideo scripts directory as described above. You can then delete the tvdb archive file as it is no longer required.

Configuring MythVideo 0.22 to use ttvdb.py

Setup the directories for the TV Series artwork. Utilities/Setup|Setup|Media Settings|Videos Settings|General Settings on page 1/8, enter the directories where the graphic files will be stored. It is recommended to use separate directories for each type of graphic file (Posters, Banners, Fanart and Screen shots).

Change the MythVideo settings to use the new script, the Command to search for TV series listings:

Using the default menu theme, you can find the settings in Utilities/Setup|Setup|Media Settings|Videos Settings|General Settings on page 8/8. After making the changes, the settings should look like:

Command to search for TV Shows in Mythvideo: /usr/local/share/mythtv/mythvideo/scripts/ttvdb.py -M
Command to search for TV Season posters: /usr/local/share/mythtv/mythvideo/scripts/ttvdb.py -mlP
Command to search for TV Show fanart: /usr/local/share/mythtv/mythvideo/scripts/ttvdb.py -tlF
Command to search for TV Season banners: /usr/local/share/mythtv/mythvideo/scripts/ttvdb.py -lB
Command to extract data for TV Episodes: /usr/local/share/mythtv/mythvideo/scripts/ttvdb.py -mD

Now you can use the mythvideo data download feature to get a TV series episode artwork (poster, fanart and banner) and episode details.

Languages

!!!! New feature that will only be available in release v0.9.0 or higher

ttvdb data requests default to English unless the -l option is used. If you specify a language (e.g. -l es), ttvdb will first look for data in that language but if none is available tvdb will return the English equivalent.

Currently thetvdb.com wiki is supporting the following languages: (da, fi, nl, de, it, es, fr, pl, hu, el, tr, ru, he, ja, pt, zh, cs, sl, hr, ko, en, sv, no)

Why am I not getting the promised episode data?

There are the usual suspect:

1) The Schedules Direct episode is completely different then what was entered in thetvdb.com.

2) You have not set up the commands properly in the setting as described above.

3) The episode data was updated but one or more of the graphics will not display. Curently thetvdb.com can get overloaded and which results in graphic files that are actually html error messages. A typical mythfrontend end log message when this is the case looks like:

example error message goes here !!!

If this occurs all you need to do is use the mythvideo "Manage Video|Reset Metadata", then download again, "Manage Video|Download Metadata". If you get a lot of these issues perform your metadata downloads when thetvdb.com is not so overloaded.

Command line examples

To view command line examples of all ttvdb features type:

/usr/local/share/mythtv/mythvideo/scripts/ttvdb.py -u

User configuration file

A user configuration file is not required when grabbing TV data through mythvideo download metadata. This is because you interactively select the specific TV series. If you intend to use tvdb in your own user scripts a user configuration file is highly recommended.

TV listing sources such as Schedules Directdo not always pass MythTV TV series and episode names that match those on thetvdb.com wiki. This can cause ttvdb to retrieve unintended information. Luckily this does not happen often. To compensate ttvdb provides a user configuration file which can deal with those rare cases.

The configuration file can tie a series name (%TITLE%) to a specific thetvdb.com series id (the equivalent of an IMDB number). Also a TV series episode name (%SUBTITLE%) can be modified to match the episode name on thetvdb.com.

The included configuration file "tvdb-example.conf" already has examples of TV series names that need special attention. There is also an episode name that must be manipulated to match those on thetvdb.com wiki.

Here is an example where Schedules Direct has the TV Series name "The Beast" but thetvdb.com has the series name as "The Beast (2009)". Schedules Direct has the series "24" episode name of "Day 7: 10:00PM-11:00PM" while thetvdb.com has "Day 7: 10:00 PM-11:00 PM". The configuration file can compensate for these discrepancies.

Here are known examples that you can add as part of your own ttvdb configuration file. Please add new ones to this section when you encounter them.

[series_name_override] 
# Specify recorded "Life On Mars" shows as the US version  
Life on Mars:82289
# Specify recorded "Eleventh Hour" shows as the US version  
Eleventh Hour:83066
# Specify recorded "Frontline" or "Frontline/World" shows as the "Frontline PBS" version  
Frontline/World:80646
Frontline:80646
# Specify recorded "The Beast" shows are the 2009 version  
The Beast:83805
# Specify recorded "Castle" shows are the 2009 version  
Castle:83462
# Specify recorded "Battlestar Galactica" shows are the 2003 version  
Battlestar Galactica:73545
[ep_name_massage]
# Modify the TV series 24 episode name (%SUBTITLE%)
24: PM," PM", AM, " AM"