style: isort/ruff 格式化 scripts_ai.py 导入顺序
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 1s
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / Check push changed paths (push) Successful in 2s
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 48s
CI/CD Pipeline / Build Staging API Image (push) Successful in 1m5s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 1m19s
CI/CD Pipeline / Retag skipped Staging API Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 2m49s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m52s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 29s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m40s
CI/CD Pipeline / Integration Tests (push) Successful in 10m11s
CI/CD Pipeline / Validate - Style (push) Successful in 10m31s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 12m50s
CI/CD Pipeline / Unit Tests (push) Successful in 16m5s
CI/CD Pipeline / Build Production API Image (push) Has been cancelled
CI/CD Pipeline / Build Production Web Image (push) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Production (push) Has been cancelled
CI/CD Pipeline / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
CI/CD Pipeline / CI Gate (push) Has been cancelled
CI/CD Pipeline / Validate - Security (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled

This commit is contained in:
2026-09-16 22:58:10 +08:00
parent d825756c67
commit cd4274553c
+15 -3
View File
@@ -95,7 +95,8 @@ if _cf:
else:
logger.warning(
"抖音 cookies 文件未找到或无效: path=%s baked=%s 抖音提取功能可能因 cookies 缺失失败",
DOUYIN_COOKIES_FILE, DOUYIN_COOKIES_FILE_BAKED,
DOUYIN_COOKIES_FILE,
DOUYIN_COOKIES_FILE_BAKED,
)
# 是否在错误响应中暴露原始 yt-dlp 错误(仅 staging/dev 用于排查,生产默认 False)
@@ -194,7 +195,16 @@ def extract_from_douyin(
_dbg("errmsg", msg)
# 404/视频不存在/不可下载 → 400
is_bad_url = any(
kw in msg.lower() for kw in ("404", "not found", "unable to download webpage", "unsupported url", "no video formats", "video unavailable", "this video isn't available")
kw in msg.lower()
for kw in (
"404",
"not found",
"unable to download webpage",
"unsupported url",
"no video formats",
"video unavailable",
"this video isn't available",
)
)
# cookies 缺失/过期 → 返回友好提示,不暴露 yt-dlp 原始错误
if _is_cookies_related_error(msg):
@@ -206,7 +216,9 @@ def extract_from_douyin(
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
detail=_detail,
) from exc
_detail = "无法解析该抖音链接,请确认链接有效且视频未被下架" if is_bad_url else "视频下载失败,请稍后重试"
_detail = (
"无法解析该抖音链接,请确认链接有效且视频未被下架" if is_bad_url else "视频下载失败,请稍后重试"
)
if _DOUYIN_DEBUG_ERRORS:
_detail = f"{_detail} [debug: {msg[:300]}]"
raise HTTPException(