Repository: pymedusa/Medusa

Issue:
Medusa doesn't download show season poster & banners
**Describe the bug**
Force full update of the show.

**Expected behavior**
Download missing artwork: seasonxx-poster.jpg and seasonxx-banner.jpg
Expected to download season08-poster.jpg and season08-banner.jpg (images seems to be available in the list of images available in debug log: f.e. https://www.thetvdb.com/banners/series/257655/seasons/815984/posters/5ffa63f5c20eb_t.jpg)

**Medusa (please complete the following information):**
 - OS: Windows
 - Branch: master
 - Commit: 1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
 - Python version:  3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]
 - Database version:  44.18

**Debug logs (at least 50 lines):**

[debug.log](https://github.com/pymedusa/Medusa/files/7825193/debug.log)




Discussion:
I can check for the season posters.
But I didn't get any seasonwide's (banners) for arrow from the api.
I actually only checked if there were posters on the api (I did not check it for banners).
I assumed that if it was not coming for posters, it would probably also be for banners. 😊 
So to confirm, I only check for posters, and it was available, but not being downloaded.

Resolving patch:
diff --git a/medusa/metadata/generic.py b/medusa/metadata/generic.py
--- a/medusa/metadata/generic.py
+++ b/medusa/metadata/generic.py
@@ -63,14 +63,14 @@ def __init__(self, show_metadata=False, episode_metadata=False, fanart=False,
                  season_posters=False, season_banners=False,
                  season_all_poster=False, season_all_banner=False, overwrite_nfo=False):
 
-        self.name = u'Generic'
-        self._ep_nfo_extension = u'nfo'
-        self._show_metadata_filename = u'tvshow.nfo'
-        self.fanart_name = u'fanart.jpg'
-        self.poster_name = u'poster.jpg'
-        self.banner_name = u'banner.jpg'
-        self.season_all_poster_name = u'season-all-poster.jpg'
-        self.season_all_banner_name = u'season-all-banner.jpg'
+        self.name = 'Generic'
+        self._ep_nfo_extension = 'nfo'
+        self._show_metadata_filename = 'tvshow.nfo'
+        self.fanart_name = 'fanart.jpg'
+        self.poster_name = 'poster.jpg'
+        self.banner_name = 'banner.jpg'
+        self.season_all_poster_name = 'season-all-poster.jpg'
+        self.season_all_banner_name = 'season-all-banner.jpg'
         self.show_metadata = show_metadata
         self.episode_metadata = episode_metadata
         self.fanart = fanart
@@ -102,7 +102,7 @@ def get_config(self):
         config_list = [self.show_metadata, self.episode_metadata, self.fanart, self.poster, self.banner,
                        self.episode_thumbnails, self.season_posters, self.season_banners, self.season_all_poster,
                        self.season_all_banner, self.overwrite_nfo]
-        return u'|'.join([str(int(x)) for x in config_list])
+        return '|'.join([str(int(x)) for x in config_list])
 
     def get_id(self):
         return GenericMetadata.makeID(self.name)
@@ -131,8 +131,8 @@ def set_config(self, provider_options):
     def _check_exists(location):
         if location:
             result = os.path.isfile(location)
-            log.debug(u'Checking if {location} exists: {result}',
-                      {u'location': location, u'result': result})
+            log.debug('Checking if {location} exists: {result}',
+                      {'location': location, 'result': result})
             return result
         return False
 
@@ -222,11 +222,11 @@ def get_season_poster_path(show_obj, season):
         """
         # Our specials thumbnail is, well, special
         if season == 0:
-            season_poster_filename = u'season-specials'
+            season_poster_filename = 'season-specials'
         else:
-            season_poster_filename = u'season' + str(season).zfill(2)
+            season_poster_filename = 'season' + str(season).zfill(2)
 
-        return os.path.join(show_obj.validate_location, season_poster_filename + u'-poster.jpg')
+        return os.path.join(show_obj.validate_location, season_poster_filename + '-poster.jpg')
 
     @staticmethod
     def get_season_banner_path(show_obj, season):
@@ -239,11 +239,11 @@ def get_season_banner_path(show_obj, season):
         """
         # Our specials thumbnail is, well, special
         if season == 0:
-            season_banner_filename = u'season-specials'
+            season_banner_filename = 'season-specials'
         else:
-            season_banner_filename = u'season' + str(season).zfill(2)
+            season_banner_filename = 'season' + str(season).zfill(2)
 
-        return os.path.join(show_obj.validate_location, season_banner_filename + u'-banner.jpg')
+        return os.path.join(show_obj.validate_location, season_banner_filename + '-banner.jpg')
 
     def get_season_all_poster_path(self, show_obj):
         return os.path.join(show_obj.validate_location, self.season_all_poster_name)
@@ -270,8 +270,8 @@ def _ep_data(self, ep_obj):
     def create_show_metadata(self, show_obj):
         if self.show_metadata and show_obj and (not self._has_show_metadata(show_obj) or self.overwrite_nfo):
             log.debug(
-                u'Metadata provider {name} creating series metadata for {series}',
-                {u'name': self.name, u'series': show_obj.name}
+                'Metadata provider {name} creating series metadata for {series}',
+                {'name': self.name, 'series': show_obj.name}
             )
             return self.write_show_file(show_obj)
         return False
@@ -279,8 +279,8 @@ def create_show_metadata(self, show_obj):
     def create_episode_metadata(self, ep_obj):
         if self.episode_metadata and ep_obj and (not self.has_episode_metadata(ep_obj) or self.overwrite_nfo):
             log.debug(
-                u'Metadata provider {name} creating episode metadata for {episode}',
-                {u'name': self.name, u'episode': ep_obj.pretty_name()}
+                'Metadata provider {name} creating episode metadata for {episode}',
+                {'name': self.name, 'episode': ep_obj.pretty_name()}
             )
             return self.write_ep_file(ep_obj)
         return False
@@ -288,53 +288,53 @@ def create_episode_metadata(self, ep_obj):
     def update_show_indexer_metadata(self, show_obj):
         if self.show_metadata and show_obj and self._has_show_metadata(show_obj):
             log.debug(
-                u'Metadata provider {name} updating series indexer info metadata file for {series}',
-                {u'name': self.name, u'series': show_obj.name}
+                'Metadata provider {name} updating series indexer info metadata file for {series}',
+                {'name': self.name, 'series': show_obj.name}
             )
 
             nfo_file_path = self.get_show_file_path(show_obj)
 
             try:
-                with io.open(nfo_file_path, u'rb') as xmlFileObj:
+                with io.open(nfo_file_path, 'rb') as xmlFileObj:
                     showXML = etree.ElementTree(file=xmlFileObj)
 
-                indexerid = showXML.find(u'id')
+                indexerid = showXML.find('id')
 
                 root = showXML.getroot()
                 if indexerid is not None:
                     indexerid.text = str(show_obj.indexerid)
                 else:
-                    etree.SubElement(root, u'id').text = str(show_obj.indexerid)
+                    etree.SubElement(root, 'id').text = str(show_obj.indexerid)
 
                 # Make it purdy
                 helpers.indent_xml(root)
 
-                showXML.write(nfo_file_path, encoding=u'UTF-8')
+                showXML.write(nfo_file_path, encoding='UTF-8')
                 helpers.chmod_as_parent(nfo_file_path)
 
                 return True
             except etree.ParseError as error:
                 log.warning(
-                    u'Received an invalid XML for {series}, try again later. Error: {error}',
-                    {u'series': show_obj.name, u'error': error}
+                    'Received an invalid XML for {series}, try again later. Error: {error}',
+                    {'series': show_obj.name, 'error': error}
                 )
             except IOError as error:
                 if error.errno == errno.EACCES:
                     log.warning(
-                        u'Unable to write metadata file to {location} - verify that the path is writeable',
-                        {u'location': nfo_file_path}
+                        'Unable to write metadata file to {location} - verify that the path is writeable',
+                        {'location': nfo_file_path}
                     )
                 else:
                     log.error(
-                        u'Unable to write metadata file to {location}. Error: {error!r}',
-                        {u'location': nfo_file_path, u'error': error}
+                        'Unable to write metadata file to {location}. Error: {error!r}',
+                        {'location': nfo_file_path, 'error': error}
                     )
 
     def create_fanart(self, show_obj):
         if self.fanart and show_obj and not self._has_fanart(show_obj):
             log.debug(
-                u'Metadata provider {name} creating fanart for {series}',
-                {u'name': self.name, u'series': show_obj.name}
+                'Metadata provider {name} creating fanart for {series}',
+                {'name': self.name, 'series': show_obj.name}
             )
             return self.save_fanart(show_obj)
         return False
@@ -342,8 +342,8 @@ def create_fanart(self, show_obj):
     def create_poster(self, show_obj):
         if self.poster and show_obj and not self._has_poster(show_obj):
             log.debug(
-                u'Metadata provider {name} creating poster for {series}',
-                {u'name': self.name, u'series': show_obj.name}
+                'Metadata provider {name} creating poster for {series}',
+                {'name': self.name, 'series': show_obj.name}
             )
             return self.save_poster(show_obj)
         return False
@@ -351,8 +351,8 @@ def create_poster(self, show_obj):
     def create_banner(self, show_obj):
         if self.banner and show_obj and not self._has_banner(show_obj):
             log.debug(
-                u'Metadata provider {name} creating banner for {series}',
-                {u'name': self.name, u'series': show_obj.name}
+                'Metadata provider {name} creating banner for {series}',
+                {'name': self.name, 'series': show_obj.name}
             )
             return self.save_banner(show_obj)
         return False
@@ -360,8 +360,8 @@ def create_banner(self, show_obj):
     def create_episode_thumb(self, ep_obj):
         if self.episode_thumbnails and ep_obj and not self.has_episode_thumb(ep_obj):
             log.debug(
-                u'Metadata provider {name} creating episode thumbnail for {episode}',
-                {u'name': self.name, u'episode': ep_obj.pretty_name()}
+                'Metadata provider {name} creating episode thumbnail for {episode}',
+                {'name': self.name, 'episode': ep_obj.pretty_name()}
             )
             if self.indexer_api:
                 ep_obj.set_indexer_data(season=ep_obj.season, indexer_api=self.indexer_api)
@@ -374,8 +374,8 @@ def create_season_posters(self, show_obj):
             for season in iterkeys(show_obj.episodes):
                 if not self._has_season_poster(show_obj, season):
                     log.debug(
-                        u'Metadata provider {name} creating season posters for {series}',
-                        {u'name': self.name, u'series': show_obj.name}
+                        'Metadata provider {name} creating season posters for {series}',
+                        {'name': self.name, 'series': show_obj.name}
                     )
                     result.append(self.save_season_posters(show_obj, season))
             return all(result)
@@ -385,8 +385,8 @@ def create_season_banners(self, show_obj):
         if self.season_banners and show_obj:
             result = []
             log.debug(
-                u'Metadata provider {name} creating season banners for {series}',
-                {u'name': self.name, u'series': show_obj.name}
+                'Metadata provider {name} creating season banners for {series}',
+                {'name': self.name, 'series': show_obj.name}
             )
             for season in iterkeys(show_obj.episodes):  # @UnusedVariable
                 if not self._has_season_banner(show_obj, season):
@@ -397,8 +397,8 @@ def create_season_banners(self, show_obj):
     def create_season_all_poster(self, show_obj):
         if self.season_all_poster and show_obj and not self._has_season_all_poster(show_obj):
             log.debug(
-                u'Metadata provider {name} creating season all poster for {series}',
-                {u'name': self.name, u'series': show_obj.name}
+                'Metadata provider {name} creating season all poster for {series}',
+                {'name': self.name, 'series': show_obj.name}
             )
             return self.save_season_all_poster(show_obj)
         return False
@@ -406,8 +406,8 @@ def create_season_all_poster(self, show_obj):
     def create_season_all_banner(self, show_obj):
         if self.season_all_banner and show_obj and not self._has_season_all_banner(show_obj):
             log.debug(
-                u'Metadata provider {name} creating season all banner for {series}',
-                {u'name': self.name, u'series': show_obj.name}
+                'Metadata provider {name} creating season all banner for {series}',
+                {'name': self.name, 'series': show_obj.name}
             )
             return self.save_season_all_banner(show_obj)
         return False
@@ -426,7 +426,7 @@ def _get_episode_thumb_url(self, indexer_series, episode):
             try:
                 indexer_episode = indexer_series[ep.season][ep.episode]
             except (IndexerEpisodeNotFound, IndexerSeasonNotFound) as error:
-                log.debug(u'Unable to find season or episode. Reason: {0!r}', error)
+                log.debug('Unable to find season or episode. Reason: {0!r}', error)
                 continue
 
             thumb_url = getattr(indexer_episode, 'filename', None)
@@ -457,20 +457,20 @@ def write_show_file(self, show_obj):
 
         try:
             if not os.path.isdir(nfo_file_dir):
-                log.debug(u'Metadata directory missing, creating it at {location}',
-                          {u'location': nfo_file_dir})
+                log.debug('Metadata directory missing, creating it at {location}',
+                          {'location': nfo_file_dir})
                 os.makedirs(nfo_file_dir)
                 helpers.chmod_as_parent(nfo_file_dir)
 
-            log.debug(u'Writing show nfo file to {location}',
-                      {u'location': nfo_file_path})
+            log.debug('Writing show nfo file to {location}',
+                      {'location': nfo_file_path})
 
-            nfo_file = io.open(nfo_file_path, u'wb')
-            data.write(nfo_file, encoding=u'UTF-8')
+            nfo_file = io.open(nfo_file_path, 'wb')
+            data.write(nfo_file, encoding='UTF-8')
             nfo_file.close()
             helpers.chmod_as_parent(nfo_file_path)
         except IOError as e:
-            exception_handler.handle(e, u'Unable to write file to {location}', location=nfo_file_path)
+            exception_handler.handle(e, 'Unable to write file to {location}', location=nfo_file_path)
             return False
 
         return True
@@ -500,24 +500,24 @@ def write_ep_file(self, ep_obj):
         nfo_file_dir = os.path.dirname(nfo_file_path)
 
         if not (nfo_file_path and nfo_file_dir):
-            log.debug(u'Unable to write episode nfo file because episode location is missing.')
+            log.debug('Unable to write episode nfo file because episode location is missing.')
             return False
 
         try:
             if not os.path.isdir(nfo_file_dir):
-                log.debug(u'Metadata directory missing, creating it at {location}',
-                          {u'location': nfo_file_dir})
+                log.debug('Metadata directory missing, creating it at {location}',
+                          {'location': nfo_file_dir})
                 os.makedirs(nfo_file_dir)
                 helpers.chmod_as_parent(nfo_file_dir)
 
-            log.debug(u'Writing episode nfo file to {location}',
-                      {u'location': nfo_file_path})
-            nfo_file = io.open(nfo_file_path, u'wb')
-            data.write(nfo_file, encoding=u'UTF-8')
+            log.debug('Writing episode nfo file to {location}',
+                      {'location': nfo_file_path})
+            nfo_file = io.open(nfo_file_path, 'wb')
+            data.write(nfo_file, encoding='UTF-8')
             nfo_file.close()
             helpers.chmod_as_parent(nfo_file_path)
         except IOError as e:
-            exception_handler.handle(e, u'Unable to write file to {location}', location=nfo_file_path)
+            exception_handler.handle(e, 'Unable to write file to {location}', location=nfo_file_path)
             return False
 
         return True
@@ -532,12 +532,12 @@ def save_thumbnail(self, ep_obj):
         """
         thumb_path = self.get_episode_thumb_path(ep_obj)
         if not thumb_path:
-            log.debug(u'Unable to find a file path to use for this thumbnail, not generating it')
+            log.debug('Unable to find a file path to use for this thumbnail, not generating it')
             return False
 
-        thumb_data = self._retrieve_show_image(u'thumbnail', ep_obj.series, ep_obj)
+        thumb_data = self._retrieve_show_image('thumbnail', ep_obj.series, ep_obj)
         if not thumb_data:
-            log.debug(u'No thumb is available for this episode, not creating a thumbnail')
+            log.debug('No thumb is available for this episode, not creating a thumbnail')
             return False
 
         result = self._write_image(thumb_data, thumb_path)
@@ -559,10 +559,10 @@ def save_fanart(self, show_obj, which=None):
         # use the default fanart name
         fanart_path = self.get_fanart_path(show_obj)
 
-        fanart_data = self._retrieve_show_image(u'fanart', show_obj, which=which)
+        fanart_data = self._retrieve_show_image('fanart', show_obj, which=which)
 
         if not fanart_data:
-            log.debug(u'No fanart image was retrieved, unable to write fanart')
+            log.debug('No fanart image was retrieved, unable to write fanart')
             return False
 
         return self._write_image(fanart_data, fanart_path)
@@ -577,10 +577,10 @@ def save_poster(self, show_obj, which=None):
         # use the default poster name
         poster_path = self.get_poster_path(show_obj)
 
-        poster_data = self._retrieve_show_image(u'poster', show_obj, which=which)
+        poster_data = self._retrieve_show_image('poster', show_obj, which=which)
 
         if not poster_data:
-            log.debug(u'No show poster image was retrieved, unable to write poster')
+            log.debug('No show poster image was retrieved, unable to write poster')
             return False
 
         return self._write_image(poster_data, poster_path)
@@ -595,10 +595,10 @@ def save_banner(self, show_obj, which=None):
         # use the default banner name
         banner_path = self.get_banner_path(show_obj)
 
-        banner_data = self._retrieve_show_image(u'banner', show_obj, which=which)
+        banner_data = self._retrieve_show_image('banner', show_obj, which=which)
 
         if not banner_data:
-            log.debug(u'No show banner image was retrieved, unable to write banner')
+            log.debug('No show banner image was retrieved, unable to write banner')
             return False
 
         return self._write_image(banner_data, banner_path)
@@ -633,15 +633,15 @@ def save_season_posters(self, show_obj, season):
 
             if not season_poster_file_path:
                 log.debug(
-                    u'Path for season {number} came back blank, skipping this season',
-                    {u'number': cur_season}
+                    'Path for season {number} came back blank, skipping this season',
+                    {'number': cur_season}
                 )
                 continue
 
             seasonData = get_image(season_url)
 
             if not seasonData:
-                log.debug(u'No season poster data available, skipping this season')
+                log.debug('No season poster data available, skipping this season')
                 continue
 
             result += [self._write_image(seasonData, season_poster_file_path)]
@@ -681,15 +681,15 @@ def save_season_banners(self, show_obj, season):
 
             if not season_banner_file_path:
                 log.debug(
-                    u'Path for season {number} came back blank, skipping this season',
-                    {u'number': cur_season}
+                    'Path for season {number} came back blank, skipping this season',
+                    {'number': cur_season}
                 )
                 continue
 
             seasonData = get_image(season_url)
 
             if not seasonData:
-                log.debug(u'No season banner data available, skipping this season')
+                log.debug('No season banner data available, skipping this season')
                 continue
 
             result += [self._write_image(seasonData, season_banner_file_path)]
@@ -703,10 +703,10 @@ def save_season_all_poster(self, show_obj, which=None):
         # use the default season all poster name
         poster_path = self.get_season_all_poster_path(show_obj)
 
-        poster_data = self._retrieve_show_image(u'poster', show_obj, which=which)
+        poster_data = self._retrieve_show_image('poster', show_obj, which=which)
 
         if not poster_data:
-            log.debug(u'No show poster image was retrieved, unable to write season all poster')
+            log.debug('No show poster image was retrieved, unable to write season all poster')
             return False
 
         return self._write_image(poster_data, poster_path)
@@ -715,10 +715,10 @@ def save_season_all_banner(self, show_obj, which=None):
         # use the default season all banner name
         banner_path = self.get_season_all_banner_path(show_obj)
 
-        banner_data = self._retrieve_show_image(u'banner', show_obj, which=which)
+        banner_data = self._retrieve_show_image('banner', show_obj, which=which)
 
         if not banner_data:
-            log.debug(u'No show banner image was retrieved, unable to write season all banner')
+            log.debug('No show banner image was retrieved, unable to write season all banner')
             return False
 
         return self._write_image(banner_data, banner_path)
@@ -733,29 +733,29 @@ def _write_image(self, image_data, image_path, obj=None):
         """
         # don't bother overwriting it
         if os.path.isfile(image_path):
-            log.debug(u'Image already exists, not downloading')
+            log.debug('Image already exists, not downloading')
             return False
 
         image_dir = os.path.dirname(image_path)
 
         if not image_data:
-            log.debug(u'Unable to retrieve image to save in {location}, skipping',
-                      {u'location': image_path})
+            log.debug('Unable to retrieve image to save in {location}, skipping',
+                      {'location': image_path})
             return False
 
         try:
             if not os.path.isdir(image_dir):
-                log.debug(u'Metadata directory missing, creating it at {location}',
-                          {u'location': image_path})
+                log.debug('Metadata directory missing, creating it at {location}',
+                          {'location': image_path})
                 os.makedirs(image_dir)
                 helpers.chmod_as_parent(image_dir)
 
-            outFile = io.open(image_path, u'wb')
+            outFile = io.open(image_path, 'wb')
             outFile.write(image_data)
             outFile.close()
             helpers.chmod_as_parent(image_path)
         except IOError as e:
-            exception_handler.handle(e, u'Unable to write image to {location}', location=image_path)
+            exception_handler.handle(e, 'Unable to write image to {location}', location=image_path)
             return False
 
         return True
@@ -776,33 +776,33 @@ def _retrieve_show_image(self, image_type, show_obj, episode=None, which=None):
         if not indexer_show_obj:
             return None
 
-        if image_type not in (u'fanart', u'poster', u'banner', u'thumbnail', u'poster_thumb', u'banner_thumb'):
+        if image_type not in ('fanart', 'poster', 'banner', 'thumbnail', 'poster_thumb', 'banner_thumb'):
             log.error(
-                u'Invalid {image}, unable to find it in the {indexer}',
-                {u'image': image_type, u'indexer': show_obj.indexer_name}
+                'Invalid {image}, unable to find it in the {indexer}',
+                {'image': image_type, 'indexer': show_obj.indexer_name}
             )
             return None
 
-        if image_type == u'thumbnail' and episode:
+        if image_type == 'thumbnail' and episode:
             image_url = self._get_episode_thumb_url(indexer_show_obj, episode)
 
-        elif image_type == u'poster_thumb':
-            if getattr(indexer_show_obj, u'poster', None):
+        elif image_type == 'poster_thumb':
+            if getattr(indexer_show_obj, 'poster', None):
                 if show_obj.indexer == INDEXER_TVDBV2:
-                    image_url = indexer_show_obj[u'poster'].replace('.jpg', '_t.jpg')
+                    image_url = indexer_show_obj['poster'].replace('.jpg', '_t.jpg')
                 else:
-                    image_url = re.sub(u'posters', u'_cache/posters', indexer_show_obj[u'poster'])
+                    image_url = re.sub('posters', '_cache/posters', indexer_show_obj['poster'])
 
             if not image_url:
                 # Try and get images from TMDB
                 image_url = self._retrieve_show_images_from_tmdb(show_obj, image_type)
 
-        elif image_type == u'banner_thumb':
-            if getattr(indexer_show_obj, u'banner', None):
+        elif image_type == 'banner_thumb':
+            if getattr(indexer_show_obj, 'banner', None):
                 if show_obj.indexer == INDEXER_TVDBV2:
-                    image_url = indexer_show_obj[u'banner'].replace('.jpg', '_t.jpg')
+                    image_url = indexer_show_obj['banner'].replace('.jpg', '_t.jpg')
                 else:
-                    image_url = re.sub(u'graphical', u'_cache/graphical', indexer_show_obj[u'banner'])
+                    image_url = re.sub('graphical', '_cache/graphical', indexer_show_obj['banner'])
         else:
             if getattr(indexer_show_obj, image_type, None):
                 image_url = indexer_show_obj[image_type]
@@ -819,6 +819,8 @@ def _retrieve_show_image(self, image_type, show_obj, episode=None, which=None):
 
     def _season_posters_dict(self, show_obj, season):
         """
+        Return a dict of season numbers.
+
         Should return a dict like:
 
         result = {<season number>:
@@ -830,33 +832,39 @@ def _season_posters_dict(self, show_obj, season):
         indexer_show_obj = self._get_show_data(show_obj)
 
         # if we have no season banners then just finish
-        if not getattr(indexer_show_obj, u'_banners', None):
+        if not getattr(indexer_show_obj, '_banners', None):
+            return result
+
+        if 'season' not in indexer_show_obj['_banners']:
             return result
 
-        if (u'season' not in indexer_show_obj[u'_banners'] or
-                u'original' not in indexer_show_obj[u'_banners'][u'season'] or
-                season not in indexer_show_obj[u'_banners'][u'season'][u'original']):
+        resolutions = [res for res in indexer_show_obj['_banners']['season']]
+        if not resolutions:
+            return result
+
+        if season not in indexer_show_obj['_banners']['season'][resolutions[0]]:
             return result
 
         # Give us just the normal poster-style season graphics
-        season_art_obj = indexer_show_obj[u'_banners'][u'season']
+        season_art_obj = indexer_show_obj['_banners']['season']
 
         # Returns a nested dictionary of season art with the season
         # number as primary key. It's really overkill but gives the option
         # to present to user via ui to pick down the road.
 
         # find the correct season in the TVDB object and just copy the dict into our result dict
-        for season_art_id in season_art_obj[u'original'][season]:
+        for season_art_id in season_art_obj[resolutions[0]][season]:
             if season not in result:
                 result[season] = {}
-            result[season][season_art_id] = season_art_obj[u'original'][season][season_art_id][u'_bannerpath']
+            result[season][season_art_id] = season_art_obj[resolutions[0]][season][season_art_id]['_bannerpath']
 
         return result
 
     def _season_banners_dict(self, show_obj, season):
         """
-        Should return a dict like:
+        Return a season banner dict.
 
+        Should return a dict like:
         result = {<season number>:
                     {1: '<url 1>', 2: <url 2>, ...},}
         """
@@ -866,26 +874,31 @@ def _season_banners_dict(self, show_obj, season):
         indexer_show_obj = self._get_show_data(show_obj)
 
         # if we have no seasonwide banners then just finish
-        if not getattr(indexer_show_obj, u'_banners', None):
+        if not getattr(indexer_show_obj, '_banners', None):
+            return result
+
+        if 'seasonwide' not in indexer_show_obj['_banners']:
+            return result
+
+        resolutions = [res for res in indexer_show_obj['_banners']['seasonwide']]
+        if not resolutions:
             return result
 
-        if (u'seasonwide' not in indexer_show_obj[u'_banners'] or
-                u'original' not in indexer_show_obj[u'_banners'][u'seasonwide'] or
-                season not in indexer_show_obj[u'_banners'][u'seasonwide'][u'original']):
+        if season not in indexer_show_obj['_banners']['seasonwide'][resolutions[0]]:
             return result
 
         # Give us just the normal poster-style season graphics
-        season_art_obj = indexer_show_obj[u'_banners'][u'seasonwide']
+        season_art_obj = indexer_show_obj['_banners']['seasonwide']
 
         # Returns a nested dictionary of season art with the season
         # number as primary key. It's really overkill but gives the option
         # to present to user via ui to pick down the road.
 
         # find the correct season in the TVDB object and just copy the dict into our result dict
-        for season_art_id in season_art_obj[u'original'][season]:
+        for season_art_id in season_art_obj[resolutions[0]][season]:
             if season not in result:
                 result[season] = {}
-            result[season][season_art_id] = season_art_obj[u'original'][season][season_art_id][u'_bannerpath']
+            result[season][season_art_id] = season_art_obj[resolutions[0]][season][season_art_id]['_bannerpath']
 
         return result
 
@@ -902,31 +915,31 @@ def _get_show_data(self, series_obj):
         series_id = series_obj.series_id
 
         try:
-            if not (series_obj.indexer_api and all([series_obj.indexer_api.config[u'banners_enabled'],
-                                                    series_obj.indexer_api.config[u'actors_enabled']])):
+            if not (series_obj.indexer_api and all([series_obj.indexer_api.config['banners_enabled'],
+                                                    series_obj.indexer_api.config['actors_enabled']])):
                 series_obj.create_indexer(banners=True, actors=True)
 
             self.indexer_api = series_obj.indexer_api
             my_show = self.indexer_api[int(series_id)]
         except IndexerShowNotFound:
             log.warning(
-                u'Unable to find {indexer} show {id}, skipping it',
-                {u'indexer': series_obj.indexer_name, u'id': series_id}
+                'Unable to find {indexer} show {id}, skipping it',
+                {'indexer': series_obj.indexer_name, 'id': series_id}
             )
             return False
 
         except (IndexerException, RequestException):
             log.warning(
-                u'{indexer} is down, cannot use its data to add this show',
-                {u'indexer': series_obj.indexer_name}
+                '{indexer} is down, cannot use its data to add this show',
+                {'indexer': series_obj.indexer_name}
             )
             return False
 
         # check for title and id
-        if not (getattr(my_show, u'seriesname', None) and getattr(my_show, u'id', None)):
+        if not (getattr(my_show, 'seriesname', None) and getattr(my_show, 'id', None)):
             log.warning(
-                u'Incomplete info for {indexer} show {id}, skipping it',
-                {u'indexer': series_obj.indexer_name, u'id': series_id}
+                'Incomplete info for {indexer} show {id}, skipping it',
+                {'indexer': series_obj.indexer_name, 'id': series_id}
             )
             return False
 
@@ -943,62 +956,62 @@ def retrieveShowMetadata(self, folder):
 
         if not os.path.isdir(folder) or not os.path.isfile(metadata_path):
             log.debug(
-                u'Cannot load the {name} metadata file from {location}, it does not exist',
-                {u'name': self.name, u'location': metadata_path}
+                'Cannot load the {name} metadata file from {location}, it does not exist',
+                {'name': self.name, 'location': metadata_path}
             )
             return empty_return
 
-        log.debug(u'Loading show info from {name} metadata file in {location}',
-                  {u'name': self.name, u'location': folder})
+        log.debug('Loading show info from {name} metadata file in {location}',
+                  {'name': self.name, 'location': folder})
 
         try:
-            with io.open(metadata_path, u'rb') as xmlFileObj:
+            with io.open(metadata_path, 'rb') as xmlFileObj:
                 showXML = etree.ElementTree(file=xmlFileObj)
 
-            if (showXML.findtext(u'title') is None or
-                    (showXML.findtext(u'tvdbid') is None and showXML.findtext(u'id') is None)):
+            if (showXML.findtext('title') is None or
+                    (showXML.findtext('tvdbid') is None and showXML.findtext('id') is None)):
                 log.debug(
-                    u'Invalid info in tvshow.nfo (missing name or id): {0} {1} {2}',
-                    showXML.findtext(u'title'), showXML.findtext(u'tvdbid'), showXML.findtext(u'id'),
+                    'Invalid info in tvshow.nfo (missing name or id): {0} {1} {2}',
+                    showXML.findtext('title'), showXML.findtext('tvdbid'), showXML.findtext('id'),
                 )
                 return empty_return
 
-            name = showXML.findtext(u'title')
+            name = showXML.findtext('title')
 
-            if showXML.findtext(u'tvdbid'):
-                indexer_id = int(showXML.findtext(u'tvdbid'))
-            elif showXML.findtext(u'id'):
-                indexer_id = int(showXML.findtext(u'id'))
+            if showXML.findtext('tvdbid'):
+                indexer_id = int(showXML.findtext('tvdbid'))
+            elif showXML.findtext('id'):
+                indexer_id = int(showXML.findtext('id'))
             else:
-                log.warning(u'Empty <id> or <tvdbid> field in NFO, unable to find a ID')
+                log.warning('Empty <id> or <tvdbid> field in NFO, unable to find a ID')
                 return empty_return
 
             if indexer_id is None:
-                log.warning(u'Invalid Indexer ID ({0}), not using metadata file',
+                log.warning('Invalid Indexer ID ({0}), not using metadata file',
                             indexer_id)
                 return empty_return
 
             indexer = None
-            if showXML.findtext(u'episodeguide/url'):
-                epg_url = showXML.findtext(u'episodeguide/url').lower()
+            if showXML.findtext('episodeguide/url'):
+                epg_url = showXML.findtext('episodeguide/url').lower()
                 if str(indexer_id) in epg_url:
-                    if u'thetvdb.com' in epg_url:
+                    if 'thetvdb.com' in epg_url:
                         indexer = INDEXER_TVDBV2
-                    elif u'tvmaze.com' in epg_url:
+                    elif 'tvmaze.com' in epg_url:
                         indexer = INDEXER_TVMAZE
-                    elif u'themoviedb.org' in epg_url:
+                    elif 'themoviedb.org' in epg_url:
                         indexer = INDEXER_TMDB
-                    elif u'tvrage' in epg_url:
+                    elif 'tvrage' in epg_url:
                         log.warning(
-                            u'Invalid Indexer ID ({0}), not using metadata file because it has TVRage info',
+                            'Invalid Indexer ID ({0}), not using metadata file because it has TVRage info',
                             indexer_id
                         )
                         return empty_return
 
         except Exception as error:
             log.warning(
-                u'There was an error parsing your existing metadata file: {location} error: {error}',
-                {u'location': metadata_path, u'error': ex(error)}
+                'There was an error parsing your existing metadata file: {location} error: {error}',
+                {'location': metadata_path, 'error': ex(error)}
             )
             return empty_return
 
@@ -1006,11 +1019,11 @@ def retrieveShowMetadata(self, folder):
 
     @staticmethod
     def _retrieve_show_images_from_tmdb(show, img_type):
-        types = {u'poster': u'poster_path',
-                 u'banner': None,
-                 u'fanart': u'backdrop_path',
-                 u'poster_thumb': u'poster_path',
-                 u'banner_thumb': None}
+        types = {'poster': 'poster_path',
+                 'banner': None,
+                 'fanart': 'backdrop_path',
+                 'poster_thumb': 'poster_path',
+                 'banner_thumb': None}
 
         # get TMDB configuration info
         tmdb.API_KEY = app.TMDB_API_KEY
@@ -1018,31 +1031,31 @@ def _retrieve_show_images_from_tmdb(show, img_type):
         try:
             response = config.info()
         except RequestException as error:
-            log.warning(u'Indexer TMDB is unavailable at this time: {reason}',
-                        {u'reason': error})
+            log.warning('Indexer TMDB is unavailable at this time: {reason}',
+                        {'reason': error})
             return False
 
-        base_url = response[u'images'][u'base_url']
-        sizes = response[u'images'][u'poster_sizes']
+        base_url = response['images']['base_url']
+        sizes = response['images']['poster_sizes']
 
         def size_str_to_int(x):
-            return float(u'inf') if x == u'original' else int(x[1:])
+            return float('inf') if x == 'original' else int(x[1:])
 
         max_size = max(sizes, key=size_str_to_int)
 
         try:
             search = tmdb.Search()
             for show_name in show.get_all_possible_names():
-                for result in search.collection(query=show_name)[u'results'] + search.tv(query=show_name)[u'results']:
+                for result in search.collection(query=show_name)['results'] + search.tv(query=show_name)['results']:
                     if types[img_type] and result.get(types[img_type]):
-                        return u'{0}{1}{2}'.format(base_url, max_size, result[types[img_type]])
+                        return '{0}{1}{2}'.format(base_url, max_size, result[types[img_type]])
 
         except Exception:
             pass
 
         log.info(
-            u'Could not find any {type} images on TMDB for {series}',
-            {u'type': img_type, u'series': show.name}
+            'Could not find any {type} images on TMDB for {series}',
+            {'type': img_type, 'series': show.name}
         )
 
     def to_json(self):


Test patch: