feat(help): 重构帮助菜单界面并优化样式
refactor(bili_parser): 修复 API 响应 content-type 问题 fix(command_manager): 添加帮助图片获取的错误处理 docs(deployment): 简化部署文档并移除 JIT 相关内容
This commit is contained in:
@@ -126,7 +126,9 @@ async def get_direct_video_url(video_url: str) -> Optional[str]:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(api_url, headers=HEADERS, timeout=10) as response:
|
||||
response.raise_for_status()
|
||||
data = await response.json()
|
||||
# 使用 content_type=None 来忽略 Content-Type 检查
|
||||
# 因为 API 返回 text/json 而不是标准的 application/json
|
||||
data = await response.json(content_type=None)
|
||||
if data.get("code") == 200 and data.get("data"):
|
||||
return data["data"][0].get("video_url")
|
||||
except (aiohttp.ClientError, json.JSONDecodeError, KeyError, IndexError) as e:
|
||||
|
||||
Reference in New Issue
Block a user