From 7ea3dd23d08aca541a3d13c45e4dcd1cdd09c428 Mon Sep 17 00:00:00 2001 From: EvanQu Date: Tue, 1 Mar 2022 22:01:09 +0800 Subject: [PATCH 1/4] add hard_link option --- Movie_Data_Capture.py | 4 ++-- config.ini | 2 ++ config.py | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Movie_Data_Capture.py b/Movie_Data_Capture.py index 141a241..0bd0fd5 100644 --- a/Movie_Data_Capture.py +++ b/Movie_Data_Capture.py @@ -327,8 +327,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.hard_link())): # 短路布尔 符号链接不取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 diff --git a/config.ini b/config.ini index e611762..18ab665 100755 --- a/config.ini +++ b/config.ini @@ -6,6 +6,8 @@ source_folder=./ failed_output_folder=failed success_output_folder=JAV_output soft_link=0 +; 0: 不刮削硬链接文件 1: 刮削硬链接文件 +hard_link=0 failed_move=1 auto_exit=0 translate_to_sc=0 diff --git a/config.py b/config.py index 0f5654e..230e90f 100644 --- a/config.py +++ b/config.py @@ -131,6 +131,9 @@ class Config: def soft_link(self) -> bool: 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: 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, "hard_link", "1") conf.set(sec1, "failed_move", "1") conf.set(sec1, "auto_exit", "0") conf.set(sec1, "translate_to_sc", "1") From 7f2cef7bae2f73fa06908ce1ff25bfdeb34d1608 Mon Sep 17 00:00:00 2001 From: EvanQu <4098823+HappyQuQu@users.noreply.github.com> Date: Tue, 1 Mar 2022 22:07:03 +0800 Subject: [PATCH 2/4] default false --- config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 230e90f..bf364bf 100644 --- a/config.py +++ b/config.py @@ -132,7 +132,7 @@ class Config: return self.conf.getboolean("common", "soft_link") def hard_link(self) -> bool: - return self.conf.getboolean("common", "hard_link", fallback=False)#未找到配置选项,默认刮削 + return self.conf.getboolean("common", "hard_link", fallback=False)#未找到配置选项,默认不刮削 def failed_move(self) -> bool: return self.conf.getboolean("common", "failed_move") @@ -362,7 +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, "hard_link", "1") + conf.set(sec1, "hard_link", "0") conf.set(sec1, "failed_move", "1") conf.set(sec1, "auto_exit", "0") conf.set(sec1, "translate_to_sc", "1") From 35340eb1e9f92c55d4632a2b0ee7ac0d53a64206 Mon Sep 17 00:00:00 2001 From: EvanQu Date: Tue, 1 Mar 2022 22:08:22 +0800 Subject: [PATCH 3/4] default false --- config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 230e90f..bf364bf 100644 --- a/config.py +++ b/config.py @@ -132,7 +132,7 @@ class Config: return self.conf.getboolean("common", "soft_link") def hard_link(self) -> bool: - return self.conf.getboolean("common", "hard_link", fallback=False)#未找到配置选项,默认刮削 + return self.conf.getboolean("common", "hard_link", fallback=False)#未找到配置选项,默认不刮削 def failed_move(self) -> bool: return self.conf.getboolean("common", "failed_move") @@ -362,7 +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, "hard_link", "1") + conf.set(sec1, "hard_link", "0") conf.set(sec1, "failed_move", "1") conf.set(sec1, "auto_exit", "0") conf.set(sec1, "translate_to_sc", "1") From bd51898ae2e8d6a4b7c5ed5af2a169dc56d9e3b5 Mon Sep 17 00:00:00 2001 From: Qu Date: Mon, 7 Mar 2022 21:33:40 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[update]:hard=5Flink=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E6=94=B9scan=5Fhardlink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Movie_Data_Capture.py | 2 +- config.ini | 2 +- config.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Movie_Data_Capture.py b/Movie_Data_Capture.py index 0bd0fd5..7301cef 100644 --- a/Movie_Data_Capture.py +++ b/Movie_Data_Capture.py @@ -327,7 +327,7 @@ 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 and not conf.hard_link())): # 短路布尔 符号链接不取stat(),因为符号链接可能指向不存在目标 + 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跳过小视频检测 diff --git a/config.ini b/config.ini index 18ab665..c897c4f 100755 --- a/config.ini +++ b/config.ini @@ -7,7 +7,7 @@ failed_output_folder=failed success_output_folder=JAV_output soft_link=0 ; 0: 不刮削硬链接文件 1: 刮削硬链接文件 -hard_link=0 +scan_hardlink=0 failed_move=1 auto_exit=0 translate_to_sc=0 diff --git a/config.py b/config.py index bf364bf..1197fd7 100644 --- a/config.py +++ b/config.py @@ -131,8 +131,8 @@ class Config: def soft_link(self) -> bool: return self.conf.getboolean("common", "soft_link") - def hard_link(self) -> bool: - return self.conf.getboolean("common", "hard_link", fallback=False)#未找到配置选项,默认不刮削 + 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") @@ -362,7 +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, "hard_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")