From 4bbdf1e5f243c490b3541650948807990c5dbac9 Mon Sep 17 00:00:00 2001 From: salty Date: Fri, 4 Jun 2021 23:34:24 +0200 Subject: [PATCH] Use V3 endpoint Will break sonarr V2. --- media/pvr.py | 4 ++-- media/radarr.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/media/pvr.py b/media/pvr.py index ccb6174..bedce25 100644 --- a/media/pvr.py +++ b/media/pvr.py @@ -26,7 +26,7 @@ class PVR(ABC): try: # request system status to validate api_key req = requests.get( - os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/system/status'), + os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/v3/system/status'), headers=self.headers, timeout=60, allow_redirects=False @@ -72,7 +72,7 @@ class PVR(ABC): try: # make request req = requests.get( - os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/profile'), + os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/v3/profile'), headers=self.headers, timeout=60, allow_redirects=False diff --git a/media/radarr.py b/media/radarr.py index 85dc740..132821b 100644 --- a/media/radarr.py +++ b/media/radarr.py @@ -9,10 +9,10 @@ log = logger.get_logger(__name__) class Radarr(PVR): def get_objects(self): - return self._get_objects('api/movie') + return self._get_objects('api/v3/movie') def get_exclusions(self): - return self._get_objects('api/exclusions') + return self._get_objects('api/v3/exclusions') @backoff.on_predicate(backoff.expo, lambda x: x is None, max_tries=4, on_backoff=backoff_handler) def add_movie(self, movie_tmdb_id, movie_title, movie_year, movie_title_slug, quality_profile_id, root_folder, @@ -38,4 +38,4 @@ class Radarr(PVR): } }) - return self._add_object('api/movie', payload, identifier_field='tmdbId', identifier=movie_tmdb_id) + return self._add_object('api/v3/movie', payload, identifier_field='tmdbId', identifier=movie_tmdb_id)