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