downloader

package module
v0.0.0-...-f4e1414 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2016 License: MIT Imports: 16 Imported by: 0

README

downloader - Bulk Image DownLoader

Download images using Google Custom Search API.

It's fast because of downloading multiple files in parallel using goroutines.

Installation

$ go get -u github.com/yyoshiki41/gcs-image-downloader/cmd/downloader

Usage

$ downloader --help
usage: downloader --query=QUERY [<flags>]

Image downloader for Google Custom Search API.

Flags:
      --help               Show context-sensitive help (also try --help-long and --help-man).
  -c, --conf="conf"        Config file path
  -o, --outputs="outputs"  Outputs directory
  -q, --query=QUERY        Query
  -n, --number=10          Number of files
  -s, --safe=SAFETY-LEVEL  Safety level: high, medium, off
  -t, --type=IMG-TYPE      Images of a type: clipart, face, lineart, news, photo

Example

$ downloader -q gopher
2016/10/18 23:59:06 Start!
Number: 10
2016/10/18 23:59:23 Download has completed!
Total: 10, Success: 10, Failure: 0

Settings

Docs.

  1. Create a project in the Google Developers Console and turn on the Custom Search API
  2. Get API Key
  3. Create new Custom Search Engine and get Custom Search Engine ID

Configuration

$ cd $GOPATH/src/github.com/yyoshiki41/gcs-image-downloader
$ cp ./conf/credentials.toml.skel ./conf/credentials.toml
# Edit a config file
$ vim ./conf/credentials.toml

License


The MIT License

Author

Yoshiki Nakagawa

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string)

Types

type APICredentials

type APICredentials struct {
	Cx  string `toml:"cx"`
	Key string `toml:"key"`
}

type Config

type Config struct {
	API APICredentials
}

type GcsAPI

type GcsAPI struct {
	url.URL
}

func NewGcsAPI

func NewGcsAPI() *GcsAPI

func (*GcsAPI) Get

func (g *GcsAPI) Get() []byte

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL