Difference between revisions of "MythVideo Grabber Script Format"

From MythTV Official Wiki
Jump to: navigation, search
(The Data Command)
Line 4: Line 4:
  
 
All scripts must provide a search command, which takes a title as an argument and return a list of possible results.  The results must be one per line, in the format:
 
All scripts must provide a search command, which takes a title as an argument and return a list of possible results.  The results must be one per line, in the format:
 +
  
 
{| cellpadding="4" border="1"
 
{| cellpadding="4" border="1"
Line 33: Line 34:
 
0048750:The Trouble with Harry (1955)</pre>
 
0048750:The Trouble with Harry (1955)</pre>
 
|}
 
|}
 +
  
 
Inetref is a number like an IMDB, TMDB, or TVDB number.  It is a unique serial ID that identifies that film to the data source's API.  
 
Inetref is a number like an IMDB, TMDB, or TVDB number.  It is a unique serial ID that identifies that film to the data source's API.  
 +
  
  
Line 40: Line 43:
  
 
Each grabber must also provide a data command.  The data returned includes items such as title, subtitle, year of release, and other textual metadata.  Grabbers written for MythTV .23 or greater should also return image results for coverart, fanart, banners, and screenshots (where available).  This command varies slightly depending on whether the script is for TV or Film material.  For Television Material, the season and episode numbers are added to the arguments.
 
Each grabber must also provide a data command.  The data returned includes items such as title, subtitle, year of release, and other textual metadata.  Grabbers written for MythTV .23 or greater should also return image results for coverart, fanart, banners, and screenshots (where available).  This command varies slightly depending on whether the script is for TV or Film material.  For Television Material, the season and episode numbers are added to the arguments.
 +
  
 
{| cellpadding="4" border="1"
 
{| cellpadding="4" border="1"
Line 79: Line 83:
 
Runtime:45
 
Runtime:45
 
</pre>
 
</pre>
 +
|}
 +
 +
 +
=== Valid Key:Data Pairs ===
 +
 +
The following table illustrates valid values that can be returned by the grabber script, and explains the necessary formatting.  None of the values are required.
 +
 +
 +
{| cellpadding="4" border="1"
 +
| style="background:silver" | '''Title'''
 +
| The title of the film or program.
 +
| Text
 +
|-
 +
| style="background:silver" | '''Subtitle'''
 +
| align="center"  | The subtitle of the film or program.
 +
| Text
 +
|-
 +
| style="background:silver" | '''Year'''
 +
| align="center" | The release or transmission date of the film or program.
 +
| Integer Value
 +
|-
 +
| style="background:silver" | '''Director'''
 +
| align="center"  | The Director of the queried item.
 +
| Text
 +
|-
 +
| style="background:silver" | '''Plot'''
 +
| align="center"  | The Plot/Description of the queried item.
 +
| Text
 +
|-
 +
| style="background:silver" | '''UserRating'''
 +
| align="center"  | The rating of the item by the data source's users.
 +
| Floating Point number 0-10.0
 +
|-
 +
| style="background:silver" | '''MovieRating'''
 +
| align="center" | The classification/Film Rating of the item (eg G, PG, PG-13, R)
 +
| Text
 +
|-
 +
| style="background:silver" | '''Runtime'''
 +
| align="center"  | The playing time of the item.
 +
| Integer
 +
|-
 +
| style="background:silver" | '''Season'''
 +
| align="center"  | The Season of the item.
 +
| Integer
 +
|-
 +
| style="background:silver" | '''Episode'''
 +
| align="center"  | The episode number of the item.
 +
| Integer
 +
|-
 +
| style="background:silver" | '''Coverart'''
 +
| align="center"  | The Coverart/Poster download URLs for the item.  Multiple values can be returned, and should be separated by commas.
 +
| comma-separated URLs
 +
|-
 +
| style="background:silver" | '''Fanart'''
 +
| align="center"  | The Fanart download URLs for the item.  Multiple values can be returned, and should be separated by commas.
 +
| comma-separated URLs
 +
|-
 +
| style="background:silver" | '''Banner'''
 +
| align="center"  | The Banner download URLs for the item.  Multiple values can be returned, and should be separated by commas.
 +
| comma-separated URLs
 +
|-
 +
| style="background:silver" | '''Screenshot'''
 +
| align="center"  | The Screenshot download URLs for the item.  Multiple values can be returned, and should be separated by commas.
 +
| comma-separated URLs
 
|}
 
|}

Revision as of 17:38, 28 October 2009

MythVideo grabber scripts are small executable perl, python, or binary applications which query online sources of metadata and return it in a format parseable by MythVideo. This page documents the current format required of the grabber scripts to function.

The Search Command

All scripts must provide a search command, which takes a title as an argument and return a list of possible results. The results must be one per line, in the format:


Command Format SCRIPTNAME -ARGS TITLE
Command Example ./tmdb.pl -M "Harry"
Response Format INETREF:TITLE
Response Example
0241527:Harry Potter And The Philosopher's Stone (2001)
0304141:Harry Potter And The Prisoner Of Azkaban (2004)
0373889:Harry Potter and the Order of the Phoenix (2007)
0295297:Harry Potter And The Chamber Of Secrets (2002)
0330373:Harry Potter And The Goblet Of Fire (2005)
0216800:Harry, un ami qui vous veut du bien (2000)
0329028:Dumb and Dumberer: When Harry Met Lloyd  (2003)
0118954:Deconstructing Harry (1997)
0066999:Dirty Harry  (1971)
0098645:Who's Harry Crumb? (1989)
0098635:When Harry Met Sally... (1989)
0093148:Harry and the Hendersons (1987)
1201607:Harry Potter and the Deathly Hallows: Part II (2011)
0926084:Harry Potter and the Deathly Hallows: Part I (2010)
0417741:Harry Potter and the Half-Blood Prince (2009)
0048750:The Trouble with Harry (1955)


Inetref is a number like an IMDB, TMDB, or TVDB number. It is a unique serial ID that identifies that film to the data source's API.


The Data Command

Each grabber must also provide a data command. The data returned includes items such as title, subtitle, year of release, and other textual metadata. Grabbers written for MythTV .23 or greater should also return image results for coverart, fanart, banners, and screenshots (where available). This command varies slightly depending on whether the script is for TV or Film material. For Television Material, the season and episode numbers are added to the arguments.


Command Format (FILM) SCRIPTNAME -ARGS INETREF
Command Example (FILM) ./tmdb.pl -D 0241527
Command Format (TELEVISION) SCRIPTNAME -ARGS TITLE SEASONNUM EPISODENUM
Command Example (TELEVISION) ./ttvdb.py -D 73739 5 1
Response Format KEY:DATA
Response Example
Title:Lost
Subtitle:Because You Left
Season:5
Episode:1
Year:2009
Director:Stephen Williams
Plot:The remaining island survivors start to feel the effects of the 
aftermath of moving the island, and Jack and Ben begin their quest 
to reunite the Oceanic 6 in order to return to the island with Locke's 
body in an attempt to save their former fellow castaways.
UserRating:7.9
Screenshot:http://www.thetvdb.com/banners/episodes/73739/382841.jpg
InetRef:73739
Cast:Matthew Fox, Evangeline Lilly, Naveen Andrews, Elizabeth Mitchell, 
Michael Emerson, Terry O'Quinn, Daniel Dae Kim, Yunjin Kim, Josh Holloway, 
John Terry, Andrew Divoff, Sam Anderson, L. Scott Caldwell, Nestor Carbonell, 
Kevin Durand, Jeff Fahey, Tania Raymonde, Mira Furlan, Alan Dale, Sonya Walger, 
Rebecca Mader, Ken Leung, Jeremy Davies, Kiele Sanchez, Rodrigo Santoro
Genres:Action and Adventure, Drama, Science-Fiction
Runtime:45


Valid Key:Data Pairs

The following table illustrates valid values that can be returned by the grabber script, and explains the necessary formatting. None of the values are required.


Title The title of the film or program. Text
Subtitle The subtitle of the film or program. Text
Year The release or transmission date of the film or program. Integer Value
Director The Director of the queried item. Text
Plot The Plot/Description of the queried item. Text
UserRating The rating of the item by the data source's users. Floating Point number 0-10.0
MovieRating The classification/Film Rating of the item (eg G, PG, PG-13, R) Text
Runtime The playing time of the item. Integer
Season The Season of the item. Integer
Episode The episode number of the item. Integer
Coverart The Coverart/Poster download URLs for the item. Multiple values can be returned, and should be separated by commas. comma-separated URLs
Fanart The Fanart download URLs for the item. Multiple values can be returned, and should be separated by commas. comma-separated URLs
Banner The Banner download URLs for the item. Multiple values can be returned, and should be separated by commas. comma-separated URLs
Screenshot The Screenshot download URLs for the item. Multiple values can be returned, and should be separated by commas. comma-separated URLs