def METHOD_NAME(self):
    """Login method used for logging in before doing search and torrent downloads."""
    if any(dict_from_cookiejar(self.session.cookies).values()):
        return True
    login_params = {
        'uid': self.username,
        'pwd': self.password,
        'submit': 'Confirm',
    }
    response = self.session.post(self.urls['login'], data=login_params)
    if not response or not response.text:
        log.warning('Unable to connect to provider')
        return False
    if re.search('You need cookies enabled to log in.', response.text):
        log.warning('Invalid username or password. Check your settings')
        return False
    return True