name: download_image description: A robust, "Honey Badger" image downloader that bypasses strict CDNs, ignores misleading Content-Types, and falls back to scraping if a direct link fails. dependencies: python: - requests - beautifulsoup4 node: []
binaries: []
Image Downloader (Honey Badger Edition) ๐ผ๏ธ
This skill is designed to be resilient. It doesn't trust HTTP headers; it trusts the actual file bytes. Use this to download images from the web even when servers try to block bots or serve incorrect MIME types.
๐ก๏ธ Robust Features:
- Byte Sniffing: Ignores
Content-Typeheaders (oftenbinary/octet-stream) and checks the file signature (magic numbers) to detect JPEGs, PNGs, GIFs, and WEBPs. - Smart Fallback: If the URL returns HTML instead of an image, it automatically switches to scraping mode to find the high-res
og:imageortwitter:imagetags. - Stealth Mode: Uses a modern Chrome User-Agent to bypass basic anti-bot protections.
๐ Execution Command:
run_command("python skills/download_image/main.py '<url>' 'temp/<filename>'")
๐ Requirements:
- URL: A direct image link OR a page URL (Reddit, Pinterest, 4KWallpapers, etc.).
- Filename: Descriptive name (e.g.,
lisa_figaro.jpg). Always save totemp/.
๐ค Output Handling:
To show the image to the user, use a concise description: .
[!WARNING] DO NOT wrap your entire response inside the
![alt-text]part of the image tag. Keep the alt-text short (e.g., "image" or "Lisa photo").
โ ๏ธ Dependencies:
requestsbeautifulsoup4