执行 Ruff 安全自动修复
This commit is contained in:
@@ -17,8 +17,8 @@ from pathlib import Path
|
||||
from urllib.error import HTTPError
|
||||
from urllib.parse import urlencode
|
||||
from urllib.request import (
|
||||
HTTPRedirectHandler,
|
||||
HTTPCookieProcessor,
|
||||
HTTPRedirectHandler,
|
||||
Request,
|
||||
build_opener,
|
||||
)
|
||||
@@ -43,7 +43,7 @@ USER_AGENT = (
|
||||
class NoRedirect(HTTPRedirectHandler):
|
||||
"""Keep OAuth redirects visible while CookieJar receives Set-Cookie headers."""
|
||||
|
||||
def redirect_request(self, req, fp, code, msg, headers, newurl): # noqa: D401
|
||||
def redirect_request(self, req, fp, code, msg, headers, newurl):
|
||||
return None
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ def g_tk(p_skey: str) -> int:
|
||||
|
||||
|
||||
def parse_poll(body: str) -> tuple[int, str]:
|
||||
match = re.search(r"ptuiCB\((.*)\)", body, re.S)
|
||||
match = re.search(r"ptuiCB\((.*)\)", body, re.DOTALL)
|
||||
if not match:
|
||||
raise ValueError("QQ 二维码轮询响应缺少 ptuiCB")
|
||||
values = re.findall(r"'([^']*)'", match.group(1))
|
||||
|
||||
Reference in New Issue
Block a user