xspider

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

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

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

README

xspider

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveJSON

func SaveJSON(v interface{}, filename string) error

SaveJSON SaveJSON

Types

type Douban

type Douban struct{}

Douban Douban

func (Douban) MovieID

func (n Douban) MovieID(raw []byte) DoubanMovie

MovieID MovieID

type DoubanMovie

type DoubanMovie struct {
	ID            string    `json:"id"`
	Title         string    `json:"title"`
	Cover         string    `json:"cover"`
	Director      string    `json:"director"`
	Author        string    `json:"author"`
	Actor         string    `json:"actor"`
	Genre         string    `json:"genre"`
	Area          string    `json:"area"`
	Language      string    `json:"language"`
	DatePublished string    `json:"datepublished"`
	Duration      string    `json:"duration"`
	Alias         string    `json:"alias"`
	IMDb          string    `json:"imdb"`
	Rate          float64   `json:"rate"`
	RatingCount   int       `json:"ratingcount"`
	RatingWeight  []float64 `json:"ratingweight"`
	Tag           []string  `json:"tag"`
	Recommend     []string  `json:"recommend"`
}

DoubanMovie DoubanMovie

type HLSM3u8

type HLSM3u8 struct {
	URL       string
	SubURL    []string
	KeyMethod string
	KeyURI    string
	Segment   []string
	Raw       []byte
}

HLSM3u8 HLSM3u8

type Kuwo

type Kuwo struct{}

Kuwo Kuwo

func (Kuwo) Search

func (k Kuwo) Search(keyword string) []Song

Search Search

func (Kuwo) Song

func (k Kuwo) Song(rid string) Song

Song Song

type Netease

type Netease struct{}

func (Netease) Album

func (n Netease) Album(album int) []Song

Album 获取Album

func (Netease) Artist

func (n Netease) Artist(artistid int) []Song

Artist Artist

func (Netease) LRC

func (n Netease) LRC(songids []int) map[int]string

LRC 获取歌词

func (Netease) Playlist

func (n Netease) Playlist(playlistid int) []Song

Playlist Playlist

func (Netease) Search

func (n Netease) Search(keyword string) []Song

Search Search

func (Netease) Song

func (n Netease) Song(songids []int) map[int]Song

Song 获取Song

func (Netease) SongURL

func (n Netease) SongURL(songids []int) map[int]Song

SongURL 获取真实播放地址

type ProxyPool

type ProxyPool struct {
	URLs        []*url.URL
	MaxDuration int64 //更新间隔
	Lasttime    int64 //最后更新时间
}

ProxyPool ProxyPool

func (ProxyPool) GetOne

func (p ProxyPool) GetOne() *url.URL

GetOne 刷新并随机获取一个

func (*ProxyPool) Refresh

func (p *ProxyPool) Refresh()

Refresh Refresh

type Song

type Song struct {
	WebSite     string `json:"website"`
	Title       string `json:"title"`
	ID          string `json:"id"`
	Alias       string `json:"alias"`
	Artist      string `json:"artist"`
	URL         string `json:"src"`
	Cover       string `json:"pic"`
	Lyric       string `json:"lrc"`
	Album       string `json:"album"`
	ArtistID    string `json:"artist_id,omitempty"`
	AlbumID     int    `json:"albumid,omitempty"`
	CoverImage  []byte `json:"-"`
	Year        string `json:"year,omitempty"`
	Publishtime string `json:"publishtime,omitempty"`
	Lyclng      string `json:"lyclng,omitempty"`
	Lycdesc     string `json:"lycdesc,omitempty"`
	Track       int    `json:"track,omitempty"`
	Size        int    `json:"size,omitempty"`
	Encodetype  string `json:"encodetype,omitempty"`
	Basicrate   int    `json:"basicrate,omitempty"`
}

Song Song

func (*Song) Desc

func (s *Song) Desc() map[string]string

Desc Desc

func (*Song) FromFile

func (s *Song) FromFile(fname string) error

FromFile FromFile

func (Song) UpdateFile

func (s Song) UpdateFile(fname string) error

UpdateFile 更新标签

type Spider

type Spider struct {
	Type    string
	URL     string
	UA      string
	Referer string
	Params  map[string]string
	Proxy   *url.URL
	// contains filtered or unexported fields
}

func (*Spider) Download

func (s *Spider) Download(savepath string) error

Download Download

func (*Spider) DownloadHLSM3u8

func (s *Spider) DownloadHLSM3u8(h HLSM3u8, savepath string) error

DownloadHLSM3u8 DownloadHLSM3u8

func (*Spider) DownloadHLSM3u8FromURL

func (s *Spider) DownloadHLSM3u8FromURL(inurl, savepath string) error

DownloadHLSM3u8FromURL DownloadHLSM3u8FromURL

func (*Spider) DownloadSong

func (s *Spider) DownloadSong(song Song, savepath string) error

DownloadSong DownloadSong

func (*Spider) Fetch

func (s *Spider) Fetch() (*grequests.Response, error)

Fetch Fetch

func (*Spider) FetchBytes

func (s *Spider) FetchBytes() ([]byte, error)

FetchBytes FetchBytes

func (*Spider) FetchHLSM3u8

func (s *Spider) FetchHLSM3u8(inurl string) (h HLSM3u8, err error)

FetchHLSM3u8 FetchHLSM3u8

func (*Spider) JSON

func (s *Spider) JSON(userStruct interface{}) error

JSON JSON

type Video

type Video struct {
	Title    string  `json:"title"`
	CoverURL string  `json:"coverurl"`
	PlayURL  string  `json:"playurl"`
	Height   int     `json:"height"`
	Width    int     `json:"width"`
	Fps      float64 `json:"fps"`
	Duration float64 `json:"duration"`
	Bitrate  float64 `json:"bitrate"`
	Size     int     `json:"size"`
	Format   float64 `json:"format"`
}

Video Video

type WeChat

type WeChat struct{}

func (WeChat) Video

func (w WeChat) Video(weburl string) (video []Video)

type Zhihu

type Zhihu struct{}

func (Zhihu) Video

func (n Zhihu) Video(weburl string) (video []Video)

Jump to

Keyboard shortcuts

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