'Uses the newznab provider url and apikey to get the capabilities.
Makes use of the default newznab caps param. e.a. http://yournewznab/api?t=caps&apikey=skdfiw7823sdkdsfjsfk
Returns a tuple with (succes or not, array with dicts [{"id": "5070", "name": "Anime"},
{"id": "5080", "name": "Documentary"}, {"id": "5020", "name": "Foreign"}...etc}], error message)'

def get_newznab_categories(self):

    success = False
    categories = []
    message = u''
    self.check_auth()
    params = {u't': u'caps'}
    if self.key:
        params[u'apikey'] = self.key
    try:
        resp = sickrage.srCore.srWebSession.get(u'{}api?{}'.format(self.urls[u'base_url'], urllib.urlencode(params)))
        data = xmltodict.parse(resp.content)
        for category in data[u'caps'][u'categories'][u'category']:
            if (category.get(u'@name') == u'TV'):
                categories += [{u'id': category[u'@id'], u'name': category[u'@name']}]
                categories += [{u'id': x[u'@id'], u'name': x[u'@name']} for x in category[u'subcat']]
        success = True
    except Exception as e:
        sickrage.srCore.srLogger.debug((u'[%s]    failed    to    list    categories' % self.name))
        message = (u'[%s]    failed    to    list    categories' % self.name)
    return (success, categories, message)
