mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-16 04:45:27 +00:00
🐛 Fix post parse image extension in jpeg
This commit is contained in:
parent
d22feb02e5
commit
67a2635ea5
@ -97,8 +97,9 @@ class HyperionBase:
|
||||
@staticmethod
|
||||
async def download_image(client: "HyperionRequest", art_id: int, url: str, page: int = 0) -> List[ArtworkImage]:
|
||||
filename = os.path.basename(url)
|
||||
_, file_extension = os.path.splitext(filename)
|
||||
is_image = bool(file_extension in ".jpg" or file_extension in ".png")
|
||||
_, _file_extension = os.path.splitext(filename)
|
||||
file_extension = _file_extension.lower()
|
||||
is_image = file_extension in ".jpg" or file_extension in ".jpeg" or file_extension in ".png"
|
||||
response = await client.get(
|
||||
url, params=Hyperion.get_images_params(resize=2000) if is_image else None, de_json=False
|
||||
)
|
||||
|
@ -107,7 +107,7 @@ class PostInfo(BaseModel):
|
||||
image_keys = {"cover_list", "image_list"}
|
||||
for key in image_keys:
|
||||
image_list.extend(_data_post.get(key, []))
|
||||
image_urls = [image["url"] for image in image_list]
|
||||
image_urls = list({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):
|
||||
|
Loading…
Reference in New Issue
Block a user