Documentation
¶
Index ¶
- func CreateOutputDirs(outputDir, cacheDir string)
- func FetchCommentsForSongs(songIDs []string, userID int, maxPages int, queriesPerSecond int) error
- func SaveCache(songID string, cacheDir string, cache CacheData, userID int) error
- func ScrapePlaylist(playlistIDs []int64) (map[int64][]int64, error)
- type CacheData
- type Comment
- type Config
- type SearchOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchCommentsForSongs ¶
函数接受歌曲ID数组、用户ID、最大页数、并发线程数,并开始抓取评论
Types ¶
type Config ¶
type Config struct {
TargetUserIDs []int64 `json:"userId"`
SearchMethod string `json:"searchMethod"`
SearchOptions SearchOptions `json:"searchOptions"`
MaxPages int `json:"maxPages"`
ConcurrentThreads int `json:"queriesPerSecond"`
IgnoreCompletedTasks bool `json:"ignoreCompletedTasks"`
}
配置的结构体
func (*Config) GetSearchOptionByMethod ¶
func (c *Config) GetSearchOptionByMethod() interface{}
方法返回与搜索方法对应的搜索选项
type SearchOptions ¶
type SearchOptions struct {
PlaylistIDs []int64 `json:"playlists"`
TrackIDs []int64 `json:"singles"`
ListeningRank struct {
RecentWeekAllTime int `json:"week/all"`
} `json:"listening"`
}
搜索选项的结构体
Click to show internal directories.
Click to hide internal directories.