mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Update query_resource.py
This commit is contained in:
parent
3319fa72e4
commit
4ce4e4c44c
@ -178,17 +178,22 @@ async def download_map_init(
|
|||||||
if not _map.exists():
|
if not _map.exists():
|
||||||
# padding_w, padding_h = data['padding']
|
# padding_w, padding_h = data['padding']
|
||||||
data = data["slices"]
|
data = data["slices"]
|
||||||
map_url = data[0][0]['url']
|
idx = 0
|
||||||
|
for _map_data in data[0]:
|
||||||
|
map_url = _map_data['url']
|
||||||
await download_image(
|
await download_image(
|
||||||
map_url,
|
map_url,
|
||||||
f"{map_path}/map.png",
|
f"{map_path}/{idx}.png",
|
||||||
session,
|
session,
|
||||||
semaphore,
|
semaphore,
|
||||||
force_flag=flag,
|
force_flag=flag,
|
||||||
)
|
)
|
||||||
map_file = CreateImg(
|
idx += 1
|
||||||
0, 0, background=f"{map_path}/map.png", ratio=MAP_RATIO
|
_w, h = CreateImg(0, 0, background=f"{map_path}/0.png", ratio=MAP_RATIO).size
|
||||||
)
|
w = _w * len(os.listdir(map_path))
|
||||||
|
map_file = CreateImg(w, h, _w, h, ratio=MAP_RATIO)
|
||||||
|
for i in range(idx):
|
||||||
|
map_file.paste(CreateImg(0, 0, background=f"{map_path}/{i}.png", ratio=MAP_RATIO))
|
||||||
map_file.save(f"{map_path}/map.png")
|
map_file.save(f"{map_path}/map.png")
|
||||||
else:
|
else:
|
||||||
logger.warning(f'获取原神地图失败 msg: {data["message"]}')
|
logger.warning(f'获取原神地图失败 msg: {data["message"]}')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user