diff --git a/Contents/Code/search.py b/Contents/Code/search.py index cd7006d..e38e9c9 100644 --- a/Contents/Code/search.py +++ b/Contents/Code/search.py @@ -35,7 +35,7 @@ def search_anime(type, results, media, lang): }''' if Prefs['search_type'] == 'name-id': variables = '''{ - "id": "'''+ re.match(' ([0-9]*?)$', search_term).group(1) +'''" + "id": "'''+ re.search(' ([0-9]*?)$', search_term).group(1) +'''" }''' if Prefs['search_type'] == 'id': variables = '''{ diff --git a/Contents/Code/update.py b/Contents/Code/update.py index bbdf2f8..f7c67bf 100644 --- a/Contents/Code/update.py +++ b/Contents/Code/update.py @@ -158,7 +158,7 @@ def update_anime(type, metadata, media, force): if type == 'tv': # Banners - if metadata.banners is None or force: + if metadata.banners is None or metadata.art is None or force: try: banner_hash = base64.b64encode(str(anime['bannerImage'])) banner = Proxy.Media( @@ -167,13 +167,30 @@ def update_anime(type, metadata, media, force): verify=certifi.where() ).content ) - metadata.banners[banner_hash] = banner except: Log.Error('Error: Show has no banners: ' + metadata.id) + if metadata.banners is None or force: + metadata.banners[banner_hash] = banner + if metadata.art is None or force: + metadata.art[banner_hash] = banner + # Movie Specific if type == 'movie': + if metadata.art is None or force: + try: + banner_hash = base64.b64encode(str(anime['bannerImage'])) + banner = Proxy.Media( + requests_retry_session().get( + anime['bannerImage'], + verify=certifi.where() + ).content + ) + metadata.art[banner_hash] = banner + except: + Log.Error('Error: Show has no banners: ' + metadata.id) + # Year if metadata.year is None or force: try: