'This plugin returns ALL of the shows monitored by Sickbeard.
This includes both ongoing and ended.
Syntax:
sickbeard:
base_url=<value>
port=<value>
api_key=<value>
Options base_url and api_key are required.
Use with input plugin like discover and/or configure_series.
Example:
download-tv-task:
configure_series:
settings:
quality:
- 720p
from:
sickbeard:
base_url: http://localhost
port: 8531
api_key: MYAPIKEY1123
discover:
what:
- next_series_episodes: yes
from:
torrentz: any
download:
/download/tv
Note that when using the configure_series plugin with Sickbeard
you are basically synced to it, so removing a show in Sickbeard will
remove it in flexget as well, which could be positive or negative,
depending on your usage.'

def on_task_input(self, task, config):

    parsedurl = urlparse(config.get(u'base_url'))
    url = (u'%s://%s:%s%s/api/%s/?cmd=shows' % (parsedurl.scheme, parsedurl.netloc, config.get(u'port'), parsedurl.path, config.get(u'api_key')))
    try:
        json = task.requests.get(url).json()
    except RequestException as e:
        raise plugin.PluginError((u'Unable    to    connect    to    Sickbeard    at    %s://%s:%s%s.    Error:    %s' % (parsedurl.scheme, parsedurl.netloc, config.get(u'port'), parsedurl.path, e)))
    entries = []
    for (_, show) in list(json[u'data'].items()):
        log.debug(u'processing    show:    {}'.format(show))
        fg_qualities = u''
        if (show[u'paused'] and config.get(u'only_monitored')):
            continue
        if ((show[u'status'] == u'Ended') and (not config.get(u'include_ended'))):
            continue
        if config.get(u'include_data'):
            show_url = (u'%s:%s/api/%s/?cmd=show&tvdbid=%s' % (config[u'base_url'], config[u'port'], config[u'api_key'], show[u'tvdbid']))
            show_json = task.requests.get(show_url).json()
            log.debug(u'processing    show    data:    %s', show_json[u'data'])
            if (u'quality_details' not in show_json[u'data']):
                log.error(u'Corrupt    data    returned,    skipping:    %s', show_json[u'data'])
                continue
            fg_qualities = self.quality_requirement_builder(show_json[u'data'][u'quality_details'][u'initial'])
        entry = Entry(title=show[u'show_name'], url=u'', series_name=show[u'show_name'], tvdb_id=show.get(u'tvdbid'), tvrage_id=show.get(u'tvrage_id'))
        if (len(fg_qualities) > 1):
            entry[u'configure_series_qualities'] = fg_qualities
        elif (len(fg_qualities) == 1):
            entry[u'configure_series_quality'] = fg_qualities[0]
        else:
            entry[u'configure_series_quality'] = fg_qualities
        if entry.isvalid():
            entries.append(entry)
        else:
            log.error((u'Invalid    entry    created?    %s' % entry))
            continue
        if task.options.test:
            log.info(u'Test    mode.    Entry    includes:')
            for (key, value) in list(entry.items()):
                log.info(u'                    {}:    {}'.format(key.capitalize(), value))
    return entries
