From bef199e4e1ce27569091a3ebc35e49c2777e2a9c Mon Sep 17 00:00:00 2001 From: simonc56 Date: Fri, 15 Aug 2025 11:41:54 +0200 Subject: [PATCH 1/2] replace metadata by discover in watchlist and scrobble urls (API update) --- plexapi/myplex.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plexapi/myplex.py b/plexapi/myplex.py index 411d56183..e70a80b0f 100644 --- a/plexapi/myplex.py +++ b/plexapi/myplex.py @@ -949,7 +949,7 @@ def watchlist(self, filter=None, sort=None, libtype=None, maxresults=None, **kwa params.update(kwargs) - key = f'{self.METADATA}/library/sections/watchlist/{filter}{utils.joinArgs(params)}' + key = f'{self.DISCOVER}/library/sections/watchlist/{filter}{utils.joinArgs(params)}' return self._toOnlineMetadata(self.fetchItems(key, maxresults=maxresults), **kwargs) def onWatchlist(self, item): @@ -979,7 +979,7 @@ def addToWatchlist(self, items): if self.onWatchlist(item): raise BadRequest(f'"{item.title}" is already on the watchlist') ratingKey = item.guid.rsplit('/', 1)[-1] - self.query(f'{self.METADATA}/actions/addToWatchlist?ratingKey={ratingKey}', method=self._session.put) + self.query(f'{self.DISCOVER}/actions/addToWatchlist?ratingKey={ratingKey}', method=self._session.put) return self def removeFromWatchlist(self, items): @@ -1000,7 +1000,7 @@ def removeFromWatchlist(self, items): if not self.onWatchlist(item): raise BadRequest(f'"{item.title}" is not on the watchlist') ratingKey = item.guid.rsplit('/', 1)[-1] - self.query(f'{self.METADATA}/actions/removeFromWatchlist?ratingKey={ratingKey}', method=self._session.put) + self.query(f'{self.DISCOVER}/actions/removeFromWatchlist?ratingKey={ratingKey}', method=self._session.put) return self def userState(self, item): @@ -1010,7 +1010,7 @@ def userState(self, item): item (:class:`~plexapi.video.Movie` or :class:`~plexapi.video.Show`): Item to return the user state. """ ratingKey = item.guid.rsplit('/', 1)[-1] - data = self.query(f"{self.METADATA}/library/metadata/{ratingKey}/userState") + data = self.query(f"{self.DISCOVER}/library/metadata/{ratingKey}/userState") return self.findItem(data, cls=UserState) def isPlayed(self, item): @@ -1034,7 +1034,7 @@ def markPlayed(self, item): :class:`~plexapi.video.Episode`): Object from searchDiscover(). Can be also result from Plex Movie or Plex TV Series agent. """ - key = f'{self.METADATA}/actions/scrobble' + key = f'{self.DISCOVER}/actions/scrobble' ratingKey = item.guid.rsplit('/', 1)[-1] params = {'key': ratingKey, 'identifier': 'com.plexapp.plugins.library'} self.query(key, params=params) @@ -1049,7 +1049,7 @@ def markUnplayed(self, item): :class:`~plexapi.video.Episode`): Object from searchDiscover(). Can be also result from Plex Movie or Plex TV Series agent. """ - key = f'{self.METADATA}/actions/unscrobble' + key = f'{self.DISCOVER}/actions/unscrobble' ratingKey = item.guid.rsplit('/', 1)[-1] params = {'key': ratingKey, 'identifier': 'com.plexapp.plugins.library'} self.query(key, params=params) From 7227576d9cad3d9f626aa16537462369028a5119 Mon Sep 17 00:00:00 2001 From: simonc56 Date: Mon, 25 Aug 2025 20:59:59 +0200 Subject: [PATCH 2/2] keep metadata baseurl for scrobble and userState --- plexapi/myplex.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plexapi/myplex.py b/plexapi/myplex.py index e70a80b0f..1821a873a 100644 --- a/plexapi/myplex.py +++ b/plexapi/myplex.py @@ -1010,7 +1010,7 @@ def userState(self, item): item (:class:`~plexapi.video.Movie` or :class:`~plexapi.video.Show`): Item to return the user state. """ ratingKey = item.guid.rsplit('/', 1)[-1] - data = self.query(f"{self.DISCOVER}/library/metadata/{ratingKey}/userState") + data = self.query(f"{self.METADATA}/library/metadata/{ratingKey}/userState") return self.findItem(data, cls=UserState) def isPlayed(self, item): @@ -1034,7 +1034,7 @@ def markPlayed(self, item): :class:`~plexapi.video.Episode`): Object from searchDiscover(). Can be also result from Plex Movie or Plex TV Series agent. """ - key = f'{self.DISCOVER}/actions/scrobble' + key = f'{self.METADATA}/actions/scrobble' ratingKey = item.guid.rsplit('/', 1)[-1] params = {'key': ratingKey, 'identifier': 'com.plexapp.plugins.library'} self.query(key, params=params) @@ -1049,7 +1049,7 @@ def markUnplayed(self, item): :class:`~plexapi.video.Episode`): Object from searchDiscover(). Can be also result from Plex Movie or Plex TV Series agent. """ - key = f'{self.DISCOVER}/actions/unscrobble' + key = f'{self.METADATA}/actions/unscrobble' ratingKey = item.guid.rsplit('/', 1)[-1] params = {'key': ratingKey, 'identifier': 'com.plexapp.plugins.library'} self.query(key, params=params)