From 7983cbbaacbedffe2f83958eefaa496d58fb4999 Mon Sep 17 00:00:00 2001 From: Carol Date: Wed, 13 Sep 2023 11:39:28 +0800 Subject: [PATCH] =?UTF-8?q?change:=20=E8=B0=83=E6=95=B4=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/redo.py | 4 ++-- utils/tmdb.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/redo.py b/utils/redo.py index 08b6ba5..cde3d3e 100644 --- a/utils/redo.py +++ b/utils/redo.py @@ -15,9 +15,9 @@ from tmdb import Tmdb def __redo(log, output, tmdb_token, language="zh-CN"): - log.logger.info("------------------- 开始重新刮削: {0} -------------------".format("./error_tmdb_ids.txt")) + log.logger.info("------------------- 开始重新刮削: {0} -------------------".format("../error_tmdb_ids.txt")) - with open("./error_tmdb_ids.txt", "r") as error_f: + with open("../error_tmdb_ids.txt", "r") as error_f: error_info = error_f.read() for info in error_info.split(","): info = info.strip() diff --git a/utils/tmdb.py b/utils/tmdb.py index 6f3d01a..161fdb3 100644 --- a/utils/tmdb.py +++ b/utils/tmdb.py @@ -73,6 +73,9 @@ class Tmdb: elif "US" in translations_json.keys(): us = translations_json["US"] plot = us["data"]["biography"] + else: + default_value = translations_json[0] + plot = default_value["data"]["biography"] plot = plot.replace("\n", "").replace("\r\n", "") return plot @@ -130,7 +133,7 @@ class Tmdb: os.remove(person_nfo) # 非重做模式下记录刮削异常信息,重做模式下不再重复记录 if not redo: - error_file = open("./error_tmdb_ids.txt", "w+") + error_file = open("../error_tmdb_ids.txt", "w+") error_file.write(os.path.basename(self.actor_path) + ",") error_file.close() self.log.logger.error(actor_data)