From e96df700c12e8340ada45f48b7d10c352a64ac70 Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 24 Sep 2021 16:24:57 +0200 Subject: [PATCH] Fix logging if fanart.tv lookup fails --- resources/lib/plex_api/artwork.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/resources/lib/plex_api/artwork.py b/resources/lib/plex_api/artwork.py index 632d4355..08841a35 100644 --- a/resources/lib/plex_api/artwork.py +++ b/resources/lib/plex_api/artwork.py @@ -222,12 +222,14 @@ class Artwork(object): else: # Not supported artwork return artworks - data = DU().downloadUrl(url, authenticate=False, timeout=15) - try: - data.get('test') - except AttributeError: - LOG.error('Could not download data from FanartTV') + data = DU().downloadUrl(url, + authenticate=False, + timeout=15, + return_response=True) + if not data.ok: + LOG.debug('Could not download data from FanartTV') return artworks + data = data.json() fanart_tv_types = list(v.FANART_TV_TO_KODI_TYPE)