打通 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>
3 lines
1.8 KiB
Plaintext
3 lines
1.8 KiB
Plaintext
{"type":"DOCHEAD","ticket":2316}||{"docType":"DEVICE","client":"33e0f1759cdde412","uuid":"4b1bbd5f1a84ec3a","updateTime":1768981063071,"version":"1721978403"}|
|
|
{"type":"META","ticket":2317,"id":"META"}||{"title":"ZX-SH1.0-6PLT","tags":["连接器","线对板针座"],"source":"5c6853ba1b624afa8356254ed237c1e8|0819f05c4eef4c71ace90d822a990e87","images":["https://alimg.szlcsc.com/upload/public/product/middle/20230626/33F1F001174BFD11DE3DA6FC0FC2D4CF.jpg"],"attributes":{"LCSC Part Name":"1x6P 间距:1mm 立贴 系列:SH","Supplier Part":"C7430455","Manufacturer":"Megastar(兆星)","Manufacturer Part":"ZX-SH1.0-6PLT","Supplier Footprint":"SMD,P=1mm","JLCPCB Part Class":"扩展库","Datasheet":"https://atta.szlcsc.com/upload/public/pdf/source/20230619/71A2A909AA52F6058503A77713E762A4.pdf","Supplier":"LCSC","Add into BOM":"yes","Convert to PCB":"yes","Symbol":"c04180d63b21ee45","Designator":"U?","Footprint":"cfd6d571ae8962d7","3D Model":"10d6ea9a3ab947538cc5c23cc299ff3f","3D Model Title":"CONN-SMD_6P-P1.00_ZX-SH1.0-6PLT","3D Model Transform":"328.7395,147.638,0,0,0,0,0,-13.071,0","Pins Structure":"1x6P","Pitch":"1mm","Mounting Style":"立贴","Reference Series":"SH","Number of Pins":"6P","Number of Rows":"1","Number of PINs Per Row":"6","Row Spacing":"-","Current Rating (Max)":"-","Contact Material":"黄铜","Contact Plating":"锡","Operating Temperature Range":"-","Rated Voltage (Max)":"-","Plastic Material":"-","Flame Retardant Rating":"-","Supplementary Features":"辅助焊脚","Colour":"米色","Z-Height of the Board":"4.4mm","X-Length of Bottom Edge on Board (Spacing Line)":"8.35mm","Y-Width of Bottom Edge on Board":"3.74mm","Name":"={Manufacturer Part}","Description":"插针结构:1x6P;间距:1mm;安装方式:立贴;参考系列:SH;总PIN数:6P;排数:1;每排PIN数:6;行距:-;额定电流:-;触头材质:黄铜;触头镀层:锡;工作温度范围:-;"}}|
|