The imgdl
tool is a command-line utility developed in Go (Golang) to facilitate the download of images from a specified URL. It offers a simple and efficient way to extract image URLs from a webpage and save the images locally.
Currently, there's no installation required for the imgdl
tool. Simply ensure you have Go installed and can compile and run Go programs.
imgdl [command] [URL]
-
Version Command
- Use:
imgdl version
- Description: Displays the current version number of the
imgdl
tool.
- Use:
-
Download Command
- Use:
imgdl get [URL]
- Aliases:
down
,download
,grap
- Description: Downloads all images found in the specified URL from the internet.
- Example:
imgdl get https://example.com
- Use:
-
Version Command (
imgdl version
)- Retrieves and displays the current version of the
imgdl
tool.
- Retrieves and displays the current version of the
-
Download Command (
imgdl get [URL]
)- Downloads images from a provided URL by:
- Fetching the webpage content using HTTP GET.
- Extracting image URLs using regular expressions.
- Saving the images locally within a
saved_images
directory.
- Downloads images from a provided URL by:
net/http
: For making HTTP requests to fetch webpages and images.os
,path/filepath
: For file operations and directory management.regexp
: For using regular expressions to extract image URLs.strings
: For string manipulation.io
: For input/output operations.github.com/spf13/cobra
: CLI library for building command-line applications.
Contributions to this tool are welcome. Feel free to contribute by submitting bug reports, feature requests, or enhancements to the GitHub repository.