📄 httpauth.py
字号:
import itertoolsfrom dl_daemon import commandimport eventlooprequestIdGenerator = itertools.count()waitingHTTPAuthCallbacks = {}def handleHTTPAuthResponse(id, authHeader): callback = waitingHTTPAuthCallbacks.pop(id) callback(authHeader)def findHTTPAuth(callback, host, path): id = requestIdGenerator.next() waitingHTTPAuthCallbacks[id] = callback from dl_daemon import daemon c = command.FindHTTPAuthCommand(daemon.lastDaemon, id, host, path) c.send()def askForHTTPAuth(callback, host, path, authScheme): id = requestIdGenerator.next() waitingHTTPAuthCallbacks[id] = callback from dl_daemon import daemon c = command.AskForHTTPAuthCommand(daemon.lastDaemon, id, host, path, authScheme) c.send()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -