downloader

package
v0.0.0-...-4f72456 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IstockSearchAPI        = "https://www.istockphoto.com/search/2/image"
	ColorSimilarityAssetid = "colorsimilarityassetid"

	MaxPages       = 20
	MinPages       = 1
	DefaultBackend = "istock_dataset"
	MaxPower       = 32
	MinPower       = 1

	Content = "content"
	Color   = "color"
)
View Source
const (
	Photo         = "photography"
	Illustrations = "illustration"
	Vectors       = "illustration&assetfiletype=eps"

	Square              = "square"
	Vertical            = "vertical"
	Horizontal          = "horizontal"
	PanoramicVertical   = "panoramicvertical"
	PanoramicHorizontal = "panoramichorizontal"

	NoPeople      = "none"
	OnePerson     = "one"
	TwoPeople     = "two"
	GroupOfPeople = "group"

	UNDEFINED = "undefined"
)

Variables

Functions

func RefactorInvalidQueryType

func RefactorInvalidQueryType(queryType, query string) string

RefactorInvalidQueryType Automatically correct deviated parameters back to default values during parameter checking

Types

type Downloader

type Downloader struct {

	// Pages is the size of the data that needs to be collected
	// For demonstration purposes, don't let Pages exceed MinPages and MaxPages
	// During initialization, invalid Pages values will be automatically corrected
	Pages int
	// MediaType defaults to Photo, options can be viewed in typing
	Mediatype string
	// NumberOfPeople defaults to NoPeople, options can be viewed in typing
	NumberOfPeople string
	// Orientations defaults to Square, options can be viewed in typing
	Orientations string
	// Backend is the root directory of the image cache
	// the default value is DefaultBackend
	Backend string
	// Flag is the name of the parent directory where images are stored,
	// and its default value is the keyword you specify, namely Phrase
	Flag     string
	Similar  string
	ProxyURL string
	// contains filtered or unexported fields
}

func NewDownloader

func NewDownloader(phrase string) *Downloader

NewDownloader Initialize the downloader object

func (*Downloader) CloseFilter

func (d *Downloader) CloseFilter()

func (*Downloader) Mining

func (d *Downloader) Mining()

Mining Start the collector

func (*Downloader) MoreLikeThis

func (d *Downloader) MoreLikeThis(istockID int) *Downloader

MoreLikeThis Similarity search

Jump to

Keyboard shortcuts

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