diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 7a75e625..78eb8244 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -158,6 +158,10 @@ }, "active": "b17e861e7080aef8", "lastOpenFiles": [ + "tools/百度站长推送/baiduPush.py", + "tools/百度站长推送/新建文本文档.txt", + "tools/百度站长推送", + "tools/新建文件夹", "beiklive/02.记录/01.工具使用/01.Git.md", "beiklive/Note_Qt/04.问题记录 QT 开机自启动读取文件失败.md", "beiklive/Note_Godot/01.gdscript - 常用代码片段.md", @@ -168,9 +172,6 @@ "tools/新文章生成器/build/main/PYZ-00.toc", "tools/新文章生成器/build/main/PYZ-00.pyz", "tools/新文章生成器/build/main/localpycs/struct.pyc", - "tools/新文章生成器/build/main/localpycs/pyimod04_pywin32.pyc", - "tools/新文章生成器/build/main/localpycs/pyimod03_ctypes.pyc", - "tools/新文章生成器/build/main/localpycs/pyimod02_importers.pyc", "beiklive/Note_Godot/02.着色器 - 图片像素化.md", "beiklive/Note_Godot/03.着色器学习(零)-基础简介.md", "beiklive/Note_Godot/04.着色器学习(一)-基本语法.md", @@ -193,7 +194,6 @@ "beiklive/02.记录/02.折腾记录/00.obsidian.md", "beiklive/02.记录/01.工具使用/03.xmake.md", "beiklive/02.记录/01.工具使用/02.vscode.md", - "beiklive/01.学习/03.夏姬八学/01.other.md", "node_modules/npm/node_modules/promise-retry/node_modules/retry/equation.gif", "node_modules/yamljs/test/lib/jasmine-2.0.0/jasmine_favicon.png", "node_modules/stream-http/test/server/static/browserify.png", diff --git a/baiduPush.sh b/baiduPush.sh index 88ffbcbe..194e7224 100644 --- a/baiduPush.sh +++ b/baiduPush.sh @@ -4,6 +4,6 @@ set -e # 百度链接推送 -curl -H 'Content-Type:text/plain' --data-binary @urls.txt "http://data.zz.baidu.com/urls?site=https://xugaoyi.com&token=T5PEAzhGaPNbjQ2X" +curl -H 'Content-Type:text/plain' --data-binary @urls.txt "http://data.zz.baidu.com/urls?site=doc.beiklive.top&token=wrUX2ETDK1sgdhZA" rm -rf urls.txt # 删除文件 diff --git a/package.json b/package.json index 57ab6985..cc09c24c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "prebuild": "node utils/check.js build && vdoing", "deploy": "bash deploy.sh", "editFm": "node utils/editFrontmatter.js", - "baiduPush": "node utils/baiduPush.js https://xugaoyi.com && bash baiduPush.sh", + "baiduPush": "node utils/baiduPush.js http://doc.beiklive.top && bash baiduPush.sh", "publish": "cd ./vdoing && npm publish && cd .. && yarn updateTheme", "updateTheme": "yarn remove vuepress-theme-vdoing && rm -rf node_modules && yarn && yarn add vuepress-theme-vdoing -D" }, diff --git "a/tools/\347\231\276\345\272\246\347\253\231\351\225\277\346\216\250\351\200\201/baiduPush.py" "b/tools/\347\231\276\345\272\246\347\253\231\351\225\277\346\216\250\351\200\201/baiduPush.py" new file mode 100644 index 00000000..19e9f08e --- /dev/null +++ "b/tools/\347\231\276\345\272\246\347\253\231\351\225\277\346\216\250\351\200\201/baiduPush.py" @@ -0,0 +1,25 @@ +import os +import argparse + +def list_files(startpath, output_file): + base_url = "http://doc.beiklive.top/" + with open(output_file, 'w', encoding='utf-8') as f: + for root, dirs, files in os.walk(startpath): + for file in files: + # 获取相对于起始路径的相对路径 + relative_path = os.path.relpath(os.path.join(root, file), startpath) + # 构建完整的 URL + full_url = base_url + relative_path.replace("\\", "/") + # 写入文件 + f.write(full_url + '\n') + +def main(): + parser = argparse.ArgumentParser(description='列出指定路径下的所有文件并保存到文件中') + parser.add_argument('startpath', help='起始路径') + parser.add_argument('output_file', help='输出文件路径') + args = parser.parse_args() + + list_files(args.startpath, args.output_file) + +if __name__ == "__main__": + main()