agentsclimarketplace

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

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/编写带分辨率和格式过滤的python图片下载脚本

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

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

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.7 KB, 367 tokens by cl100k_base, as published. Nobody here has run it

编写带分辨率和格式过滤的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爬虫下载图片

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.