plugin: Add Plugin.broken decorator.

This commit is contained in:
Christopher Rosell 2014-11-23 11:17:08 +01:00
parent ada325e9c6
commit a008c3fa24
1 changed files with 18 additions and 0 deletions

View File

@ -153,6 +153,24 @@ class Plugin(object):
return stream_types
@classmethod
def broken(cls, issue=None):
def func(*args, **kwargs):
msg = (
"This plugin has been marked as broken. This is likely due to "
"changes to the service preventing a working implementation. "
)
if issue:
msg += "More info: https://github.com/chrippa/livestreamer/issues/{0}".format(issue)
raise PluginError(msg)
def decorator(*args, **kwargs):
return func
return decorator
def streams(self, stream_types=None, sorting_excludes=None):
"""Attempts to extract available streams.