From 809067fdaff4defc4662f5c24b015c1c26656c35 Mon Sep 17 00:00:00 2001 From: lededev Date: Mon, 19 Apr 2021 17:19:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=94=A8=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=BB=BA=E7=AB=8B=E8=BD=AF=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E4=BE=BF=E7=BD=91=E7=BB=9C=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E4=BB=A5=E6=AD=A3=E7=A1=AE=E6=89=93=E5=BC=80?= =?UTF-8?q?=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core.py b/core.py index 3dc5ae8..1a91a08 100755 --- a/core.py +++ b/core.py @@ -588,7 +588,9 @@ def paste_file_to_folder(filepath, path, number, leak_word, c_word, conf: config targetpath = path + '/' + number + c_word + houzhui # 如果soft_link=1 使用软链接 if conf.soft_link(): - os.symlink(filepath, targetpath) + # 采用相对路径,以便网络访问时能正确打开视频 + filerelpath = os.path.relpath(filepath, path) + os.symlink(filerelpath, targetpath) else: os.rename(filepath, targetpath) # 移走文件后,在原来位置增加一个可追溯的软链接,指向文件新位置 @@ -596,7 +598,8 @@ def paste_file_to_folder(filepath, path, number, leak_word, c_word, conf: config # 便于手工找回文件。并将软连接文件名后缀修改,以避免再次被搜刮。 targetabspath = os.path.abspath(targetpath) if targetabspath != os.path.abspath(filepath): - os.symlink(targetabspath, filepath + '#sym') + targetrelpath = os.path.relpath(targetabspath, file_parent_origin_path) + os.symlink(targetrelpath, filepath + '#sym') sub_res = conf.sub_rule() for subname in sub_res: