执行 Ruff 安全自动修复
This commit is contained in:
@@ -18,7 +18,6 @@ from .cookie_utils import (
|
||||
normalize_douyu_cookie,
|
||||
)
|
||||
|
||||
|
||||
PC_UA = (
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko) "
|
||||
@@ -1446,8 +1445,7 @@ class DouyuActivityClient:
|
||||
if not match:
|
||||
raise DouyuActivityError(f"响应中找不到 var {varname}=: {text[:200]}")
|
||||
chunk = text[match.end() :].strip()
|
||||
if chunk.endswith(";"):
|
||||
chunk = chunk[:-1]
|
||||
chunk = chunk.removesuffix(";")
|
||||
try:
|
||||
return json.loads(chunk)
|
||||
except json.JSONDecodeError as exc:
|
||||
|
||||
Reference in New Issue
Block a user