コード例 #1
0
ファイル: utorrent.py プロジェクト: andyuc88/LazyLibrarian
    def _make_opener(realm, base_url, username, password):
        """uTorrent API need HTTP Basic Auth and cookie support for token verify."""
        auth = HTTPBasicAuthHandler()
        auth.add_password(realm=realm, uri=base_url, user=username, passwd=password)
        opener = build_opener(auth)
        install_opener(opener)

        cookie_jar = http_cookiejar.CookieJar()
        cookie_handler = HTTPCookieProcessor(cookie_jar)

        handlers = [auth, cookie_handler]
        opener = build_opener(*handlers)
        return opener
コード例 #2
0
ファイル: utorrent.py プロジェクト: geoffg41/LazyLibrarian
    def _make_opener(realm, base_url, username, password):
        """uTorrent API need HTTP Basic Auth and cookie support for token verify."""
        auth = HTTPBasicAuthHandler()
        auth.add_password(realm=realm, uri=base_url, user=username, passwd=password)
        opener = build_opener(auth)
        install_opener(opener)

        cookie_jar = http_cookiejar.CookieJar()
        cookie_handler = HTTPCookieProcessor(cookie_jar)

        handlers = [auth, cookie_handler]
        opener = build_opener(*handlers)
        return opener
コード例 #3
0
ファイル: qbittorrent.py プロジェクト: DobyTang/LazyLibrarian
 def _make_opener(self):
     # create opener with cookie handler to carry QBitTorrent SID cookie
     cookie_handler = HTTPCookieProcessor(self.cookiejar)
     handlers = [cookie_handler]
     return build_opener(*handlers)
コード例 #4
0
 def _make_opener(self):
     # create opener with cookie handler to carry QBitTorrent SID cookie
     cookie_handler = HTTPCookieProcessor(self.cookiejar)
     handlers = [cookie_handler]
     return build_opener(*handlers)