A module for managing banner information
Although some banners are related to a specific season, all banners will be stored as a property of the related Show instance.
Bases: object
Representing a Banner as provided by thetvdb.com. More information about the data provided for a Banner can be found here.
Attributes:
The number and types of attributes that the Banner has is dependent on the type of Banner it is. Below is a description of the different attributes.
Note: Wherever ‘text’ is given as the attribute type, this means that on Python 2.X it will be of type unicode and on Python 3.X str.
Common:
These attributes are present for all Banner objects.
fanart:
Additional to the common attributes, the following attributes are included on objects of type fanart.
poster:
poster type does not contain any additional attributes.
season:
Additional to the common attributes, the following attributes are included on objects of type season.
Example:
>>> from pytvdbapi import api
>>> db = api.TVDB('B43FF87DE395DF56', banners=True)
>>> show = db.get_series( 79349, "en" ) # Dexter
>>> show.update()
>>> assert len(show.banner_objects) > 0
>>> banner = show.banner_objects[0]
>>> print(banner.banner_url)
http://thetvdb.com/banners/fanart/original/79349-...jpg
>>> print(banner.Language)
en
Showing the different banner types and their attributes.
>>> fanart = [b for b in show.banner_objects if b.BannerType == "fanart"]
>>> dir(fanart[0])
['BannerPath', 'BannerType', 'BannerType2', 'Colors', 'Language',
'Rating', 'RatingCount', 'SeriesName', 'ThumbnailPath', 'VignettePath',
'banner_url', 'id']
>>> print(fanart[0].BannerType2)
1280x720
>>> posters = [b for b in show.banner_objects if b.BannerType == "poster"]
>>> dir(posters[0])
['BannerPath', 'BannerType', 'BannerType2', 'Language', 'Rating',
'RatingCount', 'banner_url', 'id']
>>> print(posters[0].BannerType2)
680x1000
>>> seasons = [b for b in show.banner_objects if b.BannerType == "season"]
>>> dir(seasons[0])
['BannerPath', 'BannerType', 'BannerType2', 'Language', 'Rating',
'RatingCount', 'Season', 'banner_url', 'id']
>>> print(seasons[0].BannerType2)
season