Skip to content
dbr edited this page Sep 12, 2010 · 24 revisions

Example usage

from tvdb_api import tvdb
t = tvdb(interactive=True,debug=False)
print t['Scrubs'][4][22]['name' # This will print the name of Scrubs episode 22, in season 4
print t['My Name Is Earl'][2][1]['name'] # Prints name of episode 1 of season 2

Initialization argument
Currently there are only two arguments when initializing the tvdb() class: debug and interactive.

Interactive will prompt the user to select a series from a list. It prints out a list in the following format, and gets user input via raw_input() :

1 -> Lost (tvdb id: 73739)
2 -> Lost (2001) (tvdb id: 72906)
3 -> Lost Treasures of NFL Films (tvdb id: 73831)
4 -> Lost Universe (tvdb id: 73181)
5 -> Lost Highway (tvdb id: 74729)
6 -> Lost at Home (tvdb id: 71150)
Enter choice (first number):
</pre>

The second option, debug, simply shows debugging info (Such as requests URLs, information on “name correction”) to stderr.

Clone this wiki locally