@@ -330,8 +330,8 @@ def movie_lists(source_folder, regexstr: str) -> typing.List[str]:
|
||||
print('[!]Skip failed movie:', absf)
|
||||
continue
|
||||
is_sym = full_name.is_symlink()
|
||||
if main_mode != 3 and (is_sym or full_name.stat().st_nlink > 1): # 短路布尔 符号链接不取stat(),因为符号链接可能指向不存在目标
|
||||
continue # file is symlink or hardlink(Linux/NTFS/Darwin)
|
||||
if main_mode != 3 and (is_sym or (full_name.stat().st_nlink > 1 and not conf.scan_hardlink())): # 短路布尔 符号链接不取stat(),因为符号链接可能指向不存在目标
|
||||
continue # 模式不等于3下跳过软连接和未配置硬链接刮削
|
||||
# 调试用0字节样本允许通过,去除小于120MB的广告'苍老师强力推荐.mp4'(102.2MB)'黑道总裁.mp4'(98.4MB)'有趣的妹子激情表演.MP4'(95MB)'有趣的臺灣妹妹直播.mp4'(15.1MB)
|
||||
movie_size = 0 if is_sym else full_name.stat().st_size # 同上 符号链接不取stat()及st_size,直接赋0跳过小视频检测
|
||||
if 0 < movie_size < 125829120: # 1024*1024*120=125829120
|
||||
|
||||
@@ -6,6 +6,8 @@ source_folder=./
|
||||
failed_output_folder=failed
|
||||
success_output_folder=JAV_output
|
||||
soft_link=0
|
||||
; 0: 不刮削硬链接文件 1: 刮削硬链接文件
|
||||
scan_hardlink=0
|
||||
failed_move=1
|
||||
auto_exit=0
|
||||
translate_to_sc=0
|
||||
|
||||
@@ -131,6 +131,9 @@ class Config:
|
||||
def soft_link(self) -> bool:
|
||||
return self.conf.getboolean("common", "soft_link")
|
||||
|
||||
def scan_hardlink(self) -> bool:
|
||||
return self.conf.getboolean("common", "scan_hardlink", fallback=False)#未找到配置选项,默认不刮削
|
||||
|
||||
def failed_move(self) -> bool:
|
||||
return self.conf.getboolean("common", "failed_move")
|
||||
|
||||
@@ -359,6 +362,7 @@ class Config:
|
||||
conf.set(sec1, "failed_output_folder", "failed")
|
||||
conf.set(sec1, "success_output_folder", "JAV_output")
|
||||
conf.set(sec1, "soft_link", "0")
|
||||
conf.set(sec1, "scan_hardlink", "0")
|
||||
conf.set(sec1, "failed_move", "1")
|
||||
conf.set(sec1, "auto_exit", "0")
|
||||
conf.set(sec1, "translate_to_sc", "1")
|
||||
|
||||
Reference in New Issue
Block a user