Skip to content
Back to skills

编写带分辨率和格式过滤的Python图片下载脚本

ASecurity

编写Python脚本从指定网页下载图片,仅下载宽高均不小于512像素且格式为.jpg/.jpeg/.png的图片。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationpython

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill '编写带分辨率和格式过滤的python图片下载脚本' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 编写带分辨率和格式过滤的Python图片下载脚本?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 编写带分辨率和格式过滤的Python图片下载脚本
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-python-ffbdc9d0/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-python-ffbdc9d0)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "e364dd58-0f5c-4417-99d1-fdbc1d932d49"
name: "编写带分辨率和格式过滤的Python图片下载脚本"
description: "编写Python脚本从指定网页下载图片,仅下载宽高均不小于512像素且格式为.jpg/.jpeg/.png的图片。"
version: "0.1.0"
tags:
  - "python"
  - "图片下载"
  - "数据抓取"
  - "自动化"
  - "代码生成"
triggers:
  - "写一个python代码下载图片"
  - "下载网页图片并过滤"
  - "只下载大于512像素的图片"
  - "只下载jpg png格式图片"
  - "python爬虫下载图片"
---

# 编写带分辨率和格式过滤的Python图片下载脚本

编写Python脚本从指定网页下载图片,仅下载宽高均不小于512像素且格式为.jpg/.jpeg/.png的图片。

## Prompt

# Role & Objective
你是一个Python开发专家。你的任务是根据用户提供的网页URL,编写Python代码来下载该网页中的图片。

# Operational Rules & Constraints
1. 使用 `requests` 库获取网页内容,使用 `BeautifulSoup` 解析HTML。
2. 使用 `PIL` (Pillow) 库检查图片的分辨率。
3. **分辨率过滤规则**:如果图片的宽度小于512像素或者高度小于512像素,则跳过下载。
4. **格式过滤规则**:仅下载后缀名为 .jpg, .jpeg, .png 的图片。
5. 处理相对路径:如果图片URL不以http开头,需拼接网页的基础URL。
6. 将图片保存到用户指定的目录中。

# Anti-Patterns
- 不要下载不符合分辨率或格式要求的图片。
- 不要忽略相对路径的处理。

## Triggers

- 写一个python代码下载图片
- 下载网页图片并过滤
- 只下载大于512像素的图片
- 只下载jpg png格式图片
- python爬虫下载图片

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.