From 67b3fc694a821c02c49b9d20e5b22b90a2c856d0 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 6 Jun 2021 17:50:35 -0700 Subject: [PATCH] Allow clips and extras to be streamed and downloaded --- plexapi/base.py | 2 +- plexapi/video.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plexapi/base.py b/plexapi/base.py index 0c56110a2..1a5759b6f 100644 --- a/plexapi/base.py +++ b/plexapi/base.py @@ -610,7 +610,7 @@ def getStreamURL(self, **params): Raises: :exc:`~plexapi.exceptions.Unsupported`: When the item doesn't support fetching a stream URL. """ - if self.TYPE not in ('movie', 'episode', 'track'): + if self.TYPE not in ('movie', 'episode', 'track', 'clip'): raise Unsupported('Fetching stream URL for %s is unsupported.' % self.TYPE) mvb = params.get('maxVideoBitrate') vr = params.get('videoResolution', '') diff --git a/plexapi/video.py b/plexapi/video.py index 9a42a0ce1..609eaffc3 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -938,6 +938,9 @@ def locations(self): """ return [part.file for part in self.iterParts() if part] + def _prettyfilename(self): + return self.title + class Extra(Clip): """ Represents a single Extra (trailer, behindTheScenes, etc). """ @@ -949,3 +952,6 @@ def _loadData(self, data): self.librarySectionID = parent.librarySectionID self.librarySectionKey = parent.librarySectionKey self.librarySectionTitle = parent.librarySectionTitle + + def _prettyfilename(self): + return '%s (%s)' % (self.title, self.subtype)