[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71JP66C6C3FTC963PG2FT25":3,"skill-same:01M71JP66C6C3FTC963PG2FT25":50},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":5,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M71JP66C6C3FTC963PG2FT25","深夜书单-PDF书籍转为md",null,"FeatherHunter\u002FSKILLS","FeatherHunter","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12967785?v=4","01M71JFD7JMNT8HWC3Y9JKMWGG","王辰浩","01M71JFD8DNYSPJPGX25Y4KX70",6,"MIT","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F深夜书单-PDF书籍转为md\u002FSKILL.md",[],[18],"深夜书单 PDF书籍转为md","2026-11-10 10:12:30",false,"你是OCR处理助手。你的任务：扫描图书馆，找到一本需要OCR处理的PDF，逐页处理每一页为.md文件。\n\n## 关键路径\n- 图书馆目录：D:\\2Study\\StudyNotes\\图书馆（或 \u002Fmnt\u002Fd\u002F2Study\u002FStudyNotes\u002F图书馆）\n- 技能目录：D:\\2Study\\StudyNotes\\SKILLS glm-ocr-to-en-word（或 \u002Fmnt\u002Fd\u002F2Study\u002FStudyNotes\u002FSKILLS\u002Fglm-ocr-to-en-word）\n- API_KEY：b909799341684d51b2565927540b087f.KtmqK8cHzQUpBzln\n- API_URL：https:\u002F\u002Fopen.bigmodel.cn\u002Fapi\u002Fpaas\u002Fv4\u002Flayout_parsing\n\n## 处理逻辑（严格按顺序执行）\n\n### 第1步：扫描找到下一本要处理的书\n扫描图书馆目录下所有.pdf文件，对每本PDF检查：\n- 如果同名目录不存在 → 需要处理\n- 如果同名目录存在但里面page_*.md文件数量 \u003C PDF总页数 → 断点续传，继续处理\n- 如果同名目录存在且page_*.md数量 == PDF总页数 → 已完成，跳过\n\n**取第一本\"需要处理\"的PDF（按字母顺序第一个）为当前任务目标。**\n如果所有书都处理完了（每本PDF都有对应的、page数量等于总页数的目录），直接输出\"所有书籍均已处理完毕，退出。\"并结束。\n\n### 第2步：确认目标\n设：\n- pdf_path = \"D:\\\\2Study\\\\StudyNotes\\\\图书馆\\\\{书名}.pdf\"\n- output_dir = \"D:\\\\2Study\\\\StudyNotes\\\\图书馆\\\\{书名}\"\n\n创建输出目录（如果不存在）。\n\n### 第3步：获取PDF总页数\n用 pymupdf（PyMuPDF）获取PDF总页数。\n\n### 第4步：确定起始页\n扫描output_dir中已有的page_*.md文件，找出最大页码N。则从第N+1页开始处理。\n如果没有任何page_*.md，则从第1页开始。\n\n### 第5步：逐页渲染PNG\n用PyMuPDF将PDF的每一页渲染为PNG图片：\n```python\nimport pymupdf\ndoc = pymupdf.open(pdf_path)\nfor page_num in range(1, doc.page_count + 1):\n    page = doc[page_num - 1]\n    pix = page.get_pixmap(matrix=pymupdf.Matrix(2, 2))\n    pix.save(f\"{output_dir}\u002Fpage_{page_num}.png\")\n```\n\n注意：只渲染尚未生成.png文件的页面（断点续传）。\n\n### 第6步：GLM-OCR识别\n对每一张PNG（从未处理的那页开始），调用GLM-OCR API：\n```python\nimport requests, base64\nAPI_URL = \"https:\u002F\u002Fopen.bigmodel.cn\u002Fapi\u002Fpaas\u002Fv4\u002Flayout_parsing\"\nwith open(png_path, \"rb\") as f:\n    img_base64 = base64.b64encode(f.read()).decode()\nresp = requests.post(API_URL,\n    headers={\"Authorization\": f\"Bearer {API_KEY}\", \"Content-Type\": \"application\u002Fjson\"},\n    json={\"model\": \"glm-ocr\", \"file\": f\"data:image\u002Fpng;base64,{img_base64}\", \"return_crop_images\": False},\n    timeout=120\n)\nmd_content = resp.json().get(\"md_results\", \"\")\n# 保存为 .md 文件\nwith open(md_path, \"w\", encoding=\"utf-8\") as f:\n    f.write(md_content)\n```\n\n注意：\n- 如果该页.md文件已存在，跳过API调用（断点续传）\n- 每页处理完立即保存.md，不要等全部完成\n- 每页之间sleep 1秒，避免API限流\n- 如果API返回error或超时，记录错误页码，继续处理下一页\n\n### 第7步：验证\n处理完成后，统计output_dir中page_*.md的数量，对比PDF总页数。\n如果相等：输出\"✅ {书名} 处理完成，共{N}页\"\n如果不等：输出\"⚠️ {书名} 处理中断，已完成{M}页，还剩{L}页\"\n\n## 重要约束\n- 必须处理完一本书的所有页面才算该书处理完成\n- 不需要翻译，只需要OCR识别后的.md原文\n- 不需要生成Word文件，只生成.md文件\n- 如果API调用失败（超时\u002F报错），记录该页码，继续处理下一页\n- 所有处理过的文件都保存在output_dir中\n- 不要删除任何已存在的文件（断点续传）\n- 每次cron运行只处理一本书，不要同时处理多本\n",{},"main","5b2b73ce2fbb69cd70597cfbbf24c99bc9e94b4c",1,"https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS","https:\u002F\u002Fgithub.com\u002FFeatherHunter","The Boy, The Man, The Human.","2026-09-12 20:33:55",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add FeatherHunter\u002FSKILLS --skill \"深夜书单-PDF书籍转为md\"",{"tool":36,"command":37},"bunx","bunx skills add FeatherHunter\u002FSKILLS --skill \"深夜书单-PDF书籍转为md\"",{"tool":39,"command":40},"pnpm","pnpm dlx skills add FeatherHunter\u002FSKILLS --skill \"深夜书单-PDF书籍转为md\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F深夜书单-PDF书籍转为md\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"深夜书单-PDF书籍转为md.html","REFERENCE","参考文档",8094,"https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F深夜书单-PDF书籍转为md\u002F深夜书单-PDF书籍转为md.html",[51,71,80,89,99,105],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M71JPWVNC5JZ2FD4CSR3SZC1","饼干记账","记账技能。写入类:记支出、记收入、拍账单、批量录入、改记录、撤销、恢复、记报销、记退款、记借出、记借入、记收回、记偿还、记分期。查询类:查今天、查某天、查月、查区间、查分类、搜备注、查标签、查账户、查账本、查欠款、查待报销。分析类:看月度、看总览、看分类、看对比、看趋势、看大额、做统计、看洞察、看借贷。目标\u002F账户\u002F联动:设定预算、看预算、设定目标、看目标、新增账户、改账户、账户转账、看账户汇总、买东西联动、吃饭联动。**所有查询\u002F分析类唤醒词默认 invoke HTML 工作流**(scripts\u002Fbill_inject.py + templates),写入类保持文字回执。能力速查:说「饼干记账 HELP」\u002F「查帮助」\u002F「能做什么」。完整 70 个唤醒词见 references\u002F路由表.md","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F饼干记账\u002FSKILL.md",[],[53,58,59,60,61,62,63,64,65,66,67,68,69,70],"记账","invoke","templates","文字","预算","账单","统计","收入","scripts","html","支出","help","references",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M71JPS100K4E2JN8R3B0F9NR","贴心助理","真实助手 - 主动分析用户状态，关心用户，提供帮助与提醒。不偷懒地联动所有技能，真正像个朋友一样陪伴。","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F贴心助理\u002FSKILL.md",[],[73,78,79],"陪伴","朋友",{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M71JPPN0WZ1ARA081J0JDNPC","美团","安装美团旅游技能(meituan-travel)向导 - 检查 mtskills 商店并安装 meituan-travel","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F美团\u002FSKILL.md",[],[82,87,88],"meituan","travel",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M71JPN921TSX62DXEFY1B8FJ","网易云音乐","安装网易云音乐 CLI 工具(@music163\u002Fncm-cli) - 通过 npm 全局安装","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F网易云音乐\u002FSKILL.md",[],[91,96,97,98],"工具","cli","npm",{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M71JPF82PYTK0NYMJF8Y9E48","私家大厨","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F私家大厨\u002FSKILL.md",[],[101],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M71JPCK6Z5NT3G258NFKEJGG","目录树","目录树技能 - 递归扫描给定目录，输出所有目录和文件的树状结构清单","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002FSKILLS\u002Fblob\u002Fmain\u002F目录树\u002FSKILL.md",[],[112,107,113,114],"目录","文件","文件导航"]