From 008e11d63f92c34ce28ff20f533faf7e5504903b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Tue, 30 Apr 2024 07:15:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=B1=86=E7=93=A3=E4=BA=BA=E7=89=A9?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/douban/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/modules/douban/__init__.py b/app/modules/douban/__init__.py index ac807705..a9a4ee5b 100644 --- a/app/modules/douban/__init__.py +++ b/app/modules/douban/__init__.py @@ -582,7 +582,8 @@ class DoubanModule(_ModuleBase): 'name': item.get('target', {}).get('title'), 'url': item.get('target', {}).get('url'), 'images': item.get('target', {}).get('cover', {}), - 'avatar': item.get('target', {}).get('cover_img', {}).get('url'), + 'avatar': (item.get('target', {}).get('cover_img', {}).get('url') + or '').replace("/l/public/", "/s/public/"), }) for item in result.get('items') if name in item.get('target', {}).get('title')] return [] @@ -853,10 +854,13 @@ class DoubanModule(_ModuleBase): infos = detail.get("extra", {}).get("info") if infos: also_known_as = [":".join(info) for info in infos] + image = detail.get("cover_img", {}).get("url") + if image: + image = image.replace("/l/public/", "/s/public/") return schemas.MediaPerson(source='douban', **{ "id": detail.get("id"), "name": detail.get("title"), - "avatar": detail.get("cover_img", {}).get("url"), + "avatar": image, "biography": detail.get("extra", {}).get("short_info"), "also_known_as": also_known_as, })