Skip to content

Commit

Permalink
Allow clips and extras to be streamed and downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWong16 committed Jun 7, 2021
1 parent 6405d22 commit 67b3fc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plexapi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down
6 changes: 6 additions & 0 deletions plexapi/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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). """
Expand All @@ -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)

0 comments on commit 67b3fc6

Please sign in to comment.