def get_show_meta(name): tvdb = xbmcaddon.Addon('script.module.metahandler') __cwd__ = xbmc.translatePath(tvdb.getAddonInfo('path')).decode("utf-8") BASE_RESOURCE_PATH = os.path.join(__cwd__, 'lib', 'metahandler') sys.path.append(BASE_RESOURCE_PATH) from thetvdbapi import TheTVDB try: tv = TheTVDB(language='en') split = name.split(" ") if len(split) > 1: name = split[0] + " " + split[1] show_list = tv.get_matching_shows(name, language='all') #print "Searching %s" % (name) if len(show_list) > 0: show_id = show_list[0][0] images = tv.get_show_image_choices(show_id) res = {} for im in images: if 'fanart' in im[1]: res['fanart'] = im[0] if 'poster' in im[1]: res['poster'] = im[0] return res except Exception as e: return None return None
def get_show_meta(name): tvdb = xbmcaddon.Addon('script.module.metahandler') __cwd__ = xbmc.translatePath(tvdb.getAddonInfo('path')).decode("utf-8") BASE_RESOURCE_PATH = os.path.join(__cwd__, 'lib', 'metahandler') sys.path.append(BASE_RESOURCE_PATH) from thetvdbapi import TheTVDB try: tv = TheTVDB(language='en') split = name.split(" ") if len(split) > 1: name = split[0]+" "+split[1] show_list = tv.get_matching_shows(name,language='all') #print "Searching %s" % (name) if len(show_list) > 0: show_id = show_list[0][0] images = tv.get_show_image_choices(show_id) res = {} for im in images: if 'fanart' in im[1]: res['fanart'] = im[0] if 'poster' in im[1]: res['poster'] = im[0] return res except Exception as e: return None return None
def getSeasonPosters(self, tvdb_id, season): tvdb = TheTVDB() images = tvdb.get_show_image_choices(tvdb_id) return images