From 0be68d94fe71830e73aada4209827e44ef76c65d Mon Sep 17 00:00:00 2001 From: Carol Date: Wed, 6 Sep 2023 14:30:53 +0800 Subject: [PATCH] =?UTF-8?q?change:=20=E4=BF=AE=E6=94=B9=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20change:=20=E4=BF=AE=E6=94=B9=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=BB=E7=A8=8B=E5=BA=8F=E6=97=A5=E5=BF=97=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- person.py | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a6f84cb..c179a9c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # tmdb-person +> 根据nfo文件信息刮削相关演员信息及图片 +> +> 解决docker部署的emby服务无法正常刮削到视频演员信息问题(通过nastool可以正常刮削到视频信息) ![](https://img.shields.io/badge/Python-3.8-green) ![](https://img.shields.io/badge/TMDB-V3-blue) -根据nfo文件信息刮削相关演员信息及图片 + ## 数据 ### example diff --git a/person.py b/person.py index 17b4db0..841629a 100644 --- a/person.py +++ b/person.py @@ -53,7 +53,7 @@ class Analyze: class Tmdb: - def __init__(self, tmdb_id, actor_path, tmdb_token): + def __init__(self, tmdb_id, actor_path, tmdb_token, language="zh-CN"): self.image_path = None self.tmdb_id = tmdb_id self.actor_path = actor_path @@ -61,9 +61,10 @@ class Tmdb: "accept": "application/json", "Authorization": "Bearer " + tmdb_token } + self.language = language def get_actor_info(self): - url = "https://api.themoviedb.org/3/person/" + self.tmdb_id + "?language=zh-CN" + url = "https://api.themoviedb.org/3/person/" + self.tmdb_id + "?language=" + self.language headers = self.header response = requests.get(url, headers=headers) log.logger.info("当前刮削到的演员元数据:{0}".format(response.text)) @@ -149,4 +150,5 @@ if __name__ == '__main__': # 初始化日志 log = __init_logger() # 开始执行主程序 + # 默认 language="zh-CN" (简体中文),可以通过修改 "language" 的值变更获取元数据的语言类别 __execute(dir_path=__dir_path, output=__output, tmdb_token=__tmdb_token)