diff --git a/assets/copyright-img/稻壳.png b/assets/copyright-img/稻壳.png new file mode 100644 index 0000000..5280014 Binary files /dev/null and b/assets/copyright-img/稻壳.png differ diff --git a/config/index.js b/config/index.js index 6007970..5906572 100644 --- a/config/index.js +++ b/config/index.js @@ -10,6 +10,7 @@ const config = { * 则直接使用inputDir作为工作目录 */ inputDir: '', + // inputDir: 'E:/商品资料汇总/商品资料(2001-2050)/ppt2005-黄继光', // inputDir: 'C:/Users/Administrator/Desktop/test', // 指定要查找的目录 directoryPath: 'E:/商品资料汇总/商品资料(1201-1250)', diff --git a/py-src/del_copyright_img.py b/py-src/del_copyright_img.py index d2e99fb..88ee906 100644 --- a/py-src/del_copyright_img.py +++ b/py-src/del_copyright_img.py @@ -58,7 +58,7 @@ def remove_copyright_images(pptx_path, copyright_image_paths): # 定义要替换的关键字数组 replace_text_keywords = ["第一PPT"] # 定义要删除的关键字符数组 - del_text_keywords = ["Speaker name and title", "OfficePLUS", "Presenter name", "www.officeplus.cn"] + del_text_keywords = ["Speaker name and title", "OfficePLUS", "Presenter name", "www.officeplus.cn", "第一PPT模板网-WWW.1PPT.COM"] # 遍历每一页幻灯片 for index, slide in enumerate(prs.slides): @@ -145,6 +145,10 @@ def process_ppt_files(directory): # 遍历指定目录下的所有文件 for filename in os.listdir(directory): + # 过滤掉以 ~$ 开头的文件 + if filename.startswith('~$'): + continue + if filename.lower().endswith(('.pptx', '.ppt')): # 只处理 pptx 和 ppt 文件 pptx_file_path = os.path.join(directory, filename) remove_copyright_images(pptx_file_path, copyright_image_paths)