'Login to AniDB UDP API
parameters:
username - your anidb username
password - your anidb password
nat     - if this is 1, response will have "address" in attributes with your "ip:port" (default:0)
mtu     - maximum transmission unit (max packet size) (default: 1400)'

def auth(self, username, password, nat=None, mtu=None, callback=None):

    if (not all([username, password])):
        sickrage.srCore.srLogger.debug(u'AniDB    username    and/or    password    are    not    set.    Aborting    AniDB    lookup.')
        return False
    authed = self.authed()
    if (not authed):
        self.log(u'ok1')
        if self.keepAlive:
            self.log(u'ok2')
            self._username = username
            self._password = password
            if (not self.is_alive()):
                self.log(u'You    wanted    to    keep    this    thing    alive!')
                if (not self._iamALIVE):
                    self.log(u'Starting    thread    now...')
                    self.start()
                    self._iamALIVE = True
                else:
                    self.log(u'not    starting    thread    seams    like    it    is    already    running.    this    must    be    a    _reAuthenticate')
        self.lastAuth = time.time()
        return self.handle(AuthCommand(username, password, 3, self.clientname, self.clientver, nat, 1, u'utf8', mtu), callback)
    return authed
