Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien8261 committed Feb 5, 2024
1 parent 0c84eb7 commit ebc21fe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/cosChainBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit ebc21fe

Please sign in to comment.