'uTorrent API need HTTP Basic Auth and cookie support for token verify.'

def _make_opener(self, realm, base_url, username, password):

    auth = urllib2.HTTPBasicAuthHandler()
    auth.add_password(realm=realm, uri=base_url, user=username, passwd=password)
    opener = urllib2.build_opener(auth)
    urllib2.install_opener(opener)
    cookie_jar = cookielib.CookieJar()
    cookie_handler = urllib2.HTTPCookieProcessor(cookie_jar)
    handlers = [auth, cookie_handler]
    opener = urllib2.build_opener(*handlers)
    return opener
