'Do the actual searching and JSON parsing'

def search(self, search_params, age=0, ep_obj=None):

    results = []
    for mode in search_params:
        items = []
        logger.log(u'Search    Mode:    {0}'.format(mode), logger.DEBUG)
        for search_string in search_params[mode]:
            if (mode != u'RSS'):
                logger.log(u'Search    string:    {0}'.format(search_string.decode(u'utf-8')), logger.DEBUG)
            post_data = {u'username': self.username, u'passkey': self.passkey, u'category': u'2', u'search': search_string}
            self._check_auth()
            parsed_json = self.get_url(self.urls[u'search'], post_data=json.dumps(post_data), returns=u'json')
            if (not parsed_json):
                return results
            if self._check_auth_from_data(parsed_json):
                json_items = parsed_json.get(u'data', u'')
                if (not json_items):
                    logger.log(u'Resulting    JSON    from    provider    is    not    correct,    not    parsing    it', logger.ERROR)
                for item in json_items.get(u'torrents', []):
                    title = item.pop(u'name', u'')
                    download_url = u'{0}{1}'.format(self.urls[u'download'], urlencode({u'id': item.pop(u'id', u''), u'passkey': self.passkey}))
                    if (not all([title, download_url])):
                        continue
                    seeders = try_int(item.pop(u'seeders', 0))
                    leechers = try_int(item.pop(u'leechers', 0))
                    if ((seeders < self.minseed) or (leechers < self.minleech)):
                        logger.log(u'Discarding    torrent    because    it    does    not    meet    the    minimum    seeders    or    leechers:    {0}    (S:{1}    L:{2})'.format(title, seeders, leechers), logger.DEBUG)
                        continue
                    info_hash = item.pop(u'info_hash', u'')
                    size = convert_size(item.pop(u'size', (-1)), (-1))
                    item = {u'title': title, u'link': download_url, u'size': size, u'seeders': seeders, u'leechers': leechers, u'hash': info_hash}
                    if (mode != u'RSS'):
                        logger.log(u'Found    result:    {0}    with    {1}    seeders    and    {2}    leechers'.format(title, seeders, leechers), logger.DEBUG)
                    items.append(item)
        items.sort(key=(lambda d: try_int(d.get(u'seeders', 0))), reverse=True)
        results += items
    return results
