'Sometimes search results have no contents. This function tries to extract something sensible.'

@staticmethod
def extract_title(soup):

    if (isinstance(soup.contents, list) and soup.contents):
        return soup.contents[0]
    if (soup.get(u'href') and (u'torrent' in soup.get(u'href'))):
        return soup.get(u'href').rsplit(u'/', 1)[(-1)]
