From 2862976246eec49e15ddbefc618dfacac7f60417 Mon Sep 17 00:00:00 2001 From: CI Bot Date: Mon, 5 Oct 2026 03:51:11 +0000 Subject: [PATCH] style: auto-format with black + isort + ruff + prettier [skip ci-format-check] --- apps/worker/worker_app/tasks/viral_video.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/worker/worker_app/tasks/viral_video.py b/apps/worker/worker_app/tasks/viral_video.py index 247409e4a..156a0554e 100644 --- a/apps/worker/worker_app/tasks/viral_video.py +++ b/apps/worker/worker_app/tasks/viral_video.py @@ -349,7 +349,6 @@ def _is_vision_result_usable(result: dict) -> bool: return True - def _normalize_image_url(raw: str, idx: int) -> str: """#2188: 将 job.images 中的 storage_key/相对路径/空值统一归一化为可公网访问 URL。 - 以 http:// 或 https:// 开头 → 视为公网 URL @@ -358,6 +357,7 @@ def _normalize_image_url(raw: str, idx: int) -> str: 返回前做 HTTP HEAD 检查可达性。 """ import requests as _req + if not raw or not isinstance(raw, str): raise ValueError(f"图片 #{idx} URL 为空或类型错误: {type(raw).__name__}={raw!r}") url = raw.strip() @@ -369,6 +369,7 @@ def _normalize_image_url(raw: str, idx: int) -> str: storage_key = url.lstrip("/") try: from packages.shared.storage import get_storage_service + _svc = get_storage_service() url = _svc.get_url(storage_key) except Exception as _e: