From 0835b4bf3ef3f916531f71ce1c396a4f90240635 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Thu, 8 Oct 2020 12:15:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=8FBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bdshare.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bdshare.py b/bdshare.py index 5d4a8a2..baa4a71 100644 --- a/bdshare.py +++ b/bdshare.py @@ -77,7 +77,11 @@ if __name__ == "__main__": md52 = md.hexdigest() if fs < limit_size: md51 = md52 - share = f'{md52}#{md51}#{fs}#{relpath(i,j["path"])}' + if j['path'] != "": + pa = relpath(i, j["path"]) + else: + pa = split(i)[1] + share = f'{md52}#{md51}#{fs}#{pa}' f2.write(share+'\n') print(f"\r[{e}/{l}]:{share}") e = e + 1