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,50 @@
{
"source": "oshwhub",
"source_url": "https://oshwhub.com/expert/gai-jin-xin-exlink-duo-gong-neng-diao-shi-qi-fen-li-die-ban",
"project_id": "c8142997cb5c4e43acc5be42f54be6d2",
"title": "Exlink最好用的嵌入式多功能调试器",
"description_short": "Exlink是一款基于ESP32S3设计的优雅的嵌入式多功能调试器具有DAPlink、逻辑分析仪、串口助手、数控电源、无线下载器、无线串口、简易示波器等十余种不同功能涵盖大部分嵌入式调试场景。",
"description_path": "description.md",
"author": {
"username": "expert",
"display_name": "Expert电子实验室",
"user_id": "33e19026ed794dc99d07c4686fe7eb17"
},
"license": "CC BY-NC-SA 3.0",
"tags": [],
"created_at": "2024-09-23T16:22:19.000Z",
"updated_at": "2026-03-18T07:05:51.000Z",
"published_at": "2025-08-25T02:11:58.000Z",
"crawled_at": "2026-04-28T17:00:05.376725+00:00",
"metrics": {
"likes": 804,
"stars": 2024,
"forks": 0,
"views": 135854,
"watch": 0,
"comments": 530
},
"cover": {
"url": "https://image.lceda.cn/oshwhub/ee5d2d79720249efa47d42b06483ead2.png",
"path": "cover.png"
},
"files": [
{
"name": "VID20241019154253.mp4",
"url": "https://image.lceda.cn/oshwhub/project/attachments/be2af8ade36f4503ad6f0c8570709ed1.mp4",
"original_id": "ba894e8c86fa4b17b41abba640c199ac",
"ext": "mp4",
"mime": "video/mp4",
"size": 30984464,
"md5": "e4a1a9d6c49df43cb84159175f21dd46"
}
],
"raw_fields": {
"path": "expert/gai-jin-xin-exlink-duo-gong-neng-diao-shi-qi-fen-li-die-ban",
"grade": 4,
"origin": "pro",
"public": true,
"publish": true,
"skipped_files": []
}
}