fix 蓝光原盘刮削
This commit is contained in:
@ -166,6 +166,22 @@ class DoubanModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
if settings.SCRAP_SOURCE != "douban":
|
if settings.SCRAP_SOURCE != "douban":
|
||||||
return None
|
return None
|
||||||
|
if SystemUtils.is_bluray_dir(path):
|
||||||
|
# 蓝光原盘
|
||||||
|
logger.info(f"开始刮削蓝光原盘:{path} ...")
|
||||||
|
meta = MetaInfo(path.stem)
|
||||||
|
if not meta.name:
|
||||||
|
return
|
||||||
|
# 根据名称查询豆瓣数据
|
||||||
|
doubaninfo = self.__match(name=mediainfo.title, year=mediainfo.year, season=meta.begin_season)
|
||||||
|
if not doubaninfo:
|
||||||
|
logger.warn(f"未找到 {mediainfo.title} 的豆瓣信息")
|
||||||
|
return
|
||||||
|
scrape_path = path / path.name
|
||||||
|
self.scraper.gen_scraper_files(meta=meta,
|
||||||
|
mediainfo=MediaInfo(douban_info=doubaninfo),
|
||||||
|
file_path=scrape_path)
|
||||||
|
else:
|
||||||
# 目录下的所有文件
|
# 目录下的所有文件
|
||||||
for file in SystemUtils.list_files(path, settings.RMT_MEDIAEXT):
|
for file in SystemUtils.list_files(path, settings.RMT_MEDIAEXT):
|
||||||
if not file:
|
if not file:
|
||||||
@ -176,12 +192,16 @@ class DoubanModule(_ModuleBase):
|
|||||||
if not meta.name:
|
if not meta.name:
|
||||||
continue
|
continue
|
||||||
# 根据名称查询豆瓣数据
|
# 根据名称查询豆瓣数据
|
||||||
doubaninfo = self.__match(name=mediainfo.title, year=mediainfo.year, season=meta.begin_season)
|
doubaninfo = self.__match(name=mediainfo.title,
|
||||||
|
year=mediainfo.year,
|
||||||
|
season=meta.begin_season)
|
||||||
if not doubaninfo:
|
if not doubaninfo:
|
||||||
logger.warn(f"未找到 {mediainfo.title} 的豆瓣信息")
|
logger.warn(f"未找到 {mediainfo.title} 的豆瓣信息")
|
||||||
break
|
break
|
||||||
# 刮削
|
# 刮削
|
||||||
self.scraper.gen_scraper_files(meta, MediaInfo(douban_info=doubaninfo), file)
|
self.scraper.gen_scraper_files(meta=meta,
|
||||||
|
mediainfo=MediaInfo(douban_info=doubaninfo),
|
||||||
|
file_path=file)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"刮削文件 {file} 失败,原因:{e}")
|
logger.error(f"刮削文件 {file} 失败,原因:{e}")
|
||||||
logger.info(f"{file} 刮削完成")
|
logger.info(f"{path} 刮削完成")
|
||||||
|
@ -17,7 +17,7 @@ class DoubanScraper:
|
|||||||
生成刮削文件
|
生成刮削文件
|
||||||
:param meta: 元数据
|
:param meta: 元数据
|
||||||
:param mediainfo: 媒体信息
|
:param mediainfo: 媒体信息
|
||||||
:param file_path: 文件路径
|
:param file_path: 文件路径或者目录路径
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -368,6 +368,8 @@ class FileTransferModule(_ModuleBase):
|
|||||||
# 转移整个目录
|
# 转移整个目录
|
||||||
# 是否蓝光原盘
|
# 是否蓝光原盘
|
||||||
bluray_flag = SystemUtils.is_bluray_dir(in_path)
|
bluray_flag = SystemUtils.is_bluray_dir(in_path)
|
||||||
|
if bluray_flag:
|
||||||
|
logger.info(f"{in_path} 是蓝光原盘文件夹")
|
||||||
# 目的路径
|
# 目的路径
|
||||||
new_path = self.get_rename_path(
|
new_path = self.get_rename_path(
|
||||||
path=target_dir,
|
path=target_dir,
|
||||||
|
@ -187,6 +187,14 @@ class TheMovieDbModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
if settings.SCRAP_SOURCE != "themoviedb":
|
if settings.SCRAP_SOURCE != "themoviedb":
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if SystemUtils.is_bluray_dir(path):
|
||||||
|
# 蓝光原盘
|
||||||
|
logger.info(f"开始刮削蓝光原盘:{path} ...")
|
||||||
|
scrape_path = path / path.name
|
||||||
|
self.scraper.gen_scraper_files(mediainfo=mediainfo,
|
||||||
|
file_path=scrape_path)
|
||||||
|
else:
|
||||||
# 目录下的所有文件
|
# 目录下的所有文件
|
||||||
for file in SystemUtils.list_files(path, settings.RMT_MEDIAEXT):
|
for file in SystemUtils.list_files(path, settings.RMT_MEDIAEXT):
|
||||||
if not file:
|
if not file:
|
||||||
@ -194,7 +202,7 @@ class TheMovieDbModule(_ModuleBase):
|
|||||||
logger.info(f"开始刮削媒体库文件:{file} ...")
|
logger.info(f"开始刮削媒体库文件:{file} ...")
|
||||||
self.scraper.gen_scraper_files(mediainfo=mediainfo,
|
self.scraper.gen_scraper_files(mediainfo=mediainfo,
|
||||||
file_path=file)
|
file_path=file)
|
||||||
logger.info(f"{file} 刮削完成")
|
logger.info(f"{path} 刮削完成")
|
||||||
|
|
||||||
def tmdb_discover(self, mtype: MediaType, sort_by: str, with_genres: str, with_original_language: str,
|
def tmdb_discover(self, mtype: MediaType, sort_by: str, with_genres: str, with_original_language: str,
|
||||||
page: int = 1) -> Optional[List[dict]]:
|
page: int = 1) -> Optional[List[dict]]:
|
||||||
|
@ -22,7 +22,7 @@ class TmdbScraper:
|
|||||||
"""
|
"""
|
||||||
生成刮削文件
|
生成刮削文件
|
||||||
:param mediainfo: 媒体信息
|
:param mediainfo: 媒体信息
|
||||||
:param file_path: 文件路径
|
:param file_path: 文件路径或者目录路径
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __get_episode_detail(_seasoninfo: dict, _episode: int):
|
def __get_episode_detail(_seasoninfo: dict, _episode: int):
|
||||||
@ -37,7 +37,7 @@ class TmdbScraper:
|
|||||||
try:
|
try:
|
||||||
# 电影
|
# 电影
|
||||||
if mediainfo.type == MediaType.MOVIE:
|
if mediainfo.type == MediaType.MOVIE:
|
||||||
# 强制或者不已存在时才处理
|
# 不已存在时才处理
|
||||||
if not file_path.with_name("movie.nfo").exists() \
|
if not file_path.with_name("movie.nfo").exists() \
|
||||||
and not file_path.with_suffix(".nfo").exists():
|
and not file_path.with_suffix(".nfo").exists():
|
||||||
# 生成电影描述文件
|
# 生成电影描述文件
|
||||||
|
Reference in New Issue
Block a user