打通 oshwhub origin=pro 现代 Pro 3.x 工程的 EPRO2 源抓取链路。3/5
modern Pro 项目完整解出(共 8423 docs / 542 MB plain):
- X86 主板 7374 docs / 481 MB plain (chain=85, editor=3.2.15)
- 220V 桌面电源 771 docs / 26 MB plain (chain=28, editor=3.2.69)
- ESP-VoCat 278 docs / 7.5 MB plain (chain=12, editor=3.2.91)
剩余 2/5 是 legacy Pro 2.x(立创泰山派 RK3566、梁山派),项目 meta
返回 branch_uuid=null + editorVersion="2.1.40",没有 git-style chain
模型,文档直接挂在 boards[].sch/pcb 字段上,访问端点暂未挖通;元
数据落库 metadata.json,source/ 留空。
实现要点:
- fetch_pro_source(): 4 步流程(project → branch HEAD → structures
→ /branches/<B>/histories/<HEAD> 即返完整 chain,无需 ?limit 批量
端点)+ 逐 history 走 AES-128-GCM 解密(16 字节 IV,pycryptodome
原生支持)+ gunzip + 按 DOCHEAD 切 per-doc EPRO2 流
- EPRO2 解析坑:行末单 `|` 是行终止符不是字段分隔符,必须先
rstrip("|") 再 split("||"),否则 payload JSON 解析失败 silently
swallow 导致 cur_doc 不设 → 第一轮 X86 板 7374 docs 抽出来只剩 2 个
- docType 实测远不止 BOARD/PCB/SCH/SCH_PAGE,还含 SYMBOL /
FOOTPRINT / DEVICE / BLOB / FONT / CONFIG —— Pro 把组件库快照也
随项目存到 history,下游做 EPRO2→KiCad 转换时必须先把这些 lib
doc 加载进 symbol cache
- Pro 2.x vs 3.x 是不同存储模型 —— 3.x 走 branch 模型(已打通),
2.x 走 boards[] 直链(未打通);判别条件:project meta 的
branch_uuid 是否为 null
CLI 新增 --with-pro-source / --backfill-pro-source / --pro-cookie /
--origin(按 origin 字段服务端过滤 listing API),crawl_one() 按
origin=pro 自动 dispatch 到 Pro fetcher。
schema:docType 类型从 integer 放宽到 [integer, string, null]
(兼容 Std 的 1/3 + Pro 的 BOARD/SCH 等),新增 message_count 字段。
License 注意:本批 5 个项目全是 NC-SA / GPL,未达 Pro source doc
§4.2 Forge 白名单(MIT/BSD/Apache/CC0/CC-BY/CERN-OHL-P/Unlicense)。
按 CLAUDE.md "研究用、不再分发" 原则 raw 入库无碍;Forge 投影时
另过白名单。
详细技术细节见 docs/sources/easyeda_pro_source.md rev 3 + log.md。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
36 lines
9.8 KiB
Plaintext
36 lines
9.8 KiB
Plaintext
{"type":"DOCHEAD","ticket":130}||{"docType":"SYMBOL","client":"0bb2c9fe-c897-4bff-b46c-eaa1f7c27461","uuid":"7537602ea17f4959bc037486699e02dc","updateTime":1749545733000,"version":"1742922124","editVersion":"3.2.91","user":{"uuid":"16555ec60452466ea4dbaa7c6b92cd89","nickname":"乐鑫小铁匠","username":"esp-college","avatar":"//image.lceda.cn/avatars/2023/7/DgnM9iWggXtWZa70BQwJnpb1x7P2etO5s7i6vqxp.png"}}|
|
|
{"type":"DOCHEAD","ticket":131}||{"docType":"SYMBOL","client":"0bb2c9fe-c897-4bff-b46c-eaa1f7c27461","uuid":"7537602ea17f4959bc037486699e02dc","updateTime":1749545733000,"version":"1742922124","editVersion":"3.2.91","user":{"uuid":"16555ec60452466ea4dbaa7c6b92cd89","nickname":"乐鑫小铁匠","username":"esp-college","avatar":"//image.lceda.cn/avatars/2023/7/DgnM9iWggXtWZa70BQwJnpb1x7P2etO5s7i6vqxp.png"}}|
|
|
{"type":"META","ticket":132,"id":"META"}||{"title":"AO3400A","description":"AO3400A","tags":["三极管/MOS管/晶体管","场效应管(MOSFET)"],"docType":2,"source":"797c499756fa423ab81653205133cd20|0819f05c4eef4c71ace90d822a990e87"}|
|
|
{"type":"DOCHEAD"}||{"docType":"SYMBOL","client":"3fab08e087a32154","uuid":"7537602ea17f4959bc037486699e02dc","updateTime":1749545733000,"version":"1742922124","editVersion":"3.2.91","user":{"uuid":"16555ec60452466ea4dbaa7c6b92cd89","nickname":"乐鑫小铁匠","username":"esp-college","avatar":"//image.lceda.cn/avatars/2023/7/DgnM9iWggXtWZa70BQwJnpb1x7P2etO5s7i6vqxp.png"}}|
|
|
{"type":"CANVAS","ticket":1,"id":"CANVAS"}||{"originX":0,"originY":0}|
|
|
{"type":"PART","ticket":2,"id":"AO3400A.1"}||{"BBOX":[-10.5,-10.5,24.5,10.5],"title":"AO3400A.1"}|
|
|
{"type":"ATTR","ticket":3,"id":"e1"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":1,"parentId":"","key":"Symbol","value":"AO3400A","keyVisible":false,"valueVisible":false,"x":null,"y":null,"rotation":0,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":false,"underline":false,"italic":false,"fontWeight":false,"align":"LEFT_BOTTOM","version":"2.0"}|
|
|
{"type":"ATTR","ticket":4,"id":"e2"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":2,"parentId":"","key":"Designator","value":"Q?","keyVisible":false,"valueVisible":false,"x":null,"y":null,"rotation":0,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":false,"underline":false,"italic":false,"fontWeight":false,"align":"LEFT_BOTTOM","version":"2.0"}|
|
|
{"type":"ELE_PLACEHOLDER","ticket":5,"id":"placeholder1"}||{"dataType":"POLY","max":2}|
|
|
{"type":"POLY","ticket":6,"id":"e3"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":3,"points":[{"x":0,"y":0},{"x":6,"y":2},{"x":6,"y":2},{"x":6,"y":-2},{"x":6,"y":-2},{"x":0,"y":0}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":7,"id":"e4"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":4,"points":[{"x":20,"y":-2},{"x":17,"y":3},{"x":17,"y":3},{"x":23,"y":3},{"x":23,"y":3},{"x":20,"y":-2}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":8,"id":"e5"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":5,"points":[{"x":0,"y":-7},{"x":10,"y":-7},{"x":10,"y":-7},{"x":10,"y":-10},{"x":10,"y":-10},{"x":20,"y":-10},{"x":20,"y":-10},{"x":20,"y":-2}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":9,"id":"e6"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":6,"points":[{"x":0,"y":0},{"x":10,"y":0},{"x":10,"y":0},{"x":10,"y":10},{"x":10,"y":10},{"x":20,"y":10},{"x":20,"y":10},{"x":20,"y":3}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":10,"id":"e7"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":7,"points":[{"x":10,"y":7},{"x":0,"y":7}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":11,"id":"e8"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":8,"points":[{"x":-2,"y":-9},{"x":-2,"y":9}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":12,"id":"e9"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":9,"points":[{"x":0,"y":-9},{"x":0,"y":-5}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":13,"id":"e10"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":10,"points":[{"x":0,"y":2},{"x":0,"y":-2}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":14,"id":"e11"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":11,"points":[{"x":0,"y":9},{"x":0,"y":5}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":15,"id":"e12"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":12,"points":[{"x":-10,"y":0},{"x":-2,"y":0}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"POLY","ticket":16,"id":"e13"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":13,"points":[{"x":24,"y":-2},{"x":22,"y":-2},{"x":22,"y":-2},{"x":18,"y":-2},{"x":18,"y":-2},{"x":16,"y":-2}],"closed":false,"strokeColor":null,"strokeStyle":null,"fillColor":null,"strokeWidth":null,"fillStyle":null}|
|
|
{"type":"ELE_PLACEHOLDER","ticket":17,"id":"placeholder2"}||{"dataType":"PIN","max":13}|
|
|
{"type":"PIN","ticket":18,"id":"e14"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":14,"display":true,"x":10,"y":-20,"length":10,"rotation":270,"color":null,"pinShape":"NONE"}|
|
|
{"type":"ATTR","ticket":19,"id":"e15"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":15,"parentId":"e14","key":"Pin Name","value":"D","keyVisible":false,"valueVisible":false,"x":13,"y":-5.08502,"rotation":90,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":false,"underline":false,"italic":false,"fontWeight":false,"align":"RIGHT_BOTTOM","version":"2.0"}|
|
|
{"type":"ATTR","ticket":20,"id":"e16"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":16,"parentId":"e14","key":"Pin Number","value":"3","keyVisible":false,"valueVisible":false,"x":9,"y":-9.08502,"rotation":90,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":false,"underline":false,"italic":false,"fontWeight":false,"align":"LEFT_BOTTOM","version":"2.0"}|
|
|
{"type":"ATTR","ticket":21,"id":"e17"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":17,"parentId":"e14","key":"Pin Type","value":"Undefined","keyVisible":false,"valueVisible":false,"x":10,"y":-20,"rotation":0,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":null,"underline":null,"italic":null,"fontWeight":null,"align":"LEFT_BOTTOM","version":"2.0"}|
|
|
{"type":"ELE_PLACEHOLDER","ticket":22,"id":"placeholder3"}||{"dataType":"PIN","max":3}|
|
|
{"type":"PIN","ticket":23,"id":"e18"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":18,"display":true,"x":-20,"y":0,"length":10,"rotation":0,"color":null,"pinShape":"NONE"}|
|
|
{"type":"ATTR","ticket":24,"id":"e19"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":19,"parentId":"e18","key":"Pin Name","value":"G","keyVisible":false,"valueVisible":false,"x":-7,"y":4.91498,"rotation":0,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":false,"underline":false,"italic":false,"fontWeight":false,"align":"LEFT_BOTTOM","version":"2.0"}|
|
|
{"type":"ATTR","ticket":25,"id":"e20"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":20,"parentId":"e18","key":"Pin Number","value":"1","keyVisible":false,"valueVisible":false,"x":-11,"y":0.91498,"rotation":0,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":false,"underline":false,"italic":false,"fontWeight":false,"align":"RIGHT_BOTTOM","version":"2.0"}|
|
|
{"type":"ATTR","ticket":26,"id":"e21"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":21,"parentId":"e18","key":"Pin Type","value":"Undefined","keyVisible":false,"valueVisible":false,"x":-20,"y":0,"rotation":0,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":null,"underline":null,"italic":null,"fontWeight":null,"align":"LEFT_BOTTOM","version":"2.0"}|
|
|
{"type":"ELE_PLACEHOLDER","ticket":27,"id":"placeholder4"}||{"dataType":"PIN","max":3}|
|
|
{"type":"PIN","ticket":28,"id":"e22"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":22,"display":true,"x":10,"y":20,"length":10,"rotation":90,"color":null,"pinShape":"NONE"}|
|
|
{"type":"ATTR","ticket":29,"id":"e23"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":23,"parentId":"e22","key":"Pin Name","value":"S","keyVisible":false,"valueVisible":false,"x":13,"y":8.91498,"rotation":90,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":false,"underline":false,"italic":false,"fontWeight":false,"align":"LEFT_BOTTOM","version":"2.0"}|
|
|
{"type":"ATTR","ticket":30,"id":"e24"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":24,"parentId":"e22","key":"Pin Number","value":"2","keyVisible":false,"valueVisible":false,"x":9,"y":12.91498,"rotation":90,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":false,"underline":false,"italic":false,"fontWeight":false,"align":"RIGHT_BOTTOM","version":"2.0"}|
|
|
{"type":"ATTR","ticket":31,"id":"e25"}||{"partId":"AO3400A.1","groupId":"","locked":false,"zIndex":25,"parentId":"e22","key":"Pin Type","value":"Undefined","keyVisible":false,"valueVisible":false,"x":10,"y":20,"rotation":0,"color":null,"fillColor":null,"fontFamily":null,"fontSize":null,"strikeout":null,"underline":null,"italic":null,"fontWeight":null,"align":"LEFT_BOTTOM","version":"2.0"}|
|