From booking-hotel-photos
Batch scrape and download hotel photos from Booking.com (Playwright + requests). Use when the user wants to download/save/scrape hotel photos from Booking.com, or mentions booking hotel images, 酒店照片, 抓取 booking 图片, booking_photos, hotel gallery download, or specifies a city/hotel name for photo scraping. Supports: city/hotel name search, configurable hotel count, image size selection, output directory, concurrent download workers, fetch-only and download-only modes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/booking-hotel-photos:booking-hotel-photosThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
从 Booking.com 批量爬取酒店照片并下载到本地。
从 Booking.com 批量爬取酒店照片并下载到本地。
从用户对话中提取以下参数(未提及的使用默认值):
| 参数 | 提取规则 | 默认值 |
|---|---|---|
query | 城市名或酒店名(必填,用户未提供时主动询问) | — |
hotels | 数字 + "家" → 该数字 | 3 |
size | "大/大图/large" → large;"超大/xlarge" → xlarge;"中/medium" → medium;"缩略/thumb" → thumb | large |
output | "到/保存到/下载到 + 路径" → 该路径 | ./booking_photos |
workers | "并发 + 数字" → 该数字 | 3 |
pages | "第 N 页" 或 "翻 N 页" → 该数字 | 1 |
only_fetch | "只抓链接/只获取URL/不下载" → true | false |
only_download | "只下载/用已有链接下载" → true | false |
urls_file | "用/从 + 文件名" → 该文件路径 | ./urls.json |
headless | "无界面/后台" → true | false |
query=大阪, hotels=3query=东京, hotels=5, size=large, output=~/Picturesquery=拉斯维加斯, only_fetch=trueonly_download=truehotels=10, workers=5skill 触发后先执行检测。仅在依赖缺失时安装,避免每次重复安装。
SKILL_DIR 为 skill 所在目录(即本 SKILL.md 的上级目录)。
SKILL_DIR="<skill 目录绝对路径>"
cd "$SKILL_DIR"
# 先检测依赖
python3 -c "import playwright, requests; print('deps ok')" || \
(python3 -m pip install -r requirements.txt && python3 -m playwright install chromium)
test -f config.json || cp config.example.json config.json
首次安装约 1–2 分钟。完成后告知用户「依赖已就绪」,再继续任务。
使用 src/download.py 一键执行(fetch + download):
cd "$SKILL_DIR"
python3 src/download.py -q "<query>" --hotels <N> --size <size> -o <output> -w <workers> --headless
或分步执行:
# 只抓链接
python3 src/fetch_urls.py -q "<query>" --max-hotels <N> --image-size <size> --headless -o <urls_file>
# 只下载
python3 src/download_photos.py -i <urls_file> -o <output> -w <workers>
必须包含:
| 情况 | 处理 |
|---|---|
| Playwright 未安装 | 自动执行 python3 -m playwright install chromium |
| 搜索页加载失败 | 重试 3 次,仍失败则报错并告知用户 |
| 某酒店图片获取失败 | 跳过该酒店,继续其余,最终汇报失败的酒店名 |
| 下载失败 | 每张图片自动重试 3 次(指数退避),最终汇报失败数 |
| 依赖安装失败 | 告知用户手动运行 pip install -r requirements.txt && playwright install chromium |
reference.md — 技术架构说明Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub jimuzhe/booking-hotel-photos --plugin booking-hotel-photos