From 7078495f9e15959a4e1d4e135fa58348ca5f813f Mon Sep 17 00:00:00 2001 From: dlliang14 <89458327+dlliang14@users.noreply.github.com> Date: Fri, 27 Mar 2026 00:01:36 +0800 Subject: [PATCH] oss-bug --- nodes/media_nodes.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nodes/media_nodes.py b/nodes/media_nodes.py index 935d6bb..40b8bea 100644 --- a/nodes/media_nodes.py +++ b/nodes/media_nodes.py @@ -12,6 +12,13 @@ import imageio_ffmpeg from botocore.config import Config +def _normalize_endpoint(endpoint: str) -> str: + value = (endpoint or "").strip().rstrip("/") + if value and "://" not in value: + value = f"https://{value}" + return value + + class OSSInfoNode: """OSS configuration node - provides endpoint, credentials, and bucket info for other nodes.""" @@ -59,7 +66,7 @@ class OSSInfoNode: path_prefix: str, ): config = { - "endpoint": endpoint.strip(), + "endpoint": _normalize_endpoint(endpoint), "access_key_id": access_key_id.strip(), "access_key_secret": access_key_secret.strip(), "bucket_name": bucket_name.strip(), @@ -409,7 +416,7 @@ class FFmpegBatchConvertNode: access_key_secret - Access Key Secret bucket_name - target bucket """ - endpoint = str(oss_config.get("endpoint", "")).strip() + endpoint = _normalize_endpoint(str(oss_config.get("endpoint", ""))) access_key_id = str(oss_config.get("access_key_id", "")).strip() access_key_secret = str(oss_config.get("access_key_secret", "")).strip() bucket_name = str(oss_config.get("bucket_name", "")).strip() @@ -466,7 +473,7 @@ class FFmpegBatchConvertNode: oss_config: dict, oss_key: str, ) -> str: - endpoint = str(oss_config.get("endpoint", "")).strip() + endpoint = _normalize_endpoint(str(oss_config.get("endpoint", ""))) bucket_name = str(oss_config.get("bucket_name", "")).strip() if not endpoint or not bucket_name: