fix scrape api
This commit is contained in:
@ -136,7 +136,8 @@ class DoubanScraper:
|
||||
:param file_path: 电影文件路径
|
||||
"""
|
||||
# 开始生成XML
|
||||
logger.info(f"正在生成电影NFO文件:{file_path.name}")
|
||||
if file_path:
|
||||
logger.info(f"正在生成电影NFO文件:{file_path.name}")
|
||||
doc = minidom.Document()
|
||||
root = DomUtils.add_node(doc, doc, "movie")
|
||||
# 公共部分
|
||||
|
@ -216,14 +216,18 @@ class TheMovieDbModule(_ModuleBase):
|
||||
tmdbid=info.get("id"))
|
||||
return info
|
||||
|
||||
def tmdb_info(self, tmdbid: int, mtype: MediaType) -> Optional[dict]:
|
||||
def tmdb_info(self, tmdbid: int, mtype: MediaType, season: int = None) -> Optional[dict]:
|
||||
"""
|
||||
获取TMDB信息
|
||||
:param tmdbid: int
|
||||
:param mtype: 媒体类型
|
||||
:param season: 季号
|
||||
:return: TVDB信息
|
||||
"""
|
||||
return self.tmdb.get_info(mtype=mtype, tmdbid=tmdbid)
|
||||
if not season:
|
||||
return self.tmdb.get_info(mtype=mtype, tmdbid=tmdbid)
|
||||
else:
|
||||
return self.tmdb.get_tv_season_detail(tmdbid=tmdbid, season=season)
|
||||
|
||||
def media_category(self) -> Optional[Dict[str, list]]:
|
||||
"""
|
||||
|
@ -305,7 +305,8 @@ class TmdbScraper:
|
||||
:param season: 季号
|
||||
:param season_path: 电视剧季的目录
|
||||
"""
|
||||
logger.info(f"正在生成季NFO文件:{season_path.name}")
|
||||
if season_path:
|
||||
logger.info(f"正在生成季NFO文件:{season_path.name}")
|
||||
doc = minidom.Document()
|
||||
root = DomUtils.add_node(doc, doc, "season")
|
||||
# 简介
|
||||
@ -343,7 +344,8 @@ class TmdbScraper:
|
||||
:param file_path: 集文件的路径
|
||||
"""
|
||||
# 开始生成集的信息
|
||||
logger.info(f"正在生成剧集NFO文件:{file_path.name}")
|
||||
if file_path:
|
||||
logger.info(f"正在生成剧集NFO文件:{file_path.name}")
|
||||
doc = minidom.Document()
|
||||
root = DomUtils.add_node(doc, doc, "episodedetails")
|
||||
# TMDBID
|
||||
|
Reference in New Issue
Block a user