From 105ef611a15234db82ba77325699fdb2791642ce Mon Sep 17 00:00:00 2001 From: yzqzss Date: Sat, 3 Jun 2023 04:50:05 +0800 Subject: [PATCH] revert --- _biliarchiver_upload_bvid.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/_biliarchiver_upload_bvid.py b/_biliarchiver_upload_bvid.py index 1e2ef4a..a45367d 100644 --- a/_biliarchiver_upload_bvid.py +++ b/_biliarchiver_upload_bvid.py @@ -14,9 +14,9 @@ def upload_bvid(bvid): # sample: BiliBili-BV1Zh4y1x7RL_p3 videos_basepath = f'biliarchiver/videos/{bvid}' for identifier in os.listdir(videos_basepath): - # if os.path.exists(f'{videos_basepath}/{identifier}/_uploaded.mark'): - # print(f'{identifier} 已经上传过了(_uploaded.mark)') - # continue + if os.path.exists(f'{videos_basepath}/{identifier}/_uploaded.mark'): + print(f'{identifier} 已经上传过了(_uploaded.mark)') + continue if identifier.startswith('_') : print(f'跳过 {identifier}') continue @@ -34,11 +34,11 @@ def upload_bvid(bvid): item = get_item(identifier) if item.exists: print(f'item {identifier} 已存在(item.exists)') - # if item.metadata.get("upload-state") == "uploaded": - # print(f'{identifier} 已经上传过了,跳过(item.metadata.uploaded)') - # with open(f'{videos_basepath}/{identifier}/_uploaded.mark', 'w', encoding='utf-8') as f: - # f.write('') - # continue + if item.metadata.get("upload-state") == "uploaded": + print(f'{identifier} 已经上传过了,跳过(item.metadata.uploaded)') + with open(f'{videos_basepath}/{identifier}/_uploaded.mark', 'w', encoding='utf-8') as f: + f.write('') + continue filedict = {} # "remote filename": "local filename" for filename in os.listdir(f'{videos_basepath}/{identifier}/extra'): file = f'{videos_basepath}/{identifier}/extra/{filename}'