meizitu

package module
v0.0.0-...-11c5ef0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

README

meizitu

介绍

爬取https://www.mzitu.com 图片

go get gitee.com/zrqcjz/meizitu

(下载失败,可能需要科学代理)

    select {
        //第一个参数是网站的图片tag,一般为汉语拼音,示例:诱惑->youhuo
        //最后一个参数尾页,示例:下载1-3页
	case d := <-meizitu.AsyncSearch("tag", "存放目录(必须存在)", 3):
		fmt.Println("耗时: ", d)
	case <-time.After(10 * time.Minute):
		fmt.Println("超时退出")
		os.Exit(0)
    }

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StartPage int64 = 2
View Source
var TimeOut = 20 * time.Second

Functions

func AsyncSearch

func AsyncSearch(keyword, dir string, endPage ...int64) <-chan time.Duration

func Deduplication

func Deduplication(ss []string) (ar []string)

切片去重

func FileCollector

func FileCollector(referer, dir string, out ...time.Duration) *colly.Collector

func GetSaveFileSum

func GetSaveFileSum() int64

func HtmlCollector

func HtmlCollector(referer, sel string, f colly.HTMLCallback, out ...time.Duration) *colly.Collector

func RandAgent

func RandAgent() string

func RandProxy

func RandProxy() string

func SaveToFile

func SaveToFile(name string, data []byte)
func Search(keyword, dir string, endPage ...int64)

Types

This section is empty.

Jump to

Keyboard shortcuts

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