diff --git a/modules/apihelper/client/components/hyperion.py b/modules/apihelper/client/components/hyperion.py index 4652510..7835cf6 100644 --- a/modules/apihelper/client/components/hyperion.py +++ b/modules/apihelper/client/components/hyperion.py @@ -104,7 +104,12 @@ class HyperionBase: url, params=Hyperion.get_images_params(resize=2000) if is_image else None, de_json=False ) return ArtworkImage.gen( - art_id=art_id, page=page, file_name=filename, file_extension=url.split(".")[-1], data=response.content + art_id=art_id, + page=page, + file_name=filename, + file_extension=url.split(".")[-1], + data=response.content, + url=url, ) @abstractmethod diff --git a/modules/apihelper/models/genshin/hyperion.py b/modules/apihelper/models/genshin/hyperion.py index 7f9e3c3..838e544 100644 --- a/modules/apihelper/models/genshin/hyperion.py +++ b/modules/apihelper/models/genshin/hyperion.py @@ -1,3 +1,5 @@ +from collections import OrderedDict + import ujson from datetime import datetime, timedelta from enum import Enum @@ -26,6 +28,7 @@ class ArtworkImage(BaseModel): file_name: Optional[str] = None file_extension: Optional[str] = None is_error: bool = False + url: str = "" @property def format(self) -> Optional[str]: @@ -107,7 +110,7 @@ class PostInfo(BaseModel): image_keys = {"cover_list", "image_list"} for key in image_keys: image_list.extend(_data_post.get(key, [])) - image_urls = list({image["url"] for image in image_list}) + image_urls = list(OrderedDict.fromkeys([image["url"] for image in image_list])) key1, key2 = ("video", "resolution") if hoyolab else ("vod_list", "resolutions") vod_list = _data_post.get(key1, []) if not isinstance(vod_list, list):