Skip to content

Commit

Permalink
除文件名规则支持-C硬字幕外,新支持ch硬字幕
Browse files Browse the repository at this point in the history
  • Loading branch information
lededev committed Apr 11, 2022
1 parent cdbccb3 commit f342d42
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 6 additions & 4 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,9 @@ def core_main_no_net_op(movie_path, number):
path = str(Path(movie_path).parent)

if re.search('-CD\d+', movie_path, re.IGNORECASE):
part = re.findall('-CD\d+', movie_path, re.IGNORECASE)[0]
if '-c.' in movie_path or '-C.' in movie_path or '中文' in movie_path or '字幕' in movie_path:
part = re.findall('-CD\d+', movie_path, re.IGNORECASE)[0].upper()
if re.search(r'-C(\.\w+$|-\w+)|\d+ch(\.\w+$|-\w+)', movie_path,
re.I) or '中文' in movie_path or '字幕' in movie_path:
cn_sub = '1'
c_word = '-C' # 中文字幕影片后缀
uncensored = 1 if is_uncensored(number) else 0
Expand Down Expand Up @@ -699,8 +700,9 @@ def core_main(movie_path, number_th, oCC):
# =======================================================================判断-C,-CD后缀
if re.search('-CD\d+', movie_path, re.IGNORECASE):
multi_part = 1
part = re.findall('-CD\d+', movie_path, re.IGNORECASE)[0]
if '-c.' in movie_path or '-C.' in movie_path or '中文' in movie_path or '字幕' in movie_path:
part = re.findall('-CD\d+', movie_path, re.IGNORECASE)[0].upper()
if re.search(r'-C(\.\w+$|-\w+)|\d+ch(\.\w+$|-\w+)', movie_path,
re.I) or '中文' in movie_path or '字幕' in movie_path:
cn_sub = '1'
c_word = '-C' # 中文字幕影片后缀

Expand Down
14 changes: 10 additions & 4 deletions number_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def get_number(debug: bool, file_path: str) -> str:
return str(re.search(r'\w+', filename[:filename.find('.')], re.A).group())
file_number = str(re.search(r'\w+(-|_)\w+', filename, re.A).group())
file_number = re.sub("(-|_)c$", "", file_number, flags=re.IGNORECASE)
if re.search("\d+ch$", file_number, flags=re.I):
file_number = file_number[:-2]
return file_number.upper()
else: # 提取不含减号-的番号,FANZA CID
# 欧美番号匹配规则
Expand Down Expand Up @@ -149,19 +151,23 @@ def is_uncensored(number):
"caribean-020317_001.nfo", # -号误命名为_号的
"257138_3xplanet_1Pondo_080521_001.mp4",
"ADV-R0624-CD3.wmv", # 多碟影片
"XXX-AV 22061-CD5.iso", # 新支持片商格式 xxx-av-22061 命名规则来自javdb数据源
"XXX-AV 22061-CD5.iso", # 支持片商格式 xxx-av-22061 命名规则来自javdb数据源
"xxx-av 20589.mp4",
"Muramura-102114_145-HD.wmv", # 新支持片商格式 102114_145 命名规则来自javdb数据源
"heydouga-4102-023-CD2.iso", # 新支持片商格式 heydouga-4102-023 命名规则来自javdb数据源
"Muramura-102114_145-HD.wmv", # 支持片商格式 102114_145 命名规则来自javdb数据源
"heydouga-4102-023-CD2.iso", # 支持片商格式 heydouga-4102-023 命名规则来自javdb数据源
"HeyDOuGa4236-1048 Ai Qiu - .mp4", # heydouga-4236-1048 命名规则来自javdb数据源
"pacopacomama-093021_539-FHD.mkv", # 新支持片商格式 093021_539 命名规则来自javdb数据源
"pacopacomama-093021_539-FHD.mkv", # 支持片商格式 093021_539 命名规则来自javdb数据源
"sbw99.cc@heyzo_hd_2636_full.mp4",
"hhd800.com@STARS-566-HD.mp4",
"jav20s8.com@GIGL-677_4K.mp4",
"sbw99.cc@iesp-653-4K.mp4",
"4K-ABP-358_C.mkv",
"n1012-CD1.wmv",
"[]n1012-CD2.wmv",
"rctd-460ch.mp4", # 除支持-C硬字幕外,新支持ch硬字幕
"rctd-461CH-CD2.mp4", # ch后可加CDn
"rctd-461-Cd3-C.mp4", # CDn后可加-C
"rctd-461-C-cD4.mp4", # cD1 Cd1 cd1 CD1 最终生成.nfo时统一为大写CD1
)


Expand Down

0 comments on commit f342d42

Please sign in to comment.