Documentation
¶
Index ¶
- type Api
- func (a *Api) CaptchaSend(ctx context.Context, req *CaptchaSendReq) (*CaptchaSendResp, error)
- func (a *Api) CaptchaVerify(ctx context.Context, req *CaptchaVerifyReq) (*CaptchaVerifyResp, error)
- func (a *Api) GetUserInfo(ctx context.Context, req *GetUserInfoReq) (*GetUserInfoResp, error)
- func (a *Api) LoginPhone(ctx context.Context, req *LoginPhoneReq) (*LoginPhoneResp, error)
- func (a *Api) Playlist(ctx context.Context, req *PlaylistReq) (*PlaylistResp, error)
- func (a *Api) QrcodeCheck(ctx context.Context, req *QrcodeCheckReq) (*QrcodeCheckResp, error)
- func (a *Api) QrcodeCreateKey(ctx context.Context, req *QrcodeCreateKeyReq) (*QrcodeCreateKeyResp, error)
- func (a *Api) QrcodeGenerate(ctx context.Context, req *QrcodeGenerateReq) (*QrcodeGenerateResp, error)
- func (a *Api) TokenRefresh(ctx context.Context, req *TokenRefreshReq) (*TokenRefreshResp, error)
- func (a *Api) V3SongDetail(ctx context.Context, req *V3SongDetailReq) (*V3SongDetailResp, error)
- func (a *Api) YunBeiSignIn(ctx context.Context, req *YunBeiSignInReq) (*YunBeiSignInResp, error)
- type CaptchaSendReq
- type CaptchaSendResp
- type CaptchaVerifyReq
- type CaptchaVerifyResp
- type GetUserInfoReq
- type GetUserInfoResp
- type GetUserInfoRespAccount
- type GetUserInfoRespProfile
- type LoginPhoneReq
- type LoginPhoneResp
- type PlaylistReq
- type PlaylistResp
- type PlaylistRespList
- type QrcodeCheckReq
- type QrcodeCheckResp
- type QrcodeCreateKeyReq
- type QrcodeCreateKeyResp
- type QrcodeGenerateReq
- type QrcodeGenerateResp
- type TokenRefreshReq
- type TokenRefreshResp
- type V3SongDetailReq
- type V3SongDetailReqList
- type V3SongDetailResp
- type V3SongDetailRespPrivileges
- type V3SongDetailRespSongs
- type YunBeiSignInReq
- type YunBeiSignInResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) CaptchaSend ¶
func (a *Api) CaptchaSend(ctx context.Context, req *CaptchaSendReq) (*CaptchaSendResp, error)
CaptchaSend 发送验证码 PC客户端
func (*Api) CaptchaVerify ¶
func (a *Api) CaptchaVerify(ctx context.Context, req *CaptchaVerifyReq) (*CaptchaVerifyResp, error)
CaptchaVerify 验证验证码
func (*Api) GetUserInfo ¶
func (a *Api) GetUserInfo(ctx context.Context, req *GetUserInfoReq) (*GetUserInfoResp, error)
GetUserInfo 获取用户信息
func (*Api) LoginPhone ¶
func (a *Api) LoginPhone(ctx context.Context, req *LoginPhoneReq) (*LoginPhoneResp, error)
LoginPhone 手机号登录
func (*Api) Playlist ¶
func (a *Api) Playlist(ctx context.Context, req *PlaylistReq) (*PlaylistResp, error)
Playlist 歌单列表.其中包含用户创建得歌单+我喜欢得歌单 url: https://app.apifox.com/project/3870894 testdata/har/4.har NeedLogin: 未知
func (*Api) QrcodeCheck ¶
func (a *Api) QrcodeCheck(ctx context.Context, req *QrcodeCheckReq) (*QrcodeCheckResp, error)
QrcodeCheck 查询扫码状态 返回值: 800-二维码不存在或已过期 801-等待扫码 802-正在扫码授权中 803-授权登录成功
func (*Api) QrcodeCreateKey ¶
func (a *Api) QrcodeCreateKey(ctx context.Context, req *QrcodeCreateKeyReq) (*QrcodeCreateKeyResp, error)
QrcodeCreateKey 生成二维码需要得key 常见问题 1. 请求成功了,但是body为空值什么也没有,原因还是参数加密出现了问题。 2. crsftoken 可传可不传个人猜测前端写得通用框架传了
func (*Api) QrcodeGenerate ¶
func (a *Api) QrcodeGenerate(ctx context.Context, req *QrcodeGenerateReq) (*QrcodeGenerateResp, error)
QrcodeGenerate 根据 QrcodeCreateKey 接口生成得key生成生成二维码,注意此处不是调用服务接口。
func (*Api) TokenRefresh ¶ added in v0.1.4
func (a *Api) TokenRefresh(ctx context.Context, req *TokenRefreshReq) (*TokenRefreshResp, error)
TokenRefresh token刷新 har: todo:400错误
func (*Api) V3SongDetail ¶
func (a *Api) V3SongDetail(ctx context.Context, req *V3SongDetailReq) (*V3SongDetailResp, error)
V3SongDetail todo: 歌单列表 应该是根据歌单ID获取 url: https://app.apifox.com/project/3870894 testdata/har/1.har needLogin: 未知
func (*Api) YunBeiSignIn ¶
func (a *Api) YunBeiSignIn(ctx context.Context, req *YunBeiSignInReq) (*YunBeiSignInResp, error)
YunBeiSignIn 用户每日签到 url: needLogin: 是 todo:目前传0会出现功能暂不支持不知为何(可能请求头或cookie问题)待填坑
type CaptchaSendReq ¶
type CaptchaSendResp ¶
type CaptchaSendResp struct {
types.RespCommon[any]
}
type CaptchaVerifyReq ¶
type CaptchaVerifyResp ¶
type CaptchaVerifyResp struct {
types.RespCommon[any]
}
type GetUserInfoReq ¶
type GetUserInfoResp ¶
type GetUserInfoResp struct {
types.RespCommon[any]
Account GetUserInfoRespAccount `json:"account"`
Profile GetUserInfoRespProfile `json:"profile"`
}
type GetUserInfoRespAccount ¶
type GetUserInfoRespAccount struct {
Id int64 `json:"id"`
UserName string `json:"userName"`
Type int64 `json:"type"`
Status int64 `json:"status"`
WhitelistAuthority int64 `json:"whitelistAuthority"`
CreateTime int64 `json:"createTime"`
TokenVersion int64 `json:"tokenVersion"`
Ban int64 `json:"ban"`
BaoyueVersion int64 `json:"baoyueVersion"`
DonateVersion int64 `json:"donateVersion"`
VipType int64 `json:"vipType"`
AnonimousUser bool `json:"anonimousUser"`
PaidFee bool `json:"paidFee"`
}
type GetUserInfoRespProfile ¶
type GetUserInfoRespProfile struct {
UserId int64 `json:"userId"`
UserType int64 `json:"userType"`
Nickname string `json:"nickname"`
AvatarImgId int64 `json:"avatarImgId"`
AvatarUrl string `json:"avatarUrl"`
BackgroundImgId int64 `json:"backgroundImgId"`
BackgroundUrl string `json:"backgroundUrl"`
Signature string `json:"signature"`
CreateTime int64 `json:"createTime"`
UserName string `json:"userName"`
AccountType int64 `json:"accountType"`
ShortUserName string `json:"shortUserName"`
Birthday int64 `json:"birthday"`
Authority int64 `json:"authority"`
Gender int64 `json:"gender"`
AccountStatus int64 `json:"accountStatus"`
Province int64 `json:"province"`
City int64 `json:"city"`
AuthStatus int64 `json:"authStatus"`
Description interface{} `json:"description"`
DetailDescription interface{} `json:"detailDescription"`
DefaultAvatar bool `json:"defaultAvatar"`
ExpertTags interface{} `json:"expertTags"`
Experts interface{} `json:"experts"`
DjStatus int64 `json:"djStatus"`
LocationStatus int64 `json:"locationStatus"`
VipType int64 `json:"vipType"`
Followed bool `json:"followed"`
Mutual bool `json:"mutual"`
Authenticated bool `json:"authenticated"`
LastLoginTime int64 `json:"lastLoginTime"`
LastLoginIP string `json:"lastLoginIP"`
RemarkName interface{} `json:"remarkName"`
ViptypeVersion int64 `json:"viptypeVersion"`
AuthenticationTypes int64 `json:"authenticationTypes"`
AvatarDetail interface{} `json:"avatarDetail"`
Anchor bool `json:"anchor"`
}
type LoginPhoneReq ¶
type LoginPhoneResp ¶
type LoginPhoneResp struct {
types.RespCommon[any]
}
type PlaylistReq ¶
type PlaylistResp ¶
type PlaylistResp struct {
types.RespCommon[any]
Version string `json:"version"` // 时间戳1703557080686
More bool `json:"more"`
Playlist []PlaylistRespList `json:"playlist"`
}
type PlaylistRespList ¶
type PlaylistRespList struct {
Subscribers []interface{} `json:"subscribers"`
Subscribed bool `json:"subscribed"`
Creator struct {
DefaultAvatar bool `json:"defaultAvatar"`
Province int64 `json:"province"`
AuthStatus int64 `json:"authStatus"`
Followed bool `json:"followed"`
AvatarUrl string `json:"avatarUrl"`
AccountStatus int64 `json:"accountStatus"`
Gender int64 `json:"gender"`
City int64 `json:"city"`
Birthday int64 `json:"birthday"`
UserId int64 `json:"userId"`
UserType int64 `json:"userType"`
Nickname string `json:"nickname"`
Signature string `json:"signature"`
Description string `json:"description"`
DetailDescription string `json:"detailDescription"`
AvatarImgId int64 `json:"avatarImgId"`
BackgroundImgId int64 `json:"backgroundImgId"`
BackgroundUrl string `json:"backgroundUrl"`
Authority int64 `json:"authority"`
Mutual bool `json:"mutual"`
ExpertTags []string `json:"expertTags"`
Experts *struct {
Field1 string `json:"2"`
} `json:"experts"`
DjStatus int64 `json:"djStatus"`
VipType int64 `json:"vipType"`
RemarkName interface{} `json:"remarkName"`
AuthenticationTypes int64 `json:"authenticationTypes"`
AvatarDetail interface{} `json:"avatarDetail"`
BackgroundImgIdStr string `json:"backgroundImgIdStr"`
AvatarImgIdStr string `json:"avatarImgIdStr"`
Anchor bool `json:"anchor"`
AvatarImgIdStr1 string `json:"avatarImgId_str,omitempty"`
} `json:"creator"`
Artists interface{} `json:"artists"`
Tracks interface{} `json:"tracks"`
Top bool `json:"top"`
UpdateFrequency *string `json:"updateFrequency"`
BackgroundCoverId int64 `json:"backgroundCoverId"`
BackgroundCoverUrl *string `json:"backgroundCoverUrl"`
TitleImage int64 `json:"titleImage"`
TitleImageUrl *string `json:"titleImageUrl"`
EnglishTitle *string `json:"englishTitle"`
OpRecommend bool `json:"opRecommend"`
RecommendInfo *struct {
Alg string `json:"alg"`
LogInfo string `json:"logInfo"`
} `json:"recommendInfo"`
SubscribedCount int64 `json:"subscribedCount"`
CloudTrackCount int64 `json:"cloudTrackCount"`
UserId int64 `json:"userId"`
TotalDuration int64 `json:"totalDuration"`
CoverImgId int64 `json:"coverImgId"`
Privacy int64 `json:"privacy"`
TrackUpdateTime int64 `json:"trackUpdateTime"`
TrackCount int64 `json:"trackCount"`
UpdateTime int64 `json:"updateTime"`
CommentThreadId string `json:"commentThreadId"`
CoverImgUrl string `json:"coverImgUrl"`
SpecialType int64 `json:"specialType"`
Anonimous bool `json:"anonimous"`
CreateTime int64 `json:"createTime"`
HighQuality bool `json:"highQuality"`
NewImported bool `json:"newImported"`
TrackNumberUpdateTime int64 `json:"trackNumberUpdateTime"`
PlayCount int64 `json:"playCount"`
AdType int64 `json:"adType"`
Description *string `json:"description"`
Tags []string `json:"tags"`
Ordered bool `json:"ordered"`
Status int64 `json:"status"`
Name string `json:"name"`
Id int64 `json:"id"`
CoverImgIdStr *string `json:"coverImgId_str"`
Copied bool `json:"copied"`
}
type QrcodeCheckReq ¶
type QrcodeCheckResp ¶
type QrcodeCheckResp struct {
types.RespCommon[any]
}
type QrcodeCreateKeyReq ¶
type QrcodeCreateKeyResp ¶
type QrcodeCreateKeyResp struct {
types.RespCommon[any]
UniKey string `json:"unikey"`
}
type QrcodeGenerateReq ¶
type QrcodeGenerateReq struct {
CodeKey string
}
type QrcodeGenerateResp ¶
type QrcodeGenerateResp struct {
types.RespCommon[any]
Qrcode []byte //
QrcodePrint string
}
type TokenRefreshReq ¶ added in v0.1.4
type TokenRefreshReq struct {
}
type TokenRefreshResp ¶ added in v0.1.4
type TokenRefreshResp struct {
types.RespCommon[any]
}
type V3SongDetailReq ¶
type V3SongDetailReq struct {
C []V3SongDetailReqList `json:"c"`
}
type V3SongDetailReqList ¶
type V3SongDetailResp ¶
type V3SongDetailResp struct {
types.RespCommon[any]
Songs []V3SongDetailRespSongs `json:"songs"`
Privileges []V3SongDetailRespPrivileges `json:"privileges"`
}
V3SongDetailResp see: https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1121#issuecomment-774438040 name: String, 歌曲标题 id: u64, 歌曲ID pst: 0,功能未知 t: enum,
0: 一般类型 1: 通过云盘上传的音乐,网易云不存在公开对应 如果没有权限将不可用,除了歌曲长度以外大部分信息都为null。 可以通过 `/api/v1/playlist/manipulate/tracks` 接口添加到播放列表。 如果添加到“我喜欢的音乐”,则仅自己可见,除了长度意外各种信息均为未知,且无法播放。 如果添加到一般播放列表,虽然返回code 200,但是并没有效果。 网页端打开会看到404画面。 属于这种歌曲的例子: https://music.163.com/song/1345937107 2: 通过云盘上传的音乐,网易云存在公开对应 如果没有权限则只能看到信息,但无法直接获取到文件。 可以通过 `/api/v1/playlist/manipulate/tracks` 接口添加到播放列表。 如果添加到“我喜欢的音乐”,则仅自己可见,且无法播放。 如果添加到一般播放列表,则自己会看到显示“云盘文件”,且云盘会多出其对应的网易云公开歌曲。其他人看到的是其对应的网易云公开歌曲。 网页端打开会看到404画面。 属于这种歌曲的例子: https://music.163.com/song/435005015
ar: Vec<Artist>, 歌手列表 alia: Vec<String>,
别名列表,第一个别名会被显示作副标题 例子: https://music.163.com/song/536623501
pop: 小数,常取[0.0, 100.0]中离散的几个数值, 表示歌曲热度 st: 0: 功能未知 rt: Option<String>, None、空白字串、或者类似`600902000007902089`的字符串,功能未知 fee: enum,
0: 免费 1: 2元购买单曲 4: 购买专辑 8: 低音质免费
v: u64, 常为[1, ?]任意数字, 功能未知 crbt: Option<String>, None或字符串表示的十六进制,功能未知 cf: Option<String>, 空白字串或者None,功能未知 al: Album, 专辑,如果是DJ节目(dj_type != 0)或者无专辑信息(single == 1),则专辑id为0 dt: u64, 功能未知 h: Option<Quality>, 高质量文件信息 m: Option<Quality>, 中质量文件信息 l: Option<Quality>, 低质量文件信息 a: Option<?>, 常为None, 功能未知 cd: Option<String>, None或如"04", "1/2", "3", "null"的字符串,表示歌曲属于专辑中第几张CD,对应音频文件的Tag no: u32, 表示歌曲属于CD中第几曲,0表示没有这个字段,对应音频文件的Tag rtUrl: Option<String(?)>, 常为None, 功能未知 rtUrls: Vec<String(?)>, 常为空列表, 功能未知 dj_id: u64,
0: 不是DJ节目 其他:是DJ节目,表示DJ ID
copyright: u32, 0, 1, 2: 功能未知 s_id: u64, 对于t == 2的歌曲,表示匹配到的公开版本歌曲ID mark: u64, 功能未知 originCoverType: enum
0: 未知 1: 原曲 2: 翻唱
originSongSimpleData: Option<SongSimpleData>, 对于翻唱曲,可选提供原曲简单格式的信息 single: enum,
0: 有专辑信息或者是DJ节目 1: 未知专辑
noCopyrightRcmd: Option<NoCopyrightRcmd>, None表示可以播,非空表示无版权 mv: u64, 非零表示有MV ID rtype: 常为0,功能未知 rurl: Option<String(?)>, 常为None,功能未知 mst: u32, 偶尔为0, 常为9,功能未知 cp: u64, 功能未知 publish_time: i64, 毫秒为单位的Unix时间戳
type V3SongDetailRespPrivileges ¶
type V3SongDetailRespPrivileges struct {
Id int `json:"id"`
Fee int `json:"fee"`
Payed int `json:"payed"`
St int `json:"st"`
Pl int `json:"pl"`
Dl int `json:"dl"`
Sp int `json:"sp"`
Cp int `json:"cp"`
Subp int `json:"subp"`
Cs bool `json:"cs"`
Maxbr int `json:"maxbr"`
Fl int `json:"fl"`
Toast bool `json:"toast"`
Flag int `json:"flag"`
PreSell bool `json:"preSell"`
PlayMaxbr int `json:"playMaxbr"`
DownloadMaxbr int `json:"downloadMaxbr"`
MaxBrLevel string `json:"maxBrLevel"`
PlayMaxBrLevel string `json:"playMaxBrLevel"`
DownloadMaxBrLevel string `json:"downloadMaxBrLevel"`
PlLevel string `json:"plLevel"`
DlLevel string `json:"dlLevel"`
FlLevel string `json:"flLevel"`
Rscl interface{} `json:"rscl"`
FreeTrialPrivilege struct {
ResConsumable bool `json:"resConsumable"`
UserConsumable bool `json:"userConsumable"`
ListenType interface{} `json:"listenType"`
CannotListenReason interface{} `json:"cannotListenReason"`
PlayReason interface{} `json:"playReason"`
} `json:"freeTrialPrivilege"`
RightSource int `json:"rightSource"`
ChargeInfoList []struct {
Rate int `json:"rate"`
ChargeUrl interface{} `json:"chargeUrl"`
ChargeMessage interface{} `json:"chargeMessage"`
ChargeType int `json:"chargeType"`
} `json:"chargeInfoList"`
}
type V3SongDetailRespSongs ¶
type V3SongDetailRespSongs struct {
Name string `json:"name"`
Id int64 `json:"id"`
Pst int64 `json:"pst"`
T int64 `json:"t"`
Ar []struct {
Id int64 `json:"id"`
Name string `json:"name"`
Tns []interface{} `json:"tns"`
Alias []interface{} `json:"alias"`
} `json:"ar"`
Alia []interface{} `json:"alia"`
Pop float64 `json:"pop"`
St int64 `json:"st"`
Rt string `json:"rt"`
Fee int64 `json:"fee"`
V int64 `json:"v"`
Crbt interface{} `json:"crbt"`
Cf string `json:"cf"`
Al struct {
Id int64 `json:"id"`
Name string `json:"name"`
PicUrl string `json:"picUrl"`
Tns []interface{} `json:"tns"`
PicStr string `json:"pic_str"`
Pic int64 `json:"pic"`
} `json:"al"`
Dt int64 `json:"dt"`
H types.Quality `json:"h"`
M types.Quality `json:"m"`
L types.Quality `json:"l"`
Sq types.Quality `json:"sq"`
Hr interface{} `json:"hr"`
A interface{} `json:"a"`
Cd string `json:"cd"`
No int64 `json:"no"`
RtUrl interface{} `json:"rtUrl"`
Ftype int `json:"ftype"`
RtUrls []interface{} `json:"rtUrls"`
DjId int `json:"djId"`
Copyright int `json:"copyright"`
SId int `json:"s_id"`
Mark int `json:"mark"`
OriginCoverType int `json:"originCoverType"`
OriginSongSimpleData interface{} `json:"originSongSimpleData"`
TagPicList interface{} `json:"tagPicList"`
ResourceState bool `json:"resourceState"`
Version int `json:"version"`
SongJumpInfo interface{} `json:"songJumpInfo"`
EntertainmentTags interface{} `json:"entertainmentTags"`
AwardTags interface{} `json:"awardTags"`
Single int `json:"single"`
NoCopyrightRcmd interface{} `json:"noCopyrightRcmd"`
Mv int `json:"mv"`
Rurl interface{} `json:"rurl"`
Mst int `json:"mst"`
Cp int `json:"cp"`
Rtype int `json:"rtype"`
PublishTime int `json:"publishTime"`
}
type YunBeiSignInReq ¶
type YunBeiSignInReq struct {
// Type 签到类型 0:安卓(默认)3点经验 1:web/PC2点经验
Type int64 `json:"type"`
}
type YunBeiSignInResp ¶
type YunBeiSignInResp struct {
// Code 错误码 -2:重复签到 200:成功(会有例外会出现“功能暂不支持”) 301:未登录
types.RespCommon[any]
// Point 签到获得积分奖励数量
Point int64 `json:"point"`
}
YunBeiSignInResp 签到返回