diff --git a/metadata.tvshows.themoviedb.org.python/addon.xml b/metadata.tvshows.themoviedb.org.python/addon.xml index 151b3788..563db9f4 100644 --- a/metadata.tvshows.themoviedb.org.python/addon.xml +++ b/metadata.tvshows.themoviedb.org.python/addon.xml @@ -1,7 +1,7 @@ @@ -10,10 +10,8 @@ true - 1.6.6 -option to get images in different language than descriptions -support for tv show IDs in TV show folder name -updated YouTube addon URL + 1.7.0 +change method for getting source settings all GPL-3.0-or-later diff --git a/metadata.tvshows.themoviedb.org.python/changelog.txt b/metadata.tvshows.themoviedb.org.python/changelog.txt index cba9daa1..edf23df1 100644 --- a/metadata.tvshows.themoviedb.org.python/changelog.txt +++ b/metadata.tvshows.themoviedb.org.python/changelog.txt @@ -1,3 +1,7 @@ +1.7.0 +change method for getting source settings to account for different sources + in one run having different settings + 1.6.6 option to get images in different language than descriptions support for tv show IDs in TV show folder name diff --git a/metadata.tvshows.themoviedb.org.python/libs/data_utils.py b/metadata.tvshows.themoviedb.org.python/libs/data_utils.py index ffc9105a..374830c4 100644 --- a/metadata.tvshows.themoviedb.org.python/libs/data_utils.py +++ b/metadata.tvshows.themoviedb.org.python/libs/data_utils.py @@ -36,8 +36,10 @@ except ImportError: pass + +SOURCE_SETTINGS = settings.getSourceSettings() TMDB_PARAMS = {'api_key': settings.TMDB_CLOWNCAR, - 'language': settings.LANG_DETAILS} + 'language': SOURCE_SETTINGS["LANG_DETAILS"]} BASE_URL = 'https://api.themoviedb.org/3/{}' FIND_URL = BASE_URL.format('find/{}') TAG_RE = re.compile(r'<[^>]+>') @@ -144,7 +146,7 @@ def _set_rating(the_info, vtag): # type: (InfoType, ListItem) -> None """Set show/episode rating""" first = True - for rating_type in settings.RATING_TYPES: + for rating_type in SOURCE_SETTINGS["RATING_TYPES"]: logger.debug('adding rating type of %s' % rating_type) rating = float(the_info.get('ratings', {}).get( rating_type, {}).get('rating', '0')) @@ -211,7 +213,7 @@ def set_show_artwork(show_info, list_item): fanart_list = [] for image in image_list: theurl, previewurl = get_image_urls(image) - if image.get('iso_639_1') != None and settings.CATLANDSCAPE and theurl: + if image.get('iso_639_1') != None and SOURCE_SETTINGS["CATLANDSCAPE"] and theurl: vtag.addAvailableArtwork( theurl, arttype="landscape", preview=previewurl) elif theurl: @@ -238,7 +240,7 @@ def add_main_show_info(list_item, show_info, full_info=True): """Add main show info to a list item""" vtag = list_item.getVideoInfoTag() original_name = show_info.get('original_name') - if settings.KEEPTITLE and original_name: + if SOURCE_SETTINGS["KEEPTITLE"] and original_name: showname = original_name else: showname = show_info['name'] @@ -259,7 +261,7 @@ def add_main_show_info(list_item, show_info, full_info=True): if full_info: vtag.setTvShowStatus(safe_get(show_info, 'status', '')) vtag.setGenres(_get_names(show_info.get('genres', []))) - if settings.SAVETAGS: + if SOURCE_SETTINGS["SAVETAGS"]: vtag.setTags(_get_names(show_info.get( 'keywords', {}).get('results', []))) networks = show_info.get('networks', []) @@ -269,7 +271,7 @@ def add_main_show_info(list_item, show_info, full_info=True): else: network = None country = None - if network and country and settings.STUDIOCOUNTRY: + if network and country and SOURCE_SETTINGS["STUDIOCOUNTRY"]: vtag.setStudios(['{0} ({1})'.format(network['name'], country)]) elif network: vtag.setStudios([network['name']]) @@ -284,14 +286,14 @@ def add_main_show_info(list_item, show_info, full_info=True): iso = content_rating.get('iso_3166_1', '').lower() if iso == 'us': mpaa_backup = content_rating.get('rating') - if iso == settings.CERT_COUNTRY.lower(): + if iso == SOURCE_SETTINGS["CERT_COUNTRY"].lower(): mpaa = content_rating.get('rating', '') if not mpaa: mpaa = mpaa_backup if mpaa: - vtag.setMpaa(settings.CERT_PREFIX + mpaa) + vtag.setMpaa(SOURCE_SETTINGS["CERT_PREFIX"] + mpaa) vtag.setWriters(_get_credits(show_info)) - if settings.ENABTRAILER: + if SOURCE_SETTINGS["ENABTRAILER"]: trailer = _parse_trailer(show_info.get( 'videos', {}).get('results', {})) if trailer: @@ -427,12 +429,12 @@ def _parse_trailer(results): # type: (Text) -> Text """create a valid Tubed or YouTube plugin trailer URL""" if results: - if settings.PLAYERSOPT == 'tubed': + if SOURCE_SETTINGS["PLAYERSOPT"] == 'tubed': addon_player = 'plugin://plugin.video.tubed/?mode=play&video_id=' - elif settings.PLAYERSOPT == 'youtube': + elif SOURCE_SETTINGS["PLAYERSOPT"] == 'youtube': addon_player = 'plugin://plugin.video.youtube/play/?video_id=' backup_keys = [] - for video_lang in [settings.LANG_DETAILS[0:2], 'en']: + for video_lang in [SOURCE_SETTINGS["LANG_DETAILS"][0:2], 'en']: for result in results: if result.get('site') == 'YouTube' and result.get('iso_639_1') == video_lang: key = result.get('key') diff --git a/metadata.tvshows.themoviedb.org.python/libs/imdbratings.py b/metadata.tvshows.themoviedb.org.python/libs/imdbratings.py index f74f0a45..fa7d008b 100644 --- a/metadata.tvshows.themoviedb.org.python/libs/imdbratings.py +++ b/metadata.tvshows.themoviedb.org.python/libs/imdbratings.py @@ -45,8 +45,9 @@ def get_details(imdb_id): def _get_ratinginfo(imdb_id): # type: (Text) -> Tuple[Text, Text] """get the IMDB ratings details""" + source_settings = settings.getSourceSettings() response = api_utils.load_info(IMDB_RATINGS_URL.format( - imdb_id), default='', resp_type='text', verboselog=settings.VERBOSELOG) + imdb_id), default='', resp_type='text', verboselog=source_settings["VERBOSELOG"]) return _parse_imdb_result(response) diff --git a/metadata.tvshows.themoviedb.org.python/libs/settings.py b/metadata.tvshows.themoviedb.org.python/libs/settings.py index d0dc4ad6..2ddf8cad 100644 --- a/metadata.tvshows.themoviedb.org.python/libs/settings.py +++ b/metadata.tvshows.themoviedb.org.python/libs/settings.py @@ -51,7 +51,60 @@ def _load_base_urls(): return image_root_url, preview_root_url +def getSourceSettings(): + settings = {} + logger.debug('Got settings of: {}'.format(sys.argv[2])) + try: + source_params = dict(urllib.parse.parse_qsl(sys.argv[2])) + except IndexError: + source_params = {} + source_settings = json.loads(source_params.get('pathSettings', '{}')) + settings["KEEPTITLE"] = source_settings.get( + 'keeporiginaltitle', ADDON.getSettingBool('keeporiginaltitle')) + settings["CATLANDSCAPE"] = source_settings.get('cat_landscape', True) + settings["STUDIOCOUNTRY"] = source_settings.get('studio_country', False) + settings["ENABTRAILER"] = source_settings.get( + 'enab_trailer', ADDON.getSettingBool('enab_trailer')) + settings["PLAYERSOPT"] = source_settings.get( + 'players_opt', ADDON.getSettingString('players_opt')).lower() + settings["VERBOSELOG"] = source_settings.get( + 'verboselog', ADDON.getSettingBool('verboselog')) + settings["CERT_COUNTRY"] = source_settings.get( + 'tmdbcertcountry', ADDON.getSettingString('tmdbcertcountry')).lower() + settings["SAVETAGS"] = source_settings.get( + 'keywordsastags', ADDON.getSettingBool('keywordsastags')) + settings["LANG_DETAILS"] = source_settings.get( + 'languageDetails', ADDON.getSettingString('languageDetails')) + if source_settings.get('usedifferentlangforimages', ADDON.getSettingBool('usedifferentlangforimages')): + settings["LANG_IMAGES"] = source_settings.get( + 'languageImages', ADDON.getSettingString('languageImages')) + else: + settings["LANG_IMAGES"] = settings["LANG_DETAILS"] + if source_settings.get('usecertprefix', ADDON.getSettingBool('usecertprefix')): + settings["CERT_PREFIX"] = source_settings.get( + 'certprefix', ADDON.getSettingString('certprefix')) + else: + settings["CERT_PREFIX"] = '' + primary_rating = source_settings.get( + 'ratings', ADDON.getSettingString('ratings')).lower() + RATING_TYPES = [primary_rating] + if source_settings.get('imdbanyway', ADDON.getSettingBool('imdbanyway')) and primary_rating != 'imdb': + RATING_TYPES.append('imdb') + if source_settings.get('traktanyway', ADDON.getSettingBool('traktanyway')) and primary_rating != 'trakt': + RATING_TYPES.append('trakt') + if source_settings.get('tmdbanyway', ADDON.getSettingBool('tmdbanyway')) and primary_rating != 'tmdb': + RATING_TYPES.append('tmdb') + settings["RATING_TYPES"] = RATING_TYPES + settings["FANARTTV_ENABLE"] = source_settings.get( + 'enable_fanarttv', ADDON.getSettingBool('enable_fanarttv')) + settings["FANARTTV_CLIENTKEY"] = source_settings.get( + 'fanarttv_clientkey', ADDON.getSettingString('fanarttv_clientkey')) + logger.debug('Sending back settings of: {}'.format(settings)) + return settings + + ADDON = Addon() +IMAGEROOTURL, PREVIEWROOTURL = _load_base_urls() TMDB_CLOWNCAR = 'af3a53eb387d57fc935e9128468b1899' FANARTTV_CLOWNCAR = 'b018086af0e1478479adfc55634db97d' TRAKT_CLOWNCAR = '90901c6be3b2de5a4fa0edf9ab5c75e9a5a0fef2b4ee7373d8b63dcf61f95697' @@ -69,50 +122,3 @@ def _load_base_urls(): 'seasonbanner': 'seasonbanner', 'seasonthumb': 'seasonlandscape' } - -try: - source_params = dict(urllib.parse.parse_qsl(sys.argv[2])) -except IndexError: - source_params = {} -source_settings = json.loads(source_params.get('pathSettings', '{}')) - -KEEPTITLE = source_settings.get( - 'keeporiginaltitle', ADDON.getSettingBool('keeporiginaltitle')) -CATLANDSCAPE = source_settings.get('cat_landscape', True) -STUDIOCOUNTRY = source_settings.get('studio_country', False) -ENABTRAILER = source_settings.get( - 'enab_trailer', ADDON.getSettingBool('enab_trailer')) -PLAYERSOPT = source_settings.get( - 'players_opt', ADDON.getSettingString('players_opt')).lower() -VERBOSELOG = source_settings.get( - 'verboselog', ADDON.getSettingBool('verboselog')) -CERT_COUNTRY = source_settings.get( - 'tmdbcertcountry', ADDON.getSettingString('tmdbcertcountry')).lower() -SAVETAGS = source_settings.get( - 'keywordsastags', ADDON.getSettingBool('keywordsastags')) -IMAGEROOTURL, PREVIEWROOTURL = _load_base_urls() - -LANG_DETAILS = source_settings.get('languageDetails', ADDON.getSettingString('languageDetails')) -if source_settings.get('usedifferentlangforimages', ADDON.getSettingBool('usedifferentlangforimages')): - LANG_IMAGES = source_settings.get('languageImages', ADDON.getSettingString('languageImages')) -else: - LANG_IMAGES = LANG_DETAILS - -if source_settings.get('usecertprefix', ADDON.getSettingBool('usecertprefix')): - CERT_PREFIX = source_settings.get( - 'certprefix', ADDON.getSettingString('certprefix')) -else: - CERT_PREFIX = '' -primary_rating = source_settings.get( - 'ratings', ADDON.getSettingString('ratings')).lower() -RATING_TYPES = [primary_rating] -if source_settings.get('imdbanyway', ADDON.getSettingBool('imdbanyway')) and primary_rating != 'imdb': - RATING_TYPES.append('imdb') -if source_settings.get('traktanyway', ADDON.getSettingBool('traktanyway')) and primary_rating != 'trakt': - RATING_TYPES.append('trakt') -if source_settings.get('tmdbanyway', ADDON.getSettingBool('tmdbanyway')) and primary_rating != 'tmdb': - RATING_TYPES.append('tmdb') -FANARTTV_ENABLE = source_settings.get( - 'enable_fanarttv', ADDON.getSettingBool('enable_fanarttv')) -FANARTTV_CLIENTKEY = source_settings.get( - 'fanarttv_clientkey', ADDON.getSettingString('fanarttv_clientkey')) diff --git a/metadata.tvshows.themoviedb.org.python/libs/tmdb.py b/metadata.tvshows.themoviedb.org.python/libs/tmdb.py index ffc08966..e1623c73 100644 --- a/metadata.tvshows.themoviedb.org.python/libs/tmdb.py +++ b/metadata.tvshows.themoviedb.org.python/libs/tmdb.py @@ -37,7 +37,7 @@ ) api_utils.set_headers(dict(HEADERS)) -TMDB_PARAMS = {'api_key': settings.TMDB_CLOWNCAR, 'language': settings.LANG_DETAILS} +TMDB_PARAMS = {'api_key': settings.TMDB_CLOWNCAR} BASE_URL = 'https://api.themoviedb.org/3/{}' EPISODE_GROUP_URL = BASE_URL.format('tv/episode_group/{}') SEARCH_URL = BASE_URL.format('search/tv') @@ -47,8 +47,13 @@ EPISODE_URL = BASE_URL.format('tv/{}/season/{}/episode/{}') FANARTTV_URL = 'https://webservice.fanart.tv/v3/tv/{}' FANARTTV_PARAMS = {'api_key': settings.FANARTTV_CLOWNCAR} -if settings.FANARTTV_CLIENTKEY: - FANARTTV_PARAMS['client_key'] = settings.FANARTTV_CLIENTKEY + + +def _get_params(): + source_settings = settings.getSourceSettings() + params = TMDB_PARAMS.copy() + params['language'] = source_settings["LANG_DETAILS"] + return params def search_show(title, year=None): @@ -60,7 +65,8 @@ def search_show(title, year=None): : param year: the year to search (optional) :return: a list with found TV shows """ - params = TMDB_PARAMS.copy() + source_settings = settings.getSourceSettings() + params = _get_params() results = [] ext_media_id = data_utils.parse_media_id(title) if ext_media_id: @@ -78,7 +84,7 @@ def search_show(title, year=None): if year: params['first_air_date_year'] = str(year) resp = api_utils.load_info( - search_url, params=params, verboselog=settings.VERBOSELOG) + search_url, params=params, verboselog=source_settings["VERBOSELOG"]) if resp is not None: if ext_media_id: if ext_media_id['type'] == 'tmdb_id': @@ -99,13 +105,16 @@ def find_by_id(unique_ids): :param unique_ids: dict of external IDs :return: a list with found TV shows """ - supported_ids = ['imdb', 'facebook', 'instagram', 'tvdb', 'tiktok', 'twitter', 'wikidata', 'youtube'] - params = TMDB_PARAMS.copy() + supported_ids = ['imdb', 'facebook', 'instagram', + 'tvdb', 'tiktok', 'twitter', 'wikidata', 'youtube'] + source_settings = settings.getSourceSettings() + params = _get_params() for key, value in unique_ids.items(): if key in supported_ids: params['external_source'] = key + '_id' search_url = FIND_URL.format(value) - resp = api_utils.load_info(search_url, params=params, verboselog=settings.VERBOSELOG) + resp = api_utils.load_info( + search_url, params=params, verboselog=source_settings["VERBOSELOG"]) if resp is not None: return resp.get('tv_results', []) return [] @@ -115,13 +124,14 @@ def load_episode_list(show_info, season_map, ep_grouping): # type: (InfoType, Dict, Text) -> Optional[InfoType] """get the IMDB ratings details""" """Load episode list from themoviedb.org API""" + source_settings = settings.getSourceSettings() episode_list = [] if ep_grouping is not None: logger.debug( 'Getting episodes with episode grouping of ' + ep_grouping) episode_group_url = EPISODE_GROUP_URL.format(ep_grouping) custom_order = api_utils.load_info( - episode_group_url, params=TMDB_PARAMS, verboselog=settings.VERBOSELOG) + episode_group_url, params=TMDB_PARAMS, verboselog=source_settings["VERBOSELOG"]) if custom_order is not None: show_info['seasons'] = [] for custom_season in custom_order.get('groups', []): @@ -166,40 +176,40 @@ def load_show_info(show_id, ep_grouping=None, named_seasons=None): :param named_seasons: the named seasons from the NFO file :return: show info or None """ + source_settings = settings.getSourceSettings() if named_seasons == None: named_seasons = [] show_info = cache.load_show_info_from_cache(show_id) if show_info is None: logger.debug('no cache file found, loading from scratch') show_url = SHOW_URL.format(show_id) - params = TMDB_PARAMS.copy() + params = _get_params() params['append_to_response'] = 'credits,content_ratings,external_ids,images,videos,keywords' - params['include_image_language'] = '%s,en,null' % settings.LANG_IMAGES[0:2] - params['include_video_language'] = '%s,en,null' % settings.LANG_DETAILS[0:2] + params['include_image_language'] = '%s,en,null' % source_settings["LANG_IMAGES"][0:2] show_info = api_utils.load_info( - show_url, params=params, verboselog=settings.VERBOSELOG) + show_url, params=params, verboselog=source_settings["VERBOSELOG"]) if show_info is None: return None - if show_info['overview'] == '' and settings.LANG_DETAILS != 'en-US': + if show_info['overview'] == '' and source_settings["LANG_DETAILS"] != 'en-US': params['language'] = 'en-US' del params['append_to_response'] show_info_backup = api_utils.load_info( - show_url, params=params, verboselog=settings.VERBOSELOG) + show_url, params=params, verboselog=source_settings["VERBOSELOG"]) if show_info_backup is not None: show_info['overview'] = show_info_backup.get('overview', '') - params['language'] = settings.LANG_DETAILS + params['language'] = source_settings["LANG_DETAILS"] season_map = {} params['append_to_response'] = 'credits,images' for season in show_info.get('seasons', []): season_url = SEASON_URL.format( show_id, season.get('season_number', 0)) season_info = api_utils.load_info( - season_url, params=params, default={}, verboselog=settings.VERBOSELOG) - if (season_info.get('overview', '') == '' or season_info.get('name', '').lower().startswith('season')) and settings.LANG_DETAILS != 'en-US': + season_url, params=params, default={}, verboselog=source_settings["VERBOSELOG"]) + if (season_info.get('overview', '') == '' or season_info.get('name', '').lower().startswith('season')) and source_settings["LANG_DETAILS"] != 'en-US': params['language'] = 'en-US' season_info_backup = api_utils.load_info( - season_url, params=params, default={}, verboselog=settings.VERBOSELOG) - params['language'] = settings.LANG_DETAILS + season_url, params=params, default={}, verboselog=source_settings["VERBOSELOG"]) + params['language'] = source_settings["LANG_DETAILS"] if season_info.get('overview', '') == '': season_info['overview'] = season_info_backup.get( 'overview', '') @@ -230,7 +240,7 @@ def load_show_info(show_id, ep_grouping=None, named_seasons=None): cast_check.append(cast_member.get('name', '')) show_info['credits']['cast'] = cast logger.debug('saving show info to the cache') - if settings.VERBOSELOG: + if source_settings["VERBOSELOG"]: logger.debug(format(pformat(show_info))) cache.cache_show_info(show_info) else: @@ -247,6 +257,7 @@ def load_episode_info(show_id, episode_id): :param episode_id: :return: episode info or None """ + source_settings = settings.getSourceSettings() show_info = load_show_info(show_id) if show_info is not None: try: @@ -256,11 +267,11 @@ def load_episode_info(show_id, episode_id): # this ensures we are using the season/ep from the episode grouping if provided ep_url = EPISODE_URL.format( show_info['id'], episode_info['org_seasonnum'], episode_info['org_epnum']) - params = TMDB_PARAMS.copy() + params = _get_params() params['append_to_response'] = 'credits,external_ids,images' - params['include_image_language'] = '%s,en,null' % settings.LANG_IMAGES[0:2] + params['include_image_language'] = '%s,en,null' % source_settings["LANG_IMAGES"][0:2] ep_return = api_utils.load_info( - ep_url, params=params, verboselog=settings.VERBOSELOG) + ep_url, params=params, verboselog=source_settings["VERBOSELOG"]) if ep_return is None: return None bad_return_name = False @@ -274,11 +285,11 @@ def load_episode_info(show_id, episode_id): bad_return_name = True if ep_return.get('overview', '') == '': bad_return_overview = True - if (bad_return_overview or bad_return_name) and settings.LANG_DETAILS != 'en-US': + if (bad_return_overview or bad_return_name) and source_settings["LANG_DETAILS"] != 'en-US': params['language'] = 'en-US' del params['append_to_response'] ep_return_backup = api_utils.load_info( - ep_url, params=params, verboselog=settings.VERBOSELOG) + ep_url, params=params, verboselog=source_settings["VERBOSELOG"]) if ep_return_backup is not None: if bad_return_overview: ep_return['overview'] = ep_return_backup.get( @@ -313,9 +324,10 @@ def load_ratings(the_info, show_imdb_id=''): :param show_imdb_id: show IMDB :return: ratings or empty dict """ + source_settings = settings.getSourceSettings() ratings = {} imdb_id = the_info.get('external_ids', {}).get('imdb_id') - for rating_type in settings.RATING_TYPES: + for rating_type in source_settings["RATING_TYPES"]: logger.debug('setting rating using %s' % rating_type) if rating_type == 'tmdb': ratings['tmdb'] = {'votes': the_info['vote_count'], @@ -347,11 +359,15 @@ def load_fanarttv_art(show_info): :param show_info: the current show info :return: show info """ + source_settings = settings.getSourceSettings() + if source_settings["FANARTTV_CLIENTKEY"]: + FANARTTV_PARAMS['client_key'] = source_settings["FANARTTV_CLIENTKEY"] + tvdb_id = show_info.get('external_ids', {}).get('tvdb_id') - if tvdb_id and settings.FANARTTV_ENABLE: + if tvdb_id and source_settings["FANARTTV_ENABLE"]: fanarttv_url = FANARTTV_URL.format(tvdb_id) artwork = api_utils.load_info( - fanarttv_url, params=FANARTTV_PARAMS, verboselog=settings.VERBOSELOG) + fanarttv_url, params=FANARTTV_PARAMS, verboselog=source_settings["VERBOSELOG"]) if artwork is None: return show_info for fanarttv_type, tmdb_type in settings.FANARTTV_MAPPING.items(): @@ -362,7 +378,7 @@ def load_fanarttv_art(show_info): if lang == '' or lang == '00': lang = None filepath = '' - if lang is None or lang == settings.LANG_DETAILS[0:2] or lang == 'en': + if lang is None or lang == source_settings["LANG_DETAILS"][0:2] or lang == 'en': filepath = item.get('url') if filepath: if tmdb_type.startswith('season'): @@ -462,13 +478,14 @@ def _image_sort(images, image_type): :param image_type: :return: list of images """ + source_settings = settings.getSourceSettings() lang_pref = [] lang_null = [] lang_en = [] firstimage = True for image in images: image_lang = image.get('iso_639_1') - if image_lang == settings.LANG_DETAILS[0:2]: + if image_lang == source_settings["LANG_DETAILS"][0:2]: lang_pref.append(image) elif image_lang == 'en': lang_en.append(image) diff --git a/metadata.tvshows.themoviedb.org.python/libs/traktratings.py b/metadata.tvshows.themoviedb.org.python/libs/traktratings.py index 48091b55..707cefb9 100644 --- a/metadata.tvshows.themoviedb.org.python/libs/traktratings.py +++ b/metadata.tvshows.themoviedb.org.python/libs/traktratings.py @@ -26,7 +26,6 @@ except ImportError: pass - HEADERS = ( ('User-Agent', 'Kodi TV Show scraper by Team Kodi; contact pkscout@kodi.tv'), ('Accept', 'application/json'), @@ -50,6 +49,7 @@ def get_details(imdb_id, season=None, episode=None): :param episode: :return: trackt ratings """ + source_settings = settings.getSourceSettings() result = {} if season and episode: url = EP_URL.format(imdb_id, season, episode) @@ -58,7 +58,7 @@ def get_details(imdb_id, season=None, episode=None): url = SHOW_URL.format(imdb_id) params = {'extended': 'full'} resp = api_utils.load_info( - url, params=params, default={}, verboselog=settings.VERBOSELOG) + url, params=params, default={}, verboselog=source_settings["VERBOSELOG"]) rating = resp.get('rating') votes = resp.get('votes') if votes and rating: