'Searches indexer using the params in search_strings, either for latest releases, or a string/id search
Returns: list of results in dict form'

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

    results = []
    if (not self._check_auth()):
        return results
    if (u'gingadaddy' not in self.url):
        if (not self.caps):
            self.get_newznab_categories(just_caps=True)
        if (not self.caps):
            return results
    for mode in search_strings:
        torznab = False
        search_params = {u't': (u'search', u'tvsearch')[bool(self.use_tv_search)], u'limit': 100, u'offset': 0, u'cat': (self.catIDs.strip(u',    ') or u'5030,5040'), u'maxage': sickbeard.USENET_RETENTION}
        if (self.needs_auth and self.key):
            search_params[u'apikey'] = self.key
        if (mode != u'RSS'):
            if self.use_tv_search:
                if (u'tvdbid' in str(self.cap_tv_search)):
                    search_params[u'tvdbid'] = ep_obj.show.indexerid
                if (ep_obj.show.air_by_date or ep_obj.show.sports):
                    date_str = str(ep_obj.airdate)
                    search_params[u'season'] = date_str.partition(u'-')[0]
                    search_params[u'ep'] = date_str.partition(u'-')[2].replace(u'-', u'/')
                else:
                    search_params[u'season'] = ep_obj.scene_season
                    search_params[u'ep'] = ep_obj.scene_episode
            if (mode == u'Season'):
                search_params.pop(u'ep', u'')
        items = []
        logger.log(u'Search    Mode:    {0}'.format(mode), logger.DEBUG)
        for search_string in search_strings[mode]:
            if (mode != u'RSS'):
                logger.log(u'Search    string:    {0}'.format(search_string.decode(u'utf-8')), logger.DEBUG)
                if (u'tvdbid' not in search_params):
                    search_params[u'q'] = search_string
            time.sleep(cpu_presets[sickbeard.CPU_PRESET])
            data = self.get_url(urljoin(self.url, u'api'), params=search_params, returns=u'text')
            if (not data):
                break
            with BS4Parser(data, u'html5lib') as html:
                if (not self._check_auth_from_data(html)):
                    break
                try:
                    torznab = (u'xmlns:torznab' in html.rss.attrs)
                except AttributeError:
                    torznab = False
                for item in html(u'item'):
                    try:
                        title = item.title.get_text(strip=True)
                        download_url = None
                        if item.link:
                            if validators.url(item.link.get_text(strip=True), require_tld=False):
                                download_url = item.link.get_text(strip=True)
                            elif validators.url(item.link.next.strip(), require_tld=False):
                                download_url = item.link.next.strip()
                        if ((not download_url), (item.enclosure and validators.url(item.enclosure.get(u'url', u'').strip(), require_tld=False))):
                            download_url = item.enclosure.get(u'url', u'').strip()
                        if (not (title and download_url)):
                            continue
                        seeders = leechers = None
                        if (u'gingadaddy' in self.url):
                            size_regex = re.search(u'\\d*.?\\d*    [KMGT]B', str(item.description))
                            item_size = (size_regex.group() if size_regex else (-1))
                        else:
                            item_size = (item.size.get_text(strip=True) if item.size else (-1))
                            for attr in (item(u'newznab:attr') + item(u'torznab:attr')):
                                item_size = (attr[u'value'] if (attr[u'name'] == u'size') else item_size)
                                seeders = (try_int(attr[u'value']) if (attr[u'name'] == u'seeders') else seeders)
                                leechers = (try_int(attr[u'value']) if (attr[u'name'] == u'peers') else leechers)
                        if ((not item_size) or (torznab and ((seeders is None) or (leechers is None)))):
                            continue
                        size = (convert_size(item_size) or (-1))
                        result = {u'title': title, u'link': download_url, u'size': size, u'seeders': seeders, u'leechers': leechers}
                        items.append(result)
                    except StandardError:
                        continue
            if (u'tvdbid' in search_params):
                break
        if torznab:
            results.sort(key=(lambda d: try_int(d.get(u'seeders', 0))), reverse=True)
        results += items
    return results
