From 4fe8412b6e1eee5018adb0cc8d860cb83dc23394 Mon Sep 17 00:00:00 2001 From: KimigaiiWuyi <444835641@qq.com> Date: Sun, 24 Nov 2024 21:49:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi_genshin_map/GetMapImage/download.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fastapi_genshin_map/GetMapImage/download.py b/fastapi_genshin_map/GetMapImage/download.py index 7303108..4ecdf3a 100644 --- a/fastapi_genshin_map/GetMapImage/download.py +++ b/fastapi_genshin_map/GetMapImage/download.py @@ -43,7 +43,12 @@ async def download_P0_img( return URL = BASE + world[map_id] + '/{}_P0.webp' - resp = await client.get(URL.format(f'{i}_{j}')) + try: + resp = await client.get(URL.format(f'{i}_{j}')) + except Exception as e: + logger.warning(f'请求失败, 可能不影响最终结果, 错误信息: {e}') + return + if resp.status_code != 200: return @@ -87,7 +92,7 @@ async def make_P0_map(map_id: int) -> Image.Image: TASK.clear() if map_id == 2: - ox, oy = -2048, -1024 + ox, oy = -3072, -1024 else: ox, oy = 0, 0 big_img = Image.new('RGBA', (x * 256 + ox, y * 256 + oy))