You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The easiest and recommended way to install pytvdbapi is to use pip:
$pip install pytvdbapi
Depending on your platform, you may need root permission to execute the above
commands.
ArchLinux
Tobias Röttger is kindly maintaining an ArchLinux package of pytvdbapi that
can be found here.
Usage
To use the API you should apply for an API key for your particular application.
An API key can be obtained for free from thetvdb.com. These are some of the things you
can do with pytvdbapi.
Create a db instance:
>>> from pytvdbapi import api
>>> db = api.TVDB('B43FF87DE395DF56')
Search for a show name:
>>> result = db.search('Dexter', 'en')
>>> len(result)
1
Obtain a show instance and access the data:
>>> show = result[0]
>>> print(show.SeriesName)
Dexter
>>> len(show) # List the number of seasons of the show, season 0 is the specials season
9
Access individual seasons:
>>> season = show[1]
>>> len(season) # List the number of episodes in the season, they start at index 1
12
>>> print(season.season_number)
1