Coder Social home page Coder Social logo

robinbraemer / imaget Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 914 KB

Convenient image downloader tool for the command line making it way simpler to find and download hundreds of images from selected websites as easy and quick as possible.

License: MIT License

Go 100.00%
image-downloader image downloader tool command-line-tool cli commandline-tool golang convenient

imaget's Introduction

imaget

Imaget is a convenient image tool for finding images on any http(s) website and downloading them with optional flags to tweak tool behaviour and images output.

Imaget makes sure to only download the necessary bytes. Therefore, remembers image URLs and caches the downloads in the temporary directory of your operating system (/tmp/imaget/ for linux) to skip already downloaded images and also auto-resume incomplete downloads when canceled in the past.

The tool is user-friendly and can also be used in automation since the -y (skip user accept screen) or -t (timeout download) and other flags are provided for convenience of use.

Install

No worries, installation is straight forward!

Requirements:

Install with Go:

git clone https://github.com/robinbraemer/imaget.git
cd imaget
go install cmd/imaget.go

Test with Docker:

docker run -it --rm golang:1.15
git clone https://github.com/robinbraemer/imaget.git
cd imaget
go install cmd/imaget.go

Now try running imaget in your command line!

Showcase

While there are many more use cases for this tool this video shows 3 sample commands and how much faster it is due to the smart cache functionality used when running the last command twice.

  1. Download Google's current image above the search box.
    • imaget -s -f -u google.com
  2. Download all images found on amazon.com to new Zip archive.
    • imaget -y -f -u amazon.com -d amazon-images.zip
  3. Download all images found on alibaba.com to hierarchical directories.
    • imaget -y -u alibaba.com -d alibaba-images
  4. Re-run 3. to see how much faster the download is thanks to automatic cache use.
    • imaget -y -u alibaba.com -d alibaba-images

Showcase

Usage

This is what's outputted when typing imaget in your command line.

usage: imaget -u URL [-d destination] [-t timeout] [-r regex] [-y] [-s] [-f]

Imaget is a convenient image tool for finding images on any http(s) website and
downloading them with optional flags to tweak tool behaviour and images output.

Flags
-----------------

-u (required): is the http(s) URL to find and images from to download.

-d (optional): is the destination to download the images to.
               It can either be the directory to save all images at or
               a path to create a .zip archive to save the images in.

-f (optional): saves the downloaded images as a flat hierarchie,
               instead of creating subdirectories as per the image download URLs.
               The name of the file is the base64 encoded download URL of the image.

-t (optional): is the timeout to wait before pausing the download
               and quitting the programm. Zero or below means no timeout.
               Example: 3m3s

-r (optional): is a regular expression to only download images from matching URLs.
               Examples: "(jpg|png)$", "^https?://"

-y (optional): starts the download directly without asking.

-s (optional): will make the console silent and produce no console output.
               If used the -y flag is used automatically.

Example commands
-----------------

Silently download Google's current image above the search box to the current directory.
> imaget -s -f -u google.com	

Download all images on amazon.com to new Zip archive in the current directory.
> imaget -y -f -u amazon.com -d amazon-images.zip

Download all images on alibaba.com to new directory 'alibaba-images' hierarchically sorted by image URL.
> imaget -y -u alibaba.com -d alibaba-images

Extend

The current features of the tool provide a sufficient foundation to other developers to extend functionality and support more advanced use cases such as...

  • Log into Instagram/Pinterest/Facebook/... and download a complete image history
  • Build out an image web crawler to automatically find baby groots in the wild ;)
    • allow many, many crawlers using a database for caching and distributed coordination

Which button was it again? (╯°□°)╯︵ ┻━┻ Baby Groot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.