本文整理匯總了Python中resources.lib.TheMovieDB.get_image_urls方法的典型用法代碼示例。如果您正苦於以下問題:Python TheMovieDB.get_image_urls方法的具體用法?Python TheMovieDB.get_image_urls怎麽用?Python TheMovieDB.get_image_urls使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類resources.lib.TheMovieDB
的用法示例。
在下文中一共展示了TheMovieDB.get_image_urls方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_episodes
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_image_urls [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: handle_tvshows
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_image_urls [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
示例3: handle_movies
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_image_urls [as 別名]
def handle_movies(results):
movies = ItemList(content_type="movies")
path = 'extendedinfo&&id=%s' if addon.bool_setting("infodialog_onclick") else "playtrailer&&id=%s"
for i in results:
item = i["movie"] if "movie" in i else i
trailer = "%syoutubevideo&&id=%s" % (PLUGIN_BASE, utils.extract_youtube_id(item["trailer"]))
movie = VideoItem(label=item["title"],
path=PLUGIN_BASE + path % item["ids"]["tmdb"])
movie.set_infos({'title': item["title"],
'duration': item["runtime"] * 60 if item["runtime"] else "",
'tagline': item["tagline"],
'mediatype': "movie",
'trailer': trailer,
'year': item["year"],
'mpaa': item["certification"],
'plot': item["overview"],
'imdbnumber': item["ids"]["imdb"],
'premiered': item["released"],
'rating': round(item["rating"], 1),
'votes': item["votes"],
'genre': " / ".join(item["genres"])})
movie.set_properties({'id': item["ids"]["tmdb"],
'imdb_id': item["ids"]["imdb"],
'trakt_id': item["ids"]["trakt"],
'watchers': item.get("watchers"),
'language': item.get("language"),
'homepage': item.get("homepage")})
art_info = tmdb.get_movie(item["ids"]["tmdb"], light=True)
movie.set_artwork(tmdb.get_image_urls(poster=art_info.get("poster_path"),
fanart=art_info.get("backdrop_path")))
movies.append(movie)
movies = local_db.merge_with_local(media_type="movie",
items=movies,
library_first=False)
movies.set_sorts(["mpaa", "duration"])
return movies