change: 修改说明类型
change: 修改脚本主程序日志输出
This commit is contained in:
parent
e19542fe92
commit
0be68d94fe
|
@ -1,9 +1,12 @@
|
||||||
# tmdb-person
|
# tmdb-person
|
||||||
|
> 根据nfo文件信息刮削相关演员信息及图片
|
||||||
|
>
|
||||||
|
> 解决docker部署的emby服务无法正常刮削到视频演员信息问题(通过nastool可以正常刮削到视频信息)
|
||||||
|
|
||||||
![](https://img.shields.io/badge/Python-3.8-green)
|
![](https://img.shields.io/badge/Python-3.8-green)
|
||||||
![](https://img.shields.io/badge/TMDB-V3-blue)
|
![](https://img.shields.io/badge/TMDB-V3-blue)
|
||||||
|
|
||||||
根据nfo文件信息刮削相关演员信息及图片
|
|
||||||
|
|
||||||
## 数据
|
## 数据
|
||||||
### example
|
### example
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Analyze:
|
||||||
|
|
||||||
|
|
||||||
class Tmdb:
|
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.image_path = None
|
||||||
self.tmdb_id = tmdb_id
|
self.tmdb_id = tmdb_id
|
||||||
self.actor_path = actor_path
|
self.actor_path = actor_path
|
||||||
|
@ -61,9 +61,10 @@ class Tmdb:
|
||||||
"accept": "application/json",
|
"accept": "application/json",
|
||||||
"Authorization": "Bearer " + tmdb_token
|
"Authorization": "Bearer " + tmdb_token
|
||||||
}
|
}
|
||||||
|
self.language = language
|
||||||
|
|
||||||
def get_actor_info(self):
|
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
|
headers = self.header
|
||||||
response = requests.get(url, headers=headers)
|
response = requests.get(url, headers=headers)
|
||||||
log.logger.info("当前刮削到的演员元数据:{0}".format(response.text))
|
log.logger.info("当前刮削到的演员元数据:{0}".format(response.text))
|
||||||
|
@ -149,4 +150,5 @@ if __name__ == '__main__':
|
||||||
# 初始化日志
|
# 初始化日志
|
||||||
log = __init_logger()
|
log = __init_logger()
|
||||||
# 开始执行主程序
|
# 开始执行主程序
|
||||||
|
# 默认 language="zh-CN" (简体中文),可以通过修改 "language" 的值变更获取元数据的语言类别
|
||||||
__execute(dir_path=__dir_path, output=__output, tmdb_token=__tmdb_token)
|
__execute(dir_path=__dir_path, output=__output, tmdb_token=__tmdb_token)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user