Documentation
¶
Index ¶
- Constants
- func ParseURL(link string) (model.Info, error)
- type APIClient
- func (c *APIClient) DoRequest(url string, result any) error
- func (c *APIClient) GetEpisodeInfo(bvid string) (*EpisodeResponse, error)
- func (c *APIClient) GetSeasonEpisodesByPage(mid, seasonID string, pageNum, pageSize int) (*SeasonArchivesResponse, error)
- func (c *APIClient) GetSeriesEpisodesByPage(mid, seriesID string, pageNum, pageSize int) (*SeriesArchivesResponse, error)
- func (c *APIClient) GetSeriesInfo(seriesID string) (*SeriesInfoResponse, error)
- func (c *APIClient) GetUserEpisodesByPage(mid string, pageNum, pageSize int) (*UserEpisodesResponse, error)
- func (c *APIClient) GetUserInfo(mid string) (*UserResponse, error)
- type Archive
- type BilibiliBuilder
- type Builder
- type Downloader
- type EpisodeResponse
- type SeasonArchivesResponse
- type SeriesArchivesResponse
- type SeriesInfoResponse
- type SoundCloudBuilder
- type TwitchBuilder
- type UserEpisodesResponse
- type UserResponse
- type VimeoBuilder
- type YouTubeBuilder
Constants ¶
View Source
const ( // 剧集信息API // https://api.bilibili.com/x/web-interface/view?bvid=BV1KDskz1EHD EpisodeInfoAPI = "https://api.bilibili.com/x/web-interface/view?bvid=%s" // 用户信息API UserInfoAPI = "https://api.bilibili.com/x/web-interface/card?mid=%s" // 用户剧集列表API ps max 100, ps=0显示全部 // https://api.bilibili.com/x/series/recArchivesByKeywords?mid=1596926736&keywords&ps=0 UserEpisodesAPI = "https://api.bilibili.com/x/series/recArchivesByKeywords?keywords=&mid=%s&pn=%d&ps=%d" // Season类型播放列表信息API ps max 100 // https://api.bilibili.com/x/polymer/web-space/seasons_archives_list?season_id=678635&mid=7380321&page_num=1&page_size=100 SeasonInfoAPI = "https://api.bilibili.com/x/polymer/web-space/seasons_archives_list?season_id=%s&mid=%s&page_num=%d&page_size=%d" // Series类型播放列表信息API // https://api.bilibili.com/x/series/series?series_id=1067956 SeriesInfoAPI = "https://api.bilibili.com/x/series/series?series_id=%s" // Series类型播放列表剧集API ps=0显示全部 // https://api.bilibili.com/x/series/archives?mid=7458285&series_id=1067956&ps=0&pn=1 SeriesEpisodesAPI = "https://api.bilibili.com/x/series/archives?mid=%s&series_id=%s&ps=%d&pn=%d" MaxBilibiliPageSize = 100 )
API URL常量
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient API客户端
func (*APIClient) GetEpisodeInfo ¶
func (c *APIClient) GetEpisodeInfo(bvid string) (*EpisodeResponse, error)
GetEpisodeInfo 获取剧集信息
func (*APIClient) GetSeasonEpisodesByPage ¶
func (c *APIClient) GetSeasonEpisodesByPage(mid, seasonID string, pageNum, pageSize int) (*SeasonArchivesResponse, error)
GetSeasonEpisodesByPage 分页获取Season类型播放列表剧集
func (*APIClient) GetSeriesEpisodesByPage ¶
func (c *APIClient) GetSeriesEpisodesByPage(mid, seriesID string, pageNum, pageSize int) (*SeriesArchivesResponse, error)
GetSeriesEpisodesByPage 分页获取Series类型播放列表剧集
func (*APIClient) GetSeriesInfo ¶
func (c *APIClient) GetSeriesInfo(seriesID string) (*SeriesInfoResponse, error)
GetSeriesInfo 获取Series类型播放列表信息
func (*APIClient) GetUserEpisodesByPage ¶
func (c *APIClient) GetUserEpisodesByPage(mid string, pageNum, pageSize int) (*UserEpisodesResponse, error)
GetUserEpisodesByPage 分页获取用户剧集列表
func (*APIClient) GetUserInfo ¶
func (c *APIClient) GetUserInfo(mid string) (*UserResponse, error)
GetUserInfo 获取用户信息
type BilibiliBuilder ¶
type BilibiliBuilder struct {
// contains filtered or unexported fields
}
func NewBilibiliBuilder ¶
func NewBilibiliBuilder() (*BilibiliBuilder, error)
type Downloader ¶
type EpisodeResponse ¶
type EpisodeResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Aid int `json:"aid"`
Bvid string `json:"bvid"`
Title string `json:"title"`
Desc string `json:"desc"`
Pic string `json:"pic"`
PubDate int64 `json:"pubdate"`
Duration int `json:"duration"`
Is_upower_exclusive bool `json:"is_upower_exclusive"`
Owner struct {
Mid int `json:"mid"`
Name string `json:"name"`
Face string `json:"face"`
} `json:"owner"`
Stat struct {
View int `json:"view"`
} `json:"stat"`
} `json:"data"`
}
剧集信息API响应结构体
type SeasonArchivesResponse ¶
type SeasonArchivesResponse struct {
Code int `json:"code"`
Message string `json:"message"`
TTL int `json:"ttl"`
Data struct {
Aids []int64 `json:"aids"`
Archives []Archive `json:"archives"`
Meta struct {
Category int `json:"category"`
Cover string `json:"cover"`
Description string `json:"description"`
Mid int `json:"mid"`
Name string `json:"name"`
PTime int64 `json:"ptime"`
SeasonID int `json:"season_id"`
Total int `json:"total"`
} `json:"meta"`
Page struct {
PageNum int `json:"page_num"`
PageSize int `json:"page_size"`
Total int `json:"total"`
} `json:"page"`
} `json:"data"`
}
Season类型播放列表API响应结构体
type SeriesArchivesResponse ¶
type SeriesArchivesResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Archives []Archive `json:"archives"`
Page struct {
Num int `json:"num"`
Size int `json:"size"`
Count int `json:"count"`
} `json:"page"`
} `json:"data"`
}
Series类型播放列表剧集API响应结构体
type SeriesInfoResponse ¶
type SeriesInfoResponse struct {
Code int `json:"code"`
Message string `json:"message"`
TTL int `json:"ttl"`
Data struct {
Meta struct {
SeriesID int `json:"series_id"`
Mid int `json:"mid"`
Name string `json:"name"`
Description string `json:"description"`
Keywords []string `json:"keywords"`
Creator string `json:"creator"`
State int `json:"state"`
LastUpdateTs int64 `json:"last_update_ts"`
Total int `json:"total"`
Ctime int64 `json:"ctime"`
Mtime int64 `json:"mtime"`
RawKeywords string `json:"raw_keywords"`
Category int `json:"category"`
} `json:"meta"`
RecentAids []int64 `json:"recent_aids"`
} `json:"data"`
}
Series类型播放列表API响应结构体
type SoundCloudBuilder ¶
type SoundCloudBuilder struct {
// contains filtered or unexported fields
}
func NewSoundcloudBuilder ¶
func NewSoundcloudBuilder() (*SoundCloudBuilder, error)
type TwitchBuilder ¶
type TwitchBuilder struct {
// contains filtered or unexported fields
}
func NewTwitchBuilder ¶
func NewTwitchBuilder(clientIDSecret string) (*TwitchBuilder, error)
type UserEpisodesResponse ¶
type UserEpisodesResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Archives []Archive `json:"archives"`
Page struct {
Num int `json:"num"`
Size int `json:"size"`
Total int `json:"total"`
} `json:"page"`
} `json:"data"`
}
用户剧集列表API响应结构体
type UserResponse ¶
type UserResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Card struct {
Mid string `json:"mid"`
Name string `json:"name"`
Face string `json:"face"`
Sign string `json:"sign"`
Fans int `json:"fans"`
LevelInfo struct {
CurrentLevel int `json:"current_level"`
} `json:"level_info"`
Official struct {
Title string `json:"title"`
} `json:"official"`
} `json:"card"`
Space struct {
ViewCount int `json:"viewcount"`
} `json:"space,omitempty"`
Follower int `json:"follower"`
} `json:"data"`
}
用户信息API响应结构体
type VimeoBuilder ¶
type VimeoBuilder struct {
// contains filtered or unexported fields
}
func NewVimeoBuilder ¶
func NewVimeoBuilder(ctx context.Context, token string) (*VimeoBuilder, error)
type YouTubeBuilder ¶
type YouTubeBuilder struct {
// contains filtered or unexported fields
}
func NewYouTubeBuilder ¶
func NewYouTubeBuilder(key string, ytdlp Downloader) (*YouTubeBuilder, error)
func (*YouTubeBuilder) GetVideoCount ¶
Click to show internal directories.
Click to hide internal directories.