From bea1ceb83a1dc9c65396db5889dcb8b20f9ca72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 12 Apr 2024 04:49:01 +0800 Subject: [PATCH] Update vndb.py --- LunaTranslator/LunaTranslator/myutils/vndb.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/LunaTranslator/LunaTranslator/myutils/vndb.py b/LunaTranslator/LunaTranslator/myutils/vndb.py index 4651f1db..b00b8718 100644 --- a/LunaTranslator/LunaTranslator/myutils/vndb.py +++ b/LunaTranslator/LunaTranslator/myutils/vndb.py @@ -138,32 +138,22 @@ def getvidbytitle_release(title): ) -def getdevelopersbyid(vid): +def getdevelopersbyid(vid): + def _js(js): _ = [] for item in js["results"][0]["developers"]: if item["original"]: _.append(item["original"]) - return _ - - origin = safegetvndbjson( - "https://api.vndb.org/kana/vn", - {"filters": ["id", "=", vid], "fields": "developers.original"}, - _js, - ) - - def _js(js): - _ = [] - for item in js["results"][0]["developers"]: _.append(item["name"]) return _ name = safegetvndbjson( "https://api.vndb.org/kana/vn", - {"filters": ["id", "=", vid], "fields": "developers.name"}, + {"filters": ["id", "=", vid], "fields": "developers.name,developers.origin"}, _js, ) - return name + origin + return name def getvidbytitle(title):