From b8569df1b388d5d11aeecb29efa79b384ae0f371 Mon Sep 17 00:00:00 2001 From: BrutuZ Date: Tue, 6 Jul 2021 12:46:47 -0300 Subject: [PATCH] Support for the Plex HAMA agent to let Kodi identify animes (using Kodi's uniqueID 'anidb') Support HAMA's forced AniDB IDs --- resources/lib/plex_api/base.py | 4 ++-- resources/lib/utils.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/lib/plex_api/base.py b/resources/lib/plex_api/base.py index a764ccd3..6cb6978c 100644 --- a/resources/lib/plex_api/base.py +++ b/resources/lib/plex_api/base.py @@ -14,8 +14,8 @@ LOG = getLogger('PLEX.api') METADATA_PROVIDERS = (('imdb', utils.REGEX_IMDB), ('tvdb', utils.REGEX_TVDB), - ('tmdb', utils.REGEX_TMDB)) - + ('tmdb', utils.REGEX_TMDB), + ('anidb', utils.REGEX_ANIDB)) class Base(object): """ Processes a Plex media server's XML response diff --git a/resources/lib/utils.py b/resources/lib/utils.py index a3363a77..87211741 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -46,6 +46,7 @@ REGEX_PLEX_DIRECT = re.compile(r'''\.plex\.direct:\d+$''') REGEX_IMDB = re.compile(r'''/(tt\d+)''') REGEX_TVDB = re.compile(r'''thetvdb:\/\/(.+?)\?''') REGEX_TMDB = re.compile(r'''themoviedb:\/\/(.+?)\?''') +REGEX_ANIDB = re.compile(r'''anidb[2-4]?-(\d+?)\?''') # Plex music REGEX_MUSICPATH = re.compile(r'''^\^(.+)\$$''') # Grab Plex id from an URL-encoded string