diff --git a/lib/plexapi/base.py b/lib/plexapi/base.py index 9c735373..26b103b9 100644 --- a/lib/plexapi/base.py +++ b/lib/plexapi/base.py @@ -866,6 +866,8 @@ class Playable: if kwargs: # So this seems to be a a lot slower but allows transcode. + kwargs['mediaIndex'] = self.media.index(part._parent()) + kwargs['partIndex'] = part._parent().parts.index(part) download_url = self.getStreamURL(**kwargs) else: download_url = self._server.url(f'{part.key}?download=1') diff --git a/lib/plexapi/const.py b/lib/plexapi/const.py index 7568344e..b0fe7e7d 100644 --- a/lib/plexapi/const.py +++ b/lib/plexapi/const.py @@ -4,6 +4,6 @@ # Library version MAJOR_VERSION = 4 MINOR_VERSION = 15 -PATCH_VERSION = 13 +PATCH_VERSION = 15 __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}" diff --git a/lib/plexapi/media.py b/lib/plexapi/media.py index 43c5636d..56126dcb 100644 --- a/lib/plexapi/media.py +++ b/lib/plexapi/media.py @@ -478,6 +478,7 @@ class SubtitleStream(MediaPartStream): return self.setSelected() +@utils.registerPlexObject class LyricStream(MediaPartStream): """ Represents a lyric stream within a :class:`~plexapi.media.MediaPart`. diff --git a/lib/plexapi/myplex.py b/lib/plexapi/myplex.py index 740b2398..bc40583e 100644 --- a/lib/plexapi/myplex.py +++ b/lib/plexapi/myplex.py @@ -1049,7 +1049,7 @@ class MyPlexAccount(PlexObject): self.query(key, params=params) return self - def searchDiscover(self, query, limit=30, libtype=None): + def searchDiscover(self, query, limit=30, libtype=None, providers='discover'): """ Search for movies and TV shows in Discover. Returns a list of :class:`~plexapi.video.Movie` and :class:`~plexapi.video.Show` objects. @@ -1057,6 +1057,9 @@ class MyPlexAccount(PlexObject): query (str): Search query. limit (int, optional): Limit to the specified number of results. Default 30. libtype (str, optional): 'movie' or 'show' to only return movies or shows, otherwise return all items. + providers (str, optional): 'discover' for default behavior + or 'discover,PLEXAVOD' to also include the Plex ad-suported video service + or 'discover,PLEXAVOD,PLEXTVOD' to also include the Plex video rental service """ libtypes = {'movie': 'movies', 'show': 'tv'} libtype = libtypes.get(libtype, 'movies,tv') @@ -1068,6 +1071,7 @@ class MyPlexAccount(PlexObject): 'query': query, 'limit': limit, 'searchTypes': libtype, + 'searchProviders': providers, 'includeMetadata': 1 } diff --git a/lib/plexapi/server.py b/lib/plexapi/server.py index 178ce82b..f39a423f 100644 --- a/lib/plexapi/server.py +++ b/lib/plexapi/server.py @@ -413,16 +413,17 @@ class PlexServer(PlexObject): return items def client(self, name): - """ Returns the :class:`~plexapi.client.PlexClient` that matches the specified name. + """ Returns the :class:`~plexapi.client.PlexClient` that matches the specified name + or machine identifier. Parameters: - name (str): Name of the client to return. + name (str): Name or machine identifier of the client to return. Raises: :exc:`~plexapi.exceptions.NotFound`: Unknown client name. """ for client in self.clients(): - if client and client.title == name: + if client and (client.title == name or client.machineIdentifier == name): return client raise NotFound(f'Unknown client name: {name}')