mafengwo-original-images
Skill20 starsChanged 3 months agoMITView on GitHub
Download original-size images from Mafengwo photo and travel-note pages. 用于从马蜂窝图片页或游记页提取原图链接、下载原图、导出链接和文件大小清单,并支持断点续下与校验。
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- diverge-convergeSkill
- wechat-markdown-publisherSkill
- ci-triggerSkill
- dev-lifecycleSkill
- dev-specSkill
- git-flowSkill
- opc-sw-flowSkill
- project-initSkill
- product-lifecycleSkill
- ui-prototype-genSkill
The file
Files
马蜂窝原图下载
目标
当用户提供马蜂窝图片页、游记页或类似页面,并要求下载网页图片时,使用本 skill 提取原始图片链接、去掉缩略图参数、下载原图,并导出:
original_image_links.txt
images/
summary.jsonoriginal_image_links.txt 必须使用以下格式,每行一个原图链接和文件大小,逗号拼接:
https://note.mafengwo.net/img/xx/yy/example.jpeg,1.5M使用场景
当用户说出类似需求时触发:
- “帮我下载马蜂窝图片 https://www.mafengwo.cn/..."
- “不要缩略图,要原图”
- “导出原始图片链接和大小”
- “继续下载剩余图片,不要重复下载”
输出规范
- 只保存原图,不保存缩略图。
- 图片链接必须去掉
?及其后面的压缩、裁剪、质量参数,例如去掉imageView2%2F2%2Fw%2F600%2Fq%2F50。 - 输出文件夹命名为
YYYYMMDD图片下载-地点或网页标题-原图。 - 地点名称优先从页面面包屑、标题或明显地点信息中提取,例如
意大利;没有可靠地点时使用网页标题。 - 原图链接清单命名为
original_image_links.txt。 original_image_links.txt每行格式为原始链接,文件大小M,例如https://note.mafengwo.net/img/xx/yy/example.jpeg,1.5M。- 支持断点续下:已存在且有效的图片不要重复下载,缺失、零字节或损坏的图片需要补下。
执行流程
- 在可渲染页面的浏览器环境中打开马蜂窝 URL。
- 如果马蜂窝出现安全校验、滑块或登录阻断,让用户在浏览器里手动完成后继续。
- 从渲染后的 DOM 中提取图片候选链接,优先读取:
data-original,data-src,data-url,data-rt-src,src. - 只保留正文或图集中的图片,马蜂窝原图通常来自
note.mafengwo.net/img/...。 - 对每个图片链接去掉
?及其后面的所有内容。 - 去重后保存为
raw_image_links.txt,再调用下载脚本。 - 运行
scripts/download_original_images.py完成下载、断点续下、大小统计和清单生成。 - 下载后校验数量、图片有效性,以及最终链接清单中是否仍存在
?或imageView2。
浏览器提取
优先使用宿主 agent 提供的浏览器自动化能力提取渲染后的图片链接。如果没有可用自动化能力,先在普通浏览器完成页面验证,再把以下代码粘贴到 DevTools Console:
copy([...new Set([...document.images]
.map(img => img.dataset.original || img.dataset.src || img.dataset.url || img.dataset.rtSrc || img.src)
.filter(Boolean)
.map(url => url.startsWith("//") ? `https:${url}` : url)
.filter(url => /^https?:\/\//.test(url))
.filter(url => /\.(jpe?g|png|webp|gif)(\?|$)/i.test(url))
.filter(url => /note\.mafengwo\.net\/img\//.test(url))
)].join("\n"))将复制出来的内容保存为 raw_image_links.txt。
下载命令
python3 scripts/download_original_images.py \
--url "https://www.mafengwo.cn/photo/10051/scenery_24796451_1.html" \
--raw-links raw_image_links.txt \
--place "意大利" \
--page-title "从佛罗伦萨到多洛米蒂,繁花盛开的序曲" \
--out-root .脚本会执行以下工作:
- 去掉缩略图 query 参数。
- 对原图链接去重。
- 将文件命名为
original_001.jpeg、original_002.png等。 - 跳过已经下载且有效的图片。
- 重新下载损坏、零字节或缺失的图片。
- 以
M为单位写入文件大小,例如0.2M、1.5M。 - 写入
summary.json和download_check.json。
校验标准
下载完成后运行:
wc -l original_image_links.txt
find images -type f | wc -l
grep -nE 'imageView2|\?' original_image_links.txt
du -sh .预期结果:
- 链接数量等于图片文件数量。
grep检查imageView2或?时没有任何输出。download_check.json中missing和invalid都为 0。- 抽查图片尺寸应接近原图尺寸,而不是 600px 级别的缩略图。
Agent 适配
本 skill 的 SKILL.md 保持 agent-neutral:只描述任务流程、输入输出和校验标准,不绑定某个 agent 的私有工具。需要适配具体 agent 时,只读取对应 adapter:
- Claude Code:
adapters/claude-code.md - OpenClaw:
adapters/openclaw.md - Codex:
adapters/codex.md - Generic browser workflow:
adapters/generic-browser.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

