From 4dc6f34f2312e70e09913c9165f17bbeef5048a7 Mon Sep 17 00:00:00 2001 From: Changhua Date: Sun, 26 Nov 2023 22:36:41 +0800 Subject: [PATCH] Skip if file exists --- WeChatFerry/spy/funcs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WeChatFerry/spy/funcs.cpp b/WeChatFerry/spy/funcs.cpp index 5f286da..f52702a 100644 --- a/WeChatFerry/spy/funcs.cpp +++ b/WeChatFerry/spy/funcs.cpp @@ -228,6 +228,9 @@ int DownloadAttach(uint64_t id, string thumb, string extra) // 创建父目录,由于路径来源于微信,不做检查 fs::create_directory(fs::path(save_path).parent_path().string()); + if (fs::exists(save_path)) { // 不重复下载 + return 0; + } wstring wsSavePath = String2Wstring(save_path); wstring wsThumbPath = String2Wstring(thumb_path);