crawler: --no-cover, --concurrency, drop cross-host sleep + batch-50 Step 1 done

Three crawler ergonomics for batch operations:

--no-cover  Skip cover image download. For scan-only modes (license/meta
            scrape) this drops ~1.3s/project and avoids slow-CDN hangs.

--concurrency N  ThreadPoolExecutor wrapping the per-project loop. Default
                 1 = serial (current behavior). Anonymous endpoints tolerate
                 5+ comfortably; output uses a print lock for readable
                 interleaved progress. fetch_cover plumbs through crawl_one.

Drop cross-host sleep #1: in crawl_one between detail HTML (oshwhub.com)
and cover image (image.lceda.cn). Different hosts — sleep was unnecessary.
Saves ~1s/project. Sleep #2 (post-cover, before next iteration) stays — it
gates the next oshwhub.com hit.

download_to gains max_seconds wall budget (default 60s, cover uses 15s).
Defends against pathologically slow CDN connections — observed 10 KB/s
on image.lceda.cn for one project, would have hung 6+ min on a 3.6 MB
cover otherwise. httpx default timeout resets per chunk, so streaming
downloads need an external wall-clock guard.

batch-50 Step 1 (license/meta scrape) shipped:
  50/50 candidates have metadata.json + license recorded
  License distribution: GPL 3.0 32, Public Domain 6, NC variants 8,
                        CERN-OHL 1, MIT 1, CC BY 3.0 1
  Forge-friendly (non-NC): 41/50 (82%)
  Declared attachments: 180 files / 2.36 GB (median 18 MB/proj, max 304 MB)
  Walltime: 3min 26s for 28 projects at concurrency=5 (server-side
            HTML render bound, not sleep-bound)

One orphan partial cover (a670e60a...) cleaned up — leftover from the
first aborted run before the timeout fix landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-29 01:35:11 +08:00
parent fe6971f3f9
commit c6fd111d6d
171 changed files with 5410 additions and 17 deletions

View File

@@ -0,0 +1,104 @@
{
"source": "oshwhub",
"source_url": "https://oshwhub.com/bukaiyuan/ESP32-hang-mu-yao-kong-qi",
"project_id": "2246f96d10b04e94bf3170bb4837d647",
"title": "ESP32 万能遥控器",
"description_short": "基于ESP32-S3做一个万能的遥控器作为以后各种RC模型机器人的通用控制方案。\n还可以蓝牙连接电脑玩游戏或者在遥控器上玩自己编写的游戏。",
"description_path": "description.md",
"author": {
"username": "bukaiyuan",
"display_name": "科技大卜玩",
"user_id": "33524017c335440c83753c5f5dde11c1"
},
"license": "GPL 3.0",
"tags": [],
"created_at": "2023-08-01T13:42:52.000Z",
"updated_at": "2026-04-24T01:47:05.000Z",
"published_at": "2023-09-27T05:44:40.000Z",
"crawled_at": "2026-04-28T17:01:11.337592+00:00",
"metrics": {
"likes": 828,
"stars": 1634,
"forks": 0,
"views": 123542,
"watch": 0,
"comments": 191
},
"cover": {
"url": "https://image.lceda.cn/pullimage/F1q5Xo9lCwwJJ46DYpTFkR3KA8CXI8DGy76ZgKoi.jpeg",
"path": "cover.jpeg"
},
"files": [
{
"name": "手柄代码.zip",
"url": "https://image.lceda.cn/attachments/2023/8/5OgNIrJmTWWEgtn6J2pqB7Fh8YR8m2OhZwVZ7ACP.zip",
"original_id": "6a79ed4903c44f5a816e6f00ed3bdffe",
"ext": "zip",
"mime": "application/x-zip-compressed",
"size": 385138,
"md5": "424e2fdab624f8448e2e9b3a083da923"
},
{
"name": "遥控器外壳V2.zip",
"url": "https://image.lceda.cn/attachments/2023/8/vutG1sa4z615AmnrFc5feZBKxaVwSvP3D6hP42Zg.zip",
"original_id": "2143750c1e0a4617b62db39b71abfa66",
"ext": "zip",
"mime": "application/x-zip-compressed",
"size": 2988491,
"md5": "d82505c3bb6f8678e13f2691e01a3e12"
},
{
"name": "制作PCB文件.zip",
"url": "https://image.lceda.cn/attachments/2023/8/4gIKYGuSGjK8sAoWQWtTihpUeLCMeSJPNNvzOZG9.zip",
"original_id": "93117607af0649d8be117a630da54173",
"ext": "zip",
"mime": "application/x-zip-compressed",
"size": 233489,
"md5": "b6e2dbe9eaf70259924d222482468ff6"
},
{
"name": "硬件清单.xlsx",
"url": "https://image.lceda.cn/attachments/2023/8/GlvuFE8wIQdIWDN1U8LfSmB6AcjzXr783HP3ypci.xlsx",
"original_id": "2f1045b6624e46c7980810eba83c757c",
"ext": "xlsx",
"mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"size": 15098,
"md5": "36c5fba502b2e9c0c6167771cc6e94ad"
},
{
"name": "演示.mp4",
"url": "https://image.lceda.cn/attachments/2023/8/ZzdFaaQI8mu3yiZPBoiwBPLsYvKBgBAs4qAI4F2E.mp4",
"original_id": "4bb9ef96a23f4486b0d54d28617948ee",
"ext": "mp4",
"mime": "video/mp4",
"size": 31930265,
"md5": "6e09b0c409081dcbb35d8752649d1b38"
},
{
"name": "图标.zip",
"url": "https://image.lceda.cn/attachments/2023/9/qa8XCqOAeJWCDvbFuBtlpg7WOvbuWuuqGVl3130G.zip",
"original_id": "476816c852434f388f9c866f0ad4fa90",
"ext": "zip",
"mime": "application/x-zip-compressed",
"size": 311221,
"md5": "0621781a294041163626dac760fdab56"
},
{
"name": "遥控器系统框架代码.zip",
"url": "https://image.lceda.cn/attachments/2023/9/TcNec8A1AMbo0VWky0E7a5Wgys4RDU4AVFpTGkOi.zip",
"original_id": "e9f33c590fd8483d9a4ab6f50bc08aec",
"ext": "zip",
"mime": "application/x-zip-compressed",
"size": 1065473,
"md5": "604e7caf303dcd8bcc6ebfab4dcdec64"
}
],
"raw_fields": {
"path": "bukaiyuan/ESP32-hang-mu-yao-kong-qi",
"grade": 3,
"origin": "pro",
"public": true,
"publish": true,
"skipped_files": []
}
}