本文整理汇总了Python中resources.lib.TheMovieDB.get_tvshow方法的典型用法代码示例。如果您正苦于以下问题:Python TheMovieDB.get_tvshow方法的具体用法?Python TheMovieDB.get_tvshow怎么用?Python TheMovieDB.get_tvshow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resources.lib.TheMovieDB
的用法示例。
在下文中一共展示了TheMovieDB.get_tvshow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_episodes
# 需要导入模块: from resources.lib import TheMovieDB [as 别名]
# 或者: from resources.lib.TheMovieDB import get_tvshow [as 别名]
def get_episodes(content):
shows = ItemList(content_type="episodes")
url = ""
if content == "shows":
url = 'calendars/shows/%s/14' % datetime.date.today()
elif content == "premieres":
url = 'calendars/shows/premieres/%s/14' % datetime.date.today()
results = get_data(url=url,
params={"extended": "full"},
cache_days=0.3)
count = 1
if not results:
return None
for day in results.iteritems():
for episode in day[1]:
ep = episode["episode"]
tv = episode["show"]
title = ep["title"] if ep["title"] else ""
label = u"{0} - {1}x{2}. {3}".format(tv["title"],
ep["season"],
ep["number"],
title)
show = VideoItem(label=label,
path=PLUGIN_BASE + 'extendedtvinfo&&tvdb_id=%s' % tv["ids"]["tvdb"])
show.set_infos({'title': title,
'aired': ep["first_aired"],
'season': ep["season"],
'episode': ep["number"],
'tvshowtitle': tv["title"],
'mediatype': "episode",
'year': tv.get("year"),
'duration': tv["runtime"] * 60 if tv["runtime"] else "",
'studio': tv["network"],
'plot': tv["overview"],
'country': tv["country"],
'status': tv["status"],
'trailer': tv["trailer"],
'imdbnumber': ep["ids"]["imdb"],
'rating': tv["rating"],
'genre': " / ".join(tv["genres"]),
'mpaa': tv["certification"]})
show.set_properties({'tvdb_id': ep["ids"]["tvdb"],
'id': ep["ids"]["tvdb"],
'imdb_id': ep["ids"]["imdb"],
'homepage': tv["homepage"]})
if tv["ids"].get("tmdb"):
art_info = tmdb.get_tvshow(tv["ids"]["tmdb"], light=True)
show.set_artwork(tmdb.get_image_urls(poster=art_info.get("poster_path"),
fanart=art_info.get("backdrop_path")))
shows.append(show)
count += 1
if count > 20:
break
return shows
示例2: tvshow_context_menu
# 需要导入模块: from resources.lib import TheMovieDB [as 别名]
# 或者: from resources.lib.TheMovieDB import get_tvshow [as 别名]
def tvshow_context_menu(self, control_id):
tvshow_id = self.FocusedItem(control_id).getProperty("id")
dbid = self.FocusedItem(control_id).getVideoInfoTag().getDbId()
credit_id = self.FocusedItem(control_id).getProperty("credit_id")
options = [addon.LANG(32169)]
if credit_id:
options.append(addon.LANG(32147))
index = xbmcgui.Dialog().contextmenu(list=options)
if index == 0:
rating = utils.input_userrating()
if rating == -1:
return None
tmdb.set_rating(media_type="tvshow",
media_id=tvshow_id,
rating=rating,
dbid=dbid)
xbmc.sleep(2000)
tmdb.get_tvshow(tvshow_id=tvshow_id,
cache_days=0)
if index == 1:
self.open_credit_dialog(credit_id=credit_id)
示例3: __init__
# 需要导入模块: from resources.lib import TheMovieDB [as 别名]
# 或者: from resources.lib.TheMovieDB import get_tvshow [as 别名]
def __init__(self, *args, **kwargs):
super(DialogEpisodeInfo, self).__init__(*args, **kwargs)
self.tvshow_id = kwargs.get('tvshow_id')
tv_info = tmdb.get_tvshow(self.tvshow_id, light=True)
data = tmdb.extended_episode_info(tvshow_id=self.tvshow_id,
season=kwargs.get('season'),
episode=kwargs.get('episode'))
if not data:
return None
self.info, self.lists, self.states = data
self.info.set_info("tvshowtitle", tv_info["name"])
image_info = imagetools.blur(self.info.get_art("thumb"))
self.info.update_properties(image_info)
示例4: handle_tvshows
# 需要导入模块: from resources.lib import TheMovieDB [as 别名]
# 或者: from resources.lib.TheMovieDB import get_tvshow [as 别名]
def handle_tvshows(results):
shows = ItemList(content_type="tvshows")
for i in results:
item = i["show"] if "show" in i else i
airs = item.get("airs", {})
show = VideoItem(label=item["title"],
path='%sextendedtvinfo&&tvdb_id=%s' % (PLUGIN_BASE, item['ids']["tvdb"]))
show.set_infos({'mediatype': "tvshow",
'title': item["title"],
'duration': item["runtime"] * 60 if item["runtime"] else "",
'year': item["year"],
'premiered': item["first_aired"][:10],
'country': item["country"],
'rating': round(item["rating"], 1),
'votes': item["votes"],
'imdbnumber': item['ids']["imdb"],
'mpaa': item["certification"],
'trailer': item["trailer"],
'status': item.get("status"),
'studio': item["network"],
'genre': " / ".join(item["genres"]),
'plot': item["overview"]})
show.set_properties({'id': item['ids']["tmdb"],
'tvdb_id': item['ids']["tvdb"],
'imdb_id': item['ids']["imdb"],
'trakt_id': item['ids']["trakt"],
'language': item["language"],
'aired_episodes': item["aired_episodes"],
'homepage': item["homepage"],
'airday': airs.get("day"),
'airshorttime': airs.get("time"),
'watchers': item.get("watchers")})
art_info = tmdb.get_tvshow(item["ids"]["tmdb"], light=True)
show.set_artwork(tmdb.get_image_urls(poster=art_info.get("poster_path"),
fanart=art_info.get("backdrop_path")))
shows.append(show)
shows = local_db.merge_with_local(media_type="tvshow",
items=shows,
library_first=False)
shows.set_sorts(["mpaa", "duration"])
return shows
示例5: update_states
# 需要导入模块: from resources.lib import TheMovieDB [as 别名]
# 或者: from resources.lib.TheMovieDB import get_tvshow [as 别名]
def update_states(self):
xbmc.sleep(2000) # delay because MovieDB takes some time to update
info = tmdb.get_tvshow(tvshow_id=self.info.get_property("id"),
cache_days=0)
self.states = info.get("account_states")
super(DialogTVShowInfo, self).update_states()