From ebc21fe6ef3866c842bcc759dda0f59bfc6a614b Mon Sep 17 00:00:00 2001 From: Vivien <34387011+vivien8261@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:21:32 +0800 Subject: [PATCH] update --- core/cosChainBuilder.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/cosChainBuilder.py b/core/cosChainBuilder.py index ec9f2c47..078cb59b 100644 --- a/core/cosChainBuilder.py +++ b/core/cosChainBuilder.py @@ -51,6 +51,9 @@ def remove_file(self, url: str): del self.cos_caches[url] async def get_image(self, image: Union[str, bytes]) -> Union[str, bytes]: + if isinstance(image, str) and image.startswith('http'): + return image + url = await super().get_image(image) self.cos.upload_file( @@ -61,6 +64,9 @@ async def get_image(self, image: Union[str, bytes]) -> Union[str, bytes]: return url async def get_voice(self, voice_file: str) -> str: + if voice_file.startswith('http'): + return voice_file + url = await super().get_voice(voice_file) self.cos.upload_file( @@ -71,6 +77,9 @@ async def get_voice(self, voice_file: str) -> str: return url async def get_video(self, video_file: str) -> str: + if video_file.startswith('http'): + return video_file + url = await super().get_video(video_file) self.cos.upload_file(