mirror of
https://github.com/ZxwyWebSite/lx-source.git
synced 2025-05-23 21:37:42 +08:00
2024-03-16 v1.0.3-rc2
This commit is contained in:
parent
0b44b071c0
commit
1ddc08d3b4
2
build.go
2
build.go
@ -56,7 +56,7 @@ func doCompile(v_os, v_arch, v_archv, v_cc string) error {
|
|||||||
pname := filepath.Clean(ztool.Str_FastConcat(args_path, fname))
|
pname := filepath.Clean(ztool.Str_FastConcat(args_path, fname))
|
||||||
cmd := ztool.Str_FastConcat(
|
cmd := ztool.Str_FastConcat(
|
||||||
`go build -o `, pname,
|
`go build -o `, pname,
|
||||||
` -gcflags=-trimpath="`, workDir, `" -asmflags=-trimpath="`, workDir, `" -buildvcs=false`,
|
` -gcflags=-trimpath="`, workDir, `" -asmflags=-trimpath="`, workDir, `" -trimpath -buildvcs=false`,
|
||||||
` -ldflags "-s -w -linkmode external" -tags "go_json"`, // go_json | json(std) | jsoniter | sonic
|
` -ldflags "-s -w -linkmode external" -tags "go_json"`, // go_json | json(std) | jsoniter | sonic
|
||||||
)
|
)
|
||||||
// 输出要执行的命令
|
// 输出要执行的命令
|
||||||
|
5
go.mod
5
go.mod
@ -6,7 +6,6 @@ require (
|
|||||||
github.com/ZxwyWebSite/ztool v0.0.1
|
github.com/ZxwyWebSite/ztool v0.0.1
|
||||||
github.com/gin-contrib/gzip v0.0.6
|
github.com/gin-contrib/gzip v0.0.6
|
||||||
github.com/gin-gonic/gin v1.9.1
|
github.com/gin-gonic/gin v1.9.1
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@ -23,6 +22,7 @@ require (
|
|||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
|
||||||
github.com/leodido/go-urn v1.2.4 // indirect
|
github.com/leodido/go-urn v1.2.4 // indirect
|
||||||
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
@ -32,8 +32,9 @@ require (
|
|||||||
golang.org/x/arch v0.7.0 // indirect
|
golang.org/x/arch v0.7.0 // indirect
|
||||||
golang.org/x/crypto v0.9.0 // indirect
|
golang.org/x/crypto v0.9.0 // indirect
|
||||||
golang.org/x/net v0.10.0 // indirect
|
golang.org/x/net v0.10.0 // indirect
|
||||||
golang.org/x/sys v0.16.0 // indirect
|
golang.org/x/sys v0.17.0 // indirect
|
||||||
golang.org/x/text v0.9.0 // indirect
|
golang.org/x/text v0.9.0 // indirect
|
||||||
|
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
google.golang.org/protobuf v1.30.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
7
go.sum
7
go.sum
@ -114,16 +114,17 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
|
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||||
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
|
||||||
|
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
||||||
|
52
init.go
52
init.go
@ -5,8 +5,9 @@ import (
|
|||||||
"lx-source/src/caches"
|
"lx-source/src/caches"
|
||||||
"lx-source/src/caches/localcache"
|
"lx-source/src/caches/localcache"
|
||||||
"lx-source/src/env"
|
"lx-source/src/env"
|
||||||
"lx-source/src/sources"
|
|
||||||
"lx-source/src/sources/builtin"
|
// "lx-source/src/sources"
|
||||||
|
// "lx-source/src/sources/builtin"
|
||||||
"net/http"
|
"net/http"
|
||||||
stdurl "net/url"
|
stdurl "net/url"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -64,6 +65,29 @@ func loadFileLoger() {
|
|||||||
|
|
||||||
// 初始化基础功能
|
// 初始化基础功能
|
||||||
func initMain() {
|
func initMain() {
|
||||||
|
// 载入内存缓存
|
||||||
|
storepath := env.RunPath + env.Config.Main.Store
|
||||||
|
env.Cache.MustRestore(storepath)
|
||||||
|
env.Defer.Add(func() { env.Cache.MustPersist(storepath) })
|
||||||
|
env.Tasker.Add(`memo_flush`, func(*logs.Logger, int64) error {
|
||||||
|
return env.Cache.Persist(storepath)
|
||||||
|
}, 3600, false)
|
||||||
|
|
||||||
|
// 初始化数据库
|
||||||
|
// idb := env.Loger.NewGroup(`InitDB`)
|
||||||
|
// switch `sqlite` {
|
||||||
|
// case `memo`:
|
||||||
|
// break
|
||||||
|
// case `sqlite`:
|
||||||
|
// err := database.InitDB(`data/data.db`)
|
||||||
|
// if err != nil {
|
||||||
|
// idb.Error(`数据库载入失败: %s`, err)
|
||||||
|
// }
|
||||||
|
// default:
|
||||||
|
// idb.Error(`未定义的数据库模式,请检查配置 [DataBase].Mode`)
|
||||||
|
// }
|
||||||
|
// idb.Free()
|
||||||
|
|
||||||
// 初始化代理
|
// 初始化代理
|
||||||
ipr := env.Loger.NewGroup(`InitProxy`)
|
ipr := env.Loger.NewGroup(`InitProxy`)
|
||||||
switch env.Config.Source.FakeIP_Mode {
|
switch env.Config.Source.FakeIP_Mode {
|
||||||
@ -167,16 +191,16 @@ func initMain() {
|
|||||||
icl.Free()
|
icl.Free()
|
||||||
|
|
||||||
// 初始化音乐源
|
// 初始化音乐源
|
||||||
ise := env.Loger.NewGroup(`InitSource`)
|
// ise := env.Loger.NewGroup(`InitSource`)
|
||||||
switch env.Config.Source.Mode {
|
// switch env.Config.Source.Mode {
|
||||||
case `0`, `off`:
|
// case `0`, `off`:
|
||||||
break
|
// break
|
||||||
case `1`, `builtin`:
|
// case `1`, `builtin`:
|
||||||
sources.UseSource = &builtin.Source{}
|
// sources.UseSource = &builtin.Source{}
|
||||||
case `2`, `custom`:
|
// case `2`, `custom`:
|
||||||
ise.Fatal(`暂未实现账号解析源`)
|
// ise.Fatal(`暂未实现账号解析源`)
|
||||||
default:
|
// default:
|
||||||
ise.Error(`未定义的音乐源,请检查配置 [Source].Mode,本次启动禁用内置源`)
|
// ise.Error(`未定义的音乐源,请检查配置 [Source].Mode,本次启动禁用内置源`)
|
||||||
}
|
// }
|
||||||
ise.Free()
|
// ise.Free()
|
||||||
}
|
}
|
||||||
|
@ -1 +1,38 @@
|
|||||||
|
//go:build gorm
|
||||||
|
|
||||||
package database
|
package database
|
||||||
|
|
||||||
|
// import (
|
||||||
|
// "lx-source/src/database/modules"
|
||||||
|
// "lx-source/src/env"
|
||||||
|
// "lx-source/src/sources"
|
||||||
|
|
||||||
|
// "gorm.io/gorm"
|
||||||
|
// )
|
||||||
|
|
||||||
|
// var DB *gorm.DB
|
||||||
|
|
||||||
|
// func InitDB(dsn string) (err error) {
|
||||||
|
// loger := env.Loger.NewGroup(`InitDB`)
|
||||||
|
// defer loger.Free()
|
||||||
|
// DB, err = gorm.Open(modules.Sqlite(dsn), &gorm.Config{})
|
||||||
|
// if err == nil {
|
||||||
|
// for _, typ := range []struct {
|
||||||
|
// Name string
|
||||||
|
// Type interface{}
|
||||||
|
// }{
|
||||||
|
// {Name: T_music, Type: &XMusicItem{}},
|
||||||
|
// {Name: T_lyric, Type: &XLyricItem{}},
|
||||||
|
// } {
|
||||||
|
// for _, src := range sources.S_al {
|
||||||
|
// err = DB.Table(src + `_` + typ.Name).AutoMigrate(typ.Type)
|
||||||
|
// if err != nil {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
// type Driver struct{}
|
||||||
|
9
src/database/modules/sqlite_cgo.go
Normal file
9
src/database/modules/sqlite_cgo.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//go:build cgo && gorm
|
||||||
|
|
||||||
|
package modules
|
||||||
|
|
||||||
|
// import (
|
||||||
|
// "gorm.io/driver/sqlite"
|
||||||
|
// )
|
||||||
|
|
||||||
|
// var Sqlite = sqlite.Open
|
9
src/database/modules/sqlite_etc.go
Normal file
9
src/database/modules/sqlite_etc.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//go:build !cgo && gorm
|
||||||
|
|
||||||
|
package modules
|
||||||
|
|
||||||
|
// import (
|
||||||
|
// "github.com/glebarez/sqlite"
|
||||||
|
// )
|
||||||
|
|
||||||
|
// var Sqlite = sqlite.Open
|
@ -1,23 +1,71 @@
|
|||||||
|
//go:build gorm
|
||||||
|
|
||||||
package database
|
package database
|
||||||
|
|
||||||
|
// MusicFree 数据结构
|
||||||
|
// type (
|
||||||
|
// // 其他
|
||||||
|
// IExtra map[string]interface{}
|
||||||
|
// // 音乐
|
||||||
|
// IMusicItem struct {
|
||||||
|
// Artist string `json:"artist"` // 作者
|
||||||
|
// Title string `json:"title"` // 歌曲标题
|
||||||
|
// Duration int `json:"duration,omitempty"` // 时长(s)
|
||||||
|
// Album string `json:"album,omitempty"` // 专辑名
|
||||||
|
// Artwork string `json:"artwork,omitempty"` // 专辑封面图
|
||||||
|
// Url string `json:"url,omitempty"` // 默认音源
|
||||||
|
// Lrc string `json:"lrc,omitempty"` // 歌词URL
|
||||||
|
// RawLrc string `json:"rawLrc,omitempty"` // 歌词文本(lrc格式 带时间戳)
|
||||||
|
// Other IExtra `json:"extra,omitempty"` // 其他
|
||||||
|
// }
|
||||||
|
// // 歌单
|
||||||
|
// IMusicSheetItem struct {
|
||||||
|
// Artwork string `json:"artwork,omitempty"` // 封面图
|
||||||
|
// Title string `json:"title"` // 标题
|
||||||
|
// Description string `json:"description,omitempty"` // 描述
|
||||||
|
// WorksNum int `json:"worksNum,omitempty"` // 作品总数
|
||||||
|
// PlayCount int `json:"playCount,omitempty"` // 播放次数
|
||||||
|
// MusicList []IMusicItem `json:"musicList,omitempty"` // 播放列表
|
||||||
|
// CreateAt int64 `json:"createAt,omitempty"` // 歌单创建日期
|
||||||
|
// Artist string `json:"artist,omitempty"` // 歌单作者
|
||||||
|
// Other IExtra `json:"extra,omitempty"` // 其他
|
||||||
|
// }
|
||||||
|
// // 专辑
|
||||||
|
// IAlbumItem IMusicSheetItem
|
||||||
|
// // 作者
|
||||||
|
// IArtistItem struct {
|
||||||
|
// Platform string `json:"platform,omitempty"` // 插件名
|
||||||
|
// ID interface{} `json:"id"` // 唯一id
|
||||||
|
// Name string `json:"name"` // 姓名
|
||||||
|
// Fans int `json:"fans,omitempty"` // 粉丝数
|
||||||
|
// Description string `json:"description,omitempty"` // 简介
|
||||||
|
// Avatar string `json:"avatar,omitempty"` // 头像
|
||||||
|
// WorksNum int `json:"worksNum,omitempty"` // 作品数目
|
||||||
|
// MusicList []IMusicItem `json:"musicList,omitempty"` // 作者的音乐列表
|
||||||
|
// AlbumList []IAlbumItem `json:"albumList,omitempty"` // 作者的专辑列表
|
||||||
|
// Other IExtra `json:"extra,omitempty"` // 其他
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
|
||||||
// 结构表
|
// 结构表
|
||||||
// type (
|
// type (
|
||||||
// PublicKeys struct {
|
// // 重复
|
||||||
// ID string `json:"id" gorm:"primaryKey"`
|
// XPublicKeys struct {
|
||||||
|
// ID string `json:"id" gorm:"primaryKey"` // 唯一ID
|
||||||
|
// Exp int64 `json:"exp" gorm:"column:exp"` // 过期时间
|
||||||
// }
|
// }
|
||||||
// // 音乐
|
// // 音乐
|
||||||
// MusicItem struct {
|
// XMusicItem struct {
|
||||||
// ID string `json:"id" gorm:"primaryKey"` // 唯一ID
|
// ID string `json:"id" gorm:"primaryKey"` // 唯一ID
|
||||||
// Name string `json:"name" gorm:"column:name"` //
|
// Name string `json:"name" gorm:"column:name"` // 歌曲名称
|
||||||
// // Source string `json:"source" gorm:"-:all"`
|
|
||||||
// }
|
// }
|
||||||
// // 作者
|
// // 作者
|
||||||
// ArtistItem struct {
|
// // XArtistItem struct {
|
||||||
// ID string `json:"id" gorm:"primaryKey"`
|
// // ID string `json:"id" gorm:"primaryKey"`
|
||||||
// Name string `json:"name" gorm:"column:name"`
|
// // Name string `json:"name" gorm:"column:name"`
|
||||||
// }
|
// // }
|
||||||
// // 歌词
|
// // 歌词
|
||||||
// LyricItem struct {
|
// XLyricItem struct {
|
||||||
// ID string `json:"id" gorm:"primaryKey"`
|
// ID string `json:"id" gorm:"primaryKey"`
|
||||||
// Lyric string `json:"lyric" gorm:"column:lyric"` // 歌曲歌词
|
// Lyric string `json:"lyric" gorm:"column:lyric"` // 歌曲歌词
|
||||||
// TLyric string `json:"tlyric" gorm:"column:tlyric"` // 翻译歌词,没有可为 null
|
// TLyric string `json:"tlyric" gorm:"column:tlyric"` // 翻译歌词,没有可为 null
|
||||||
@ -27,12 +75,23 @@ package database
|
|||||||
// // 例如: [00:00.000]<0,36>测<36,36>试<50,60>歌<80,75>词
|
// // 例如: [00:00.000]<0,36>测<36,36>试<50,60>歌<80,75>词
|
||||||
// }
|
// }
|
||||||
// // 视频
|
// // 视频
|
||||||
// MovieItem struct {
|
// // XMovieItem struct {
|
||||||
|
// // ID string `json:"id" gorm:"primaryKey"`
|
||||||
|
// // Name string `json:"name" gorm:"column:name"`
|
||||||
|
// // }
|
||||||
|
// // 链接
|
||||||
|
// XLinkItem struct {
|
||||||
// ID string `json:"id" gorm:"primaryKey"`
|
// ID string `json:"id" gorm:"primaryKey"`
|
||||||
// Name string `json:"name" gorm:"column:name"`
|
|
||||||
// }
|
// }
|
||||||
// )
|
// )
|
||||||
|
|
||||||
|
// const (
|
||||||
|
// T_artist = `artist`
|
||||||
|
// T_detail = `detail`
|
||||||
|
// T_lyric = `lyric`
|
||||||
|
// T_music = `music`
|
||||||
|
// )
|
||||||
|
|
||||||
// 分源表
|
// 分源表
|
||||||
// type (
|
// type (
|
||||||
// // Music
|
// // Music
|
||||||
|
12
src/env/env.go
vendored
12
src/env/env.go
vendored
@ -12,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = `1.0.3-rc1`
|
Version = `1.0.3-rc2`
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -37,6 +37,8 @@ type (
|
|||||||
// FFConv bool `comment:"(实验性) 使用FFMpeg修复音频(本地缓存)"`
|
// FFConv bool `comment:"(实验性) 使用FFMpeg修复音频(本地缓存)"`
|
||||||
NgProxy bool `comment:"兼容反向代理(beta)"`
|
NgProxy bool `comment:"兼容反向代理(beta)"`
|
||||||
Timeout int64 `comment:"网络请求超时(单位:秒,海外服务器可适当调大)"`
|
Timeout int64 `comment:"网络请求超时(单位:秒,海外服务器可适当调大)"`
|
||||||
|
|
||||||
|
Store string `comment:"内存缓存持久化文件地址"`
|
||||||
}
|
}
|
||||||
// 接口
|
// 接口
|
||||||
Conf_Apis struct {
|
Conf_Apis struct {
|
||||||
@ -69,7 +71,7 @@ type (
|
|||||||
}
|
}
|
||||||
// 来源
|
// 来源
|
||||||
Conf_Source struct {
|
Conf_Source struct {
|
||||||
Mode string `comment:"音乐来源 0: off(关闭 仅本地), 1: builtin(内置), 2: custom(登录账号 暂不支持)"`
|
// Mode string `comment:"音乐来源 0: off(关闭 仅本地), 1: builtin(内置), 2: custom(登录账号 暂不支持)"`
|
||||||
// 伪装IP
|
// 伪装IP
|
||||||
FakeIP_Mode string `comment:"伪装IP模式 0: off(关闭), 1: req(传入值), 2: val(静态)"`
|
FakeIP_Mode string `comment:"伪装IP模式 0: off(关闭), 1: req(传入值), 2: val(静态)"`
|
||||||
FakeIP_Value string `comment:"静态伪装IP"`
|
FakeIP_Value string `comment:"静态伪装IP"`
|
||||||
@ -108,6 +110,9 @@ type (
|
|||||||
Mg_Usr_Token string `comment:"field user.token"`
|
Mg_Usr_Token string `comment:"field user.token"`
|
||||||
Mg_Usr_OSVer string `comment:"field user.osversion"`
|
Mg_Usr_OSVer string `comment:"field user.osversion"`
|
||||||
Mg_Usr_ReqUA string `comment:"field user.useragent"`
|
Mg_Usr_ReqUA string `comment:"field user.useragent"`
|
||||||
|
// mg refresh
|
||||||
|
Mg_Refresh_Enable bool `comment:"是否启用Cookie保活"`
|
||||||
|
Mg_Refresh_Interval int64 `comment:"下次运行时间 (自动更新)"`
|
||||||
|
|
||||||
// kw
|
// kw
|
||||||
Kw_Enable bool `comment:"是否启用小蜗源"`
|
Kw_Enable bool `comment:"是否启用小蜗源"`
|
||||||
@ -193,6 +198,7 @@ var (
|
|||||||
Print: true,
|
Print: true,
|
||||||
SysLev: false,
|
SysLev: false,
|
||||||
Timeout: 30,
|
Timeout: 30,
|
||||||
|
Store: `/data/memo.bin`,
|
||||||
},
|
},
|
||||||
Apis: Conf_Apis{
|
Apis: Conf_Apis{
|
||||||
// BindAddr: `http://192.168.10.22:1011/`,
|
// BindAddr: `http://192.168.10.22:1011/`,
|
||||||
@ -209,7 +215,7 @@ var (
|
|||||||
// BanList_White: []string{`127.0.0.1`},
|
// BanList_White: []string{`127.0.0.1`},
|
||||||
},
|
},
|
||||||
Source: Conf_Source{
|
Source: Conf_Source{
|
||||||
Mode: `builtin`,
|
// Mode: `builtin`,
|
||||||
FakeIP_Mode: `0`,
|
FakeIP_Mode: `0`,
|
||||||
FakeIP_Value: `192.168.10.2`,
|
FakeIP_Value: `192.168.10.2`,
|
||||||
Proxy_Enable: false,
|
Proxy_Enable: false,
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
package auth
|
package auth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/gob"
|
||||||
"lx-source/src/env"
|
"lx-source/src/env"
|
||||||
"lx-source/src/middleware/resp"
|
"lx-source/src/middleware/resp"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@ -17,6 +18,10 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
gob.Register(RateLimit{})
|
||||||
|
}
|
||||||
|
|
||||||
func InitHandler(h gin.HandlerFunc) (out []gin.HandlerFunc) {
|
func InitHandler(h gin.HandlerFunc) (out []gin.HandlerFunc) {
|
||||||
loger := env.Loger.NewGroup(`AuthHandler`)
|
loger := env.Loger.NewGroup(`AuthHandler`)
|
||||||
// RateLimit 速率限制
|
// RateLimit 速率限制
|
||||||
|
@ -92,6 +92,10 @@ func musicHandler(c *gin.Context) {
|
|||||||
// 定位源方法
|
// 定位源方法
|
||||||
switch pm {
|
switch pm {
|
||||||
case `url`, `link`:
|
case `url`, `link`:
|
||||||
|
// if !active && pq != sources.Q_128k {
|
||||||
|
// out.Msg = `未激活源仅可试听128k音质`
|
||||||
|
// return out
|
||||||
|
// }
|
||||||
// 查询文件缓存
|
// 查询文件缓存
|
||||||
var cstat bool
|
var cstat bool
|
||||||
if caches.UseCache != nil {
|
if caches.UseCache != nil {
|
||||||
@ -127,6 +131,8 @@ func musicHandler(c *gin.Context) {
|
|||||||
} else {
|
} else {
|
||||||
out.Msg = cacheMISS
|
out.Msg = cacheMISS
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
loger.Warn(`发生错误: %s`, out.Msg)
|
||||||
}
|
}
|
||||||
// 无法获取直链 直接返回原链接
|
// 无法获取直链 直接返回原链接
|
||||||
env.Cache.Set(cquery, out.Data, source.Exp()-300)
|
env.Cache.Set(cquery, out.Data, source.Exp()-300)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//go:build extapp
|
||||||
|
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//go:build extapp
|
||||||
|
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"lx-source/src/caches"
|
|
||||||
"lx-source/src/env"
|
"lx-source/src/env"
|
||||||
"lx-source/src/middleware/dynlink"
|
"lx-source/src/middleware/dynlink"
|
||||||
"lx-source/src/middleware/resp"
|
|
||||||
"lx-source/src/middleware/util"
|
|
||||||
"lx-source/src/sources"
|
"lx-source/src/sources"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync/atomic"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ZxwyWebSite/ztool"
|
|
||||||
"github.com/gin-contrib/gzip"
|
"github.com/gin-contrib/gzip"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@ -111,76 +106,76 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// 外链解析
|
// 外链解析
|
||||||
func linkHandler(c *gin.Context) {
|
// func linkHandler(c *gin.Context) {
|
||||||
resp.Wrap(c, func() *resp.Resp {
|
// resp.Wrap(c, func() *resp.Resp {
|
||||||
// 获取传入参数 检查合法性
|
// // 获取传入参数 检查合法性
|
||||||
arr := util.ParaArr(c, `s`, `id`, `q`)
|
// arr := util.ParaArr(c, `s`, `id`, `q`)
|
||||||
s, id, q := arr[0], arr[1], arr[2]
|
// s, id, q := arr[0], arr[1], arr[2]
|
||||||
// parms := util.ParaMap(c)
|
// // parms := util.ParaMap(c)
|
||||||
// getParam := func(p string) string { return strings.TrimSuffix(strings.TrimPrefix(c.Param(p), `/`), `/`) } //strings.Trim(c.Param(p), `/`)
|
// // getParam := func(p string) string { return strings.TrimSuffix(strings.TrimPrefix(c.Param(p), `/`), `/`) } //strings.Trim(c.Param(p), `/`)
|
||||||
// s := parms[`s`] //c.Param(`s`) //getParam(`s`) // source 平台 wy, mg, kw
|
// // s := parms[`s`] //c.Param(`s`) //getParam(`s`) // source 平台 wy, mg, kw
|
||||||
// id := parms[`id`] //c.Param(`id`) //getParam(`id`) // sid 音乐ID wy: songmid, mg: copyrightId
|
// // id := parms[`id`] //c.Param(`id`) //getParam(`id`) // sid 音乐ID wy: songmid, mg: copyrightId
|
||||||
// q := parms[`q`] //c.Param(`q`) //getParam(`q`) // quality 音质 128k / 320k / flac / flac24bit
|
// // q := parms[`q`] //c.Param(`q`) //getParam(`q`) // quality 音质 128k / 320k / flac / flac24bit
|
||||||
env.Loger.NewGroup(`LinkQuery`).Debug(`s: %v, id: %v, q: %v`, s, id, q).Free()
|
// env.Loger.NewGroup(`LinkQuery`).Debug(`s: %v, id: %v, q: %v`, s, id, q).Free()
|
||||||
if ztool.Chk_IsNilStr(s, q, id) {
|
// if ztool.Chk_IsNilStr(s, q, id) {
|
||||||
return &resp.Resp{Code: 6, Msg: `参数不全`} // http.StatusBadRequest
|
// return &resp.Resp{Code: 6, Msg: `参数不全`} // http.StatusBadRequest
|
||||||
}
|
|
||||||
cquery := caches.NewQuery(s, id, q)
|
|
||||||
cquery.Request = c.Request
|
|
||||||
// fmt.Printf("%+v\n", cquery)
|
|
||||||
defer cquery.Free()
|
|
||||||
// _, ok := sources.UseSource.Verify(cquery) // 获取请求音质 同时检测是否支持(如kw源没有flac24bit) qualitys[q][s]rquery
|
|
||||||
// if !ok {
|
|
||||||
// return &resp.Resp{Code: 6, Msg: `不支持的平台或音质`}
|
|
||||||
// }
|
// }
|
||||||
|
// cquery := caches.NewQuery(s, id, q)
|
||||||
|
// cquery.Request = c.Request
|
||||||
|
// // fmt.Printf("%+v\n", cquery)
|
||||||
|
// defer cquery.Free()
|
||||||
|
// // _, ok := sources.UseSource.Verify(cquery) // 获取请求音质 同时检测是否支持(如kw源没有flac24bit) qualitys[q][s]rquery
|
||||||
|
// // if !ok {
|
||||||
|
// // return &resp.Resp{Code: 6, Msg: `不支持的平台或音质`}
|
||||||
|
// // }
|
||||||
|
|
||||||
// 查询内存
|
// // 查询内存
|
||||||
if clink, ok := env.Cache.Get(cquery.Query()); ok {
|
// if clink, ok := env.Cache.Get(cquery.Query()); ok {
|
||||||
if str, ok := clink.(string); ok {
|
// if str, ok := clink.(string); ok {
|
||||||
env.Loger.NewGroup(`MemCache`).Debug(`MemHIT [%q]=>[%q]`, cquery.Query(), str).Free()
|
// env.Loger.NewGroup(`MemCache`).Debug(`MemHIT [%q]=>[%q]`, cquery.Query(), str).Free()
|
||||||
if str == `` {
|
// if str == `` {
|
||||||
return &resp.Resp{Code: 2, Msg: memRej} // 拒绝请求,当前一段时间内解析出错 `MemCache Reject`
|
// return &resp.Resp{Code: 2, Msg: memRej} // 拒绝请求,当前一段时间内解析出错 `MemCache Reject`
|
||||||
}
|
// }
|
||||||
return &resp.Resp{Msg: memHIT, Data: str} // `MemCache HIT`
|
// return &resp.Resp{Msg: memHIT, Data: str} // `MemCache HIT`
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 查询缓存
|
// // 查询缓存
|
||||||
var cstat bool
|
// var cstat bool
|
||||||
if caches.UseCache != nil {
|
// if caches.UseCache != nil {
|
||||||
cstat = caches.UseCache.Stat()
|
// cstat = caches.UseCache.Stat()
|
||||||
}
|
// }
|
||||||
sc := env.Loger.NewGroup(`StatCache`)
|
// sc := env.Loger.NewGroup(`StatCache`)
|
||||||
defer sc.Free()
|
// defer sc.Free()
|
||||||
if cstat {
|
// if cstat {
|
||||||
sc.Debug(`Method: Get, Query: %v`, cquery.Query())
|
// sc.Debug(`Method: Get, Query: %v`, cquery.Query())
|
||||||
if link := caches.UseCache.Get(cquery); link != `` {
|
// if link := caches.UseCache.Get(cquery); link != `` {
|
||||||
env.Cache.Set(cquery.Query(), link, 3600)
|
// env.Cache.Set(cquery.Query(), link, 3600)
|
||||||
return &resp.Resp{Msg: cacheHIT, Data: link}
|
// return &resp.Resp{Msg: cacheHIT, Data: link}
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
sc.Debug(`Disabled`)
|
// sc.Debug(`Disabled`)
|
||||||
}
|
// }
|
||||||
atomic.AddInt64(&reqnum, 1)
|
// atomic.AddInt64(&reqnum, 1)
|
||||||
// 解析歌曲外链
|
// // 解析歌曲外链
|
||||||
outlink, emsg := sources.UseSource.GetLink(cquery)
|
// outlink, emsg := sources.UseSource.GetLink(cquery)
|
||||||
if emsg != `` {
|
// if emsg != `` {
|
||||||
if emsg == sources.Err_Verify { // Verify Failed: 不支持的平台或音质
|
// if emsg == sources.Err_Verify { // Verify Failed: 不支持的平台或音质
|
||||||
return &resp.Resp{Code: 6, Msg: ztool.Str_FastConcat(emsg, `: 不支持的平台或音质`)}
|
// return &resp.Resp{Code: 6, Msg: ztool.Str_FastConcat(emsg, `: 不支持的平台或音质`)}
|
||||||
}
|
// }
|
||||||
env.Cache.Set(cquery.Query(), outlink, 600) // 发生错误的10分钟内禁止再次查询
|
// env.Cache.Set(cquery.Query(), outlink, 600) // 发生错误的10分钟内禁止再次查询
|
||||||
return &resp.Resp{Code: 2, Msg: emsg, Data: outlink}
|
// return &resp.Resp{Code: 2, Msg: emsg, Data: outlink}
|
||||||
}
|
// }
|
||||||
atomic.AddInt64(&secnum, 1)
|
// atomic.AddInt64(&secnum, 1)
|
||||||
// 缓存并获取直链 !(s == `kg` || (s == `tx` && !tx_en)) => (s != `kg` && (s != `tx` || tx_en))
|
// // 缓存并获取直链 !(s == `kg` || (s == `tx` && !tx_en)) => (s != `kg` && (s != `tx` || tx_en))
|
||||||
if outlink != `` && cstat && cquery.Source != sources.S_kg && (cquery.Source != sources.S_tx || env.Config.Custom.Tx_Enable) {
|
// if outlink != `` && cstat && cquery.Source != sources.S_kg && (cquery.Source != sources.S_tx || env.Config.Custom.Tx_Enable) {
|
||||||
sc.Debug(`Method: Set, Link: %v`, outlink)
|
// sc.Debug(`Method: Set, Link: %v`, outlink)
|
||||||
if link := caches.UseCache.Set(cquery, outlink); link != `` {
|
// if link := caches.UseCache.Set(cquery, outlink); link != `` {
|
||||||
env.Cache.Set(cquery.Query(), link, 3600)
|
// env.Cache.Set(cquery.Query(), link, 3600)
|
||||||
return &resp.Resp{Msg: cacheSet, Data: link}
|
// return &resp.Resp{Msg: cacheSet, Data: link}
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 无法获取直链 直接返回原链接
|
// // 无法获取直链 直接返回原链接
|
||||||
env.Cache.Set(cquery.Query(), outlink, 1200)
|
// env.Cache.Set(cquery.Query(), outlink, 1200)
|
||||||
return &resp.Resp{Msg: cacheMISS, Data: outlink}
|
// return &resp.Resp{Msg: cacheMISS, Data: outlink}
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
@ -1,288 +1,288 @@
|
|||||||
// 内置解析源
|
// 内置解析源
|
||||||
package builtin
|
package builtin
|
||||||
|
|
||||||
import (
|
// import (
|
||||||
"lx-source/src/caches"
|
// "lx-source/src/caches"
|
||||||
"lx-source/src/env"
|
// "lx-source/src/env"
|
||||||
"lx-source/src/sources"
|
// "lx-source/src/sources"
|
||||||
"lx-source/src/sources/custom/kg"
|
// "lx-source/src/sources/custom/kg"
|
||||||
"lx-source/src/sources/custom/kw"
|
// "lx-source/src/sources/custom/kw"
|
||||||
"lx-source/src/sources/custom/mg"
|
// "lx-source/src/sources/custom/mg"
|
||||||
"lx-source/src/sources/custom/tx"
|
// "lx-source/src/sources/custom/tx"
|
||||||
"lx-source/src/sources/custom/wy"
|
// "lx-source/src/sources/custom/wy"
|
||||||
wm "lx-source/src/sources/custom/wy/modules"
|
// wm "lx-source/src/sources/custom/wy/modules"
|
||||||
"lx-source/src/sources/example"
|
// "lx-source/src/sources/example"
|
||||||
"net/http"
|
// "net/http"
|
||||||
"strconv"
|
// "strconv"
|
||||||
"sync"
|
// "sync"
|
||||||
"time"
|
// "time"
|
||||||
|
|
||||||
"github.com/ZxwyWebSite/ztool"
|
// "github.com/ZxwyWebSite/ztool"
|
||||||
)
|
// )
|
||||||
|
|
||||||
type Source struct{}
|
// type Source struct{}
|
||||||
|
|
||||||
// 预检 (兼容旧接口)
|
// // 预检 (兼容旧接口)
|
||||||
func (s *Source) Verify(c *caches.Query) (rquery string, ok bool) {
|
// func (s *Source) Verify(c *caches.Query) (rquery string, ok bool) {
|
||||||
rquery, ok = qualitys[c.Quality][c.Source]
|
// rquery, ok = qualitys[c.Quality][c.Source]
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
// 并发对象池 (用户限制在Router处实现)
|
|
||||||
wy_pool *sync.Pool
|
|
||||||
mg_pool = &sync.Pool{New: func() any { return new(MgApi_Song) }}
|
|
||||||
// kw_pool = &sync.Pool{New: func() any { return new(KwApi_Song) }}
|
|
||||||
// kg_pool = &sync.Pool{New: func() any { return new(KgApi_Song) }}
|
|
||||||
// tx_pool = &sync.Pool{New: func() any { return new(res_tx) }}
|
|
||||||
wv_pool *sync.Pool
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
env.Inits.Add(func() {
|
|
||||||
if env.Config.Source.Enable_Wy {
|
|
||||||
wy_pool = &sync.Pool{New: func() any { return new(wm.PlayInfo) }}
|
|
||||||
if env.Config.Source.MusicIdVerify {
|
|
||||||
wv_pool = &sync.Pool{New: func() any { return new(wm.VerifyInfo) }}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询
|
|
||||||
func (s *Source) GetLink(c *caches.Query) (outlink string, msg string) {
|
|
||||||
rquery, ok := s.Verify(c)
|
|
||||||
if !ok /*&& c.Source != `tx`*/ {
|
|
||||||
msg = sources.Err_Verify //`Verify Failed`
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// var outlink string
|
|
||||||
jx := env.Loger.NewGroup(`Sources`) //sources.Loger.AppGroup(`builtin`) //env.Loger.NewGroup(`JieXiApis`)
|
|
||||||
defer jx.Free()
|
|
||||||
switch c.Source {
|
|
||||||
case sources.S_wy:
|
|
||||||
if !env.Config.Source.Enable_Wy {
|
|
||||||
msg = sources.ErrDisable
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if wy.Url != nil {
|
|
||||||
outlink, msg = wy.Url(c.MusicID, c.Quality)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
// 可用性验证
|
|
||||||
if env.Config.Source.MusicIdVerify {
|
|
||||||
vef := wv_pool.Get().(*wm.VerifyInfo)
|
|
||||||
defer wv_pool.Put(vef)
|
|
||||||
vurl := ztool.Str_FastConcat(`https://`, example.Vef_wy, `&id=`, c.MusicID)
|
|
||||||
_, err := ztool.Net_HttpReq(http.MethodGet, vurl, nil, example.Header_wy, &vef)
|
|
||||||
if err != nil {
|
|
||||||
jx.Error(`Wy, VefReq: %s`, err)
|
|
||||||
msg = sources.ErrHttpReq
|
|
||||||
return
|
|
||||||
}
|
|
||||||
jx.Debug(`Wy, Vef: %+v`, vef)
|
|
||||||
if vef.Code != 200 || !vef.Success {
|
|
||||||
msg = ztool.Str_FastConcat(`暂不可用:`, vef.Message)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取外链
|
|
||||||
resp := wy_pool.Get().(*wm.PlayInfo)
|
|
||||||
defer wy_pool.Put(resp)
|
|
||||||
// 分流逻辑 (暂无其它节点)
|
|
||||||
// urls := [...]string{
|
|
||||||
// ztool.Str_FastConcat(`http://`, api_wy, `?id=`, c.MusicID, `&level=`, rquery, `&noCookie=true`),
|
|
||||||
// ztool.Str_FastConcat(`https://`, api_wy, `&id=`, c.MusicID, `&level=`, rquery, `&encodeType=`, c.Extname),
|
|
||||||
// }
|
|
||||||
// url := urls[rand.Intn(len(urls))]
|
|
||||||
url := ztool.Str_FastConcat(
|
|
||||||
`https://`, example.Api_wy, `&id=`, c.MusicID, `&level=`, rquery,
|
|
||||||
`×tamp=`, strconv.FormatInt(time.Now().UnixMilli(), 10),
|
|
||||||
)
|
|
||||||
// jx.Debug(`Wy, Url: %v`, url)
|
|
||||||
// wy源增加后端重试 默认3次
|
|
||||||
for i := 0; true; i++ {
|
|
||||||
_, err := ztool.Net_HttpReq(http.MethodGet, url, nil, example.Header_wy, &resp)
|
|
||||||
if err != nil {
|
|
||||||
jx.Error(`HttpReq, Err: %s, ReTry: %v`, err, i)
|
|
||||||
if i > 3 {
|
|
||||||
jx.Error(`Wy, HttpReq: %s`, err)
|
|
||||||
msg = sources.ErrHttpReq
|
|
||||||
return
|
|
||||||
}
|
|
||||||
time.Sleep(time.Second)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
jx.Debug(`Wy, Resp: %+v`, resp)
|
|
||||||
if len(resp.Data) == 0 {
|
|
||||||
msg = `No Data:Api接口忙,请稍后重试`
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var data = resp.Data[0]
|
|
||||||
if data.Code != 200 || data.FreeTrialInfo != nil {
|
|
||||||
// jx.Error("发生错误, 返回数据:\n%#v", resp)
|
|
||||||
msg = `触发风控或专辑单独收费: ` + strconv.Itoa(data.Code)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if data.Level != rquery {
|
|
||||||
msg = ztool.Str_FastConcat(`实际音质不匹配: `, rquery, ` <= `, data.Level) // 实际音质不匹配: exhigh <= standard
|
|
||||||
if !env.Config.Source.ForceFallback {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// jx.Info(`WyLink, RealQuality: %v`, data.Level)
|
|
||||||
outlink = data.URL
|
|
||||||
case sources.S_mg:
|
|
||||||
if !env.Config.Source.Enable_Mg {
|
|
||||||
msg = sources.ErrDisable
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if len(c.MusicID) != 11 {
|
|
||||||
msg = sources.E_VefMusicId
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if mg.Url != nil {
|
|
||||||
outlink, msg = mg.Url(c.MusicID, c.Quality)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
resp := mg_pool.Get().(*MgApi_Song)
|
|
||||||
defer mg_pool.Put(resp)
|
|
||||||
|
|
||||||
url := ztool.Str_FastConcat(`https://`, example.Api_mg, `?copyrightId=`, c.MusicID, `&type=`, rquery)
|
|
||||||
// jx.Debug(`Mg, Url: %v`, url)
|
|
||||||
_, err := ztool.Net_HttpReq(http.MethodGet, url, nil, example.Header_mg, &resp)
|
|
||||||
if err != nil {
|
|
||||||
jx.Error(`Mg, HttpReq: %s`, err)
|
|
||||||
msg = sources.ErrHttpReq
|
|
||||||
return
|
|
||||||
}
|
|
||||||
jx.Debug(`Mg, Resp: %+v`, resp)
|
|
||||||
if link := resp.Data.PlayURL; link != `` {
|
|
||||||
outlink = `https:` + link
|
|
||||||
} else {
|
|
||||||
msg = ztool.Str_FastConcat(resp.Code, `: `, resp.Msg)
|
|
||||||
}
|
|
||||||
case sources.S_kw:
|
|
||||||
if !env.Config.Source.Enable_Kw {
|
|
||||||
msg = sources.ErrDisable
|
|
||||||
return
|
|
||||||
}
|
|
||||||
outlink, msg = kw.Url(c.MusicID, c.Quality)
|
|
||||||
// if emsg != `` {
|
|
||||||
// msg = emsg
|
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// outlink = ourl
|
|
||||||
case sources.S_kg:
|
// var (
|
||||||
if !env.Config.Source.Enable_Kg {
|
// // 并发对象池 (用户限制在Router处实现)
|
||||||
msg = sources.ErrDisable
|
// wy_pool *sync.Pool
|
||||||
return
|
// mg_pool = &sync.Pool{New: func() any { return new(MgApi_Song) }}
|
||||||
}
|
// // kw_pool = &sync.Pool{New: func() any { return new(KwApi_Song) }}
|
||||||
if len(c.MusicID) != 32 {
|
// // kg_pool = &sync.Pool{New: func() any { return new(KgApi_Song) }}
|
||||||
msg = sources.E_VefMusicId
|
// // tx_pool = &sync.Pool{New: func() any { return new(res_tx) }}
|
||||||
return
|
// wv_pool *sync.Pool
|
||||||
}
|
// )
|
||||||
outlink, msg = kg.Url(c.MusicID, c.Quality)
|
|
||||||
// if emsg != `` {
|
// func init() {
|
||||||
// msg = emsg
|
// env.Inits.Add(func() {
|
||||||
|
// if env.Config.Source.Enable_Wy {
|
||||||
|
// wy_pool = &sync.Pool{New: func() any { return new(wm.PlayInfo) }}
|
||||||
|
// if env.Config.Source.MusicIdVerify {
|
||||||
|
// wv_pool = &sync.Pool{New: func() any { return new(wm.VerifyInfo) }}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 查询
|
||||||
|
// func (s *Source) GetLink(c *caches.Query) (outlink string, msg string) {
|
||||||
|
// rquery, ok := s.Verify(c)
|
||||||
|
// if !ok /*&& c.Source != `tx`*/ {
|
||||||
|
// msg = sources.Err_Verify //`Verify Failed`
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// outlink = ourl
|
// // var outlink string
|
||||||
// case sources.S_kg:
|
// jx := env.Loger.NewGroup(`Sources`) //sources.Loger.AppGroup(`builtin`) //env.Loger.NewGroup(`JieXiApis`)
|
||||||
// if !env.Config.Custom.Kg_Enable {
|
// defer jx.Free()
|
||||||
|
// switch c.Source {
|
||||||
|
// case sources.S_wy:
|
||||||
|
// if !env.Config.Source.Enable_Wy {
|
||||||
// msg = sources.ErrDisable
|
// msg = sources.ErrDisable
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// resp := kg_pool.Get().(*KgApi_Song)
|
// if wy.Url != nil {
|
||||||
// defer kg_pool.Put(resp)
|
// outlink, msg = wy.Url(c.MusicID, c.Quality)
|
||||||
|
// break
|
||||||
// // sep := strings.Split(c.MusicID, `-`) // 分割 Hash-Album 如 6DC276334F56E22BE2A0E8254D332B45-13097991
|
// }
|
||||||
// // alb := func() string {
|
// // 可用性验证
|
||||||
// // if len(sep) >= 2 {
|
// if env.Config.Source.MusicIdVerify {
|
||||||
// // return sep[1]
|
// vef := wv_pool.Get().(*wm.VerifyInfo)
|
||||||
// // }
|
// defer wv_pool.Put(vef)
|
||||||
// // return ``
|
// vurl := ztool.Str_FastConcat(`https://`, example.Vef_wy, `&id=`, c.MusicID)
|
||||||
// // }()
|
// _, err := ztool.Net_HttpReq(http.MethodGet, vurl, nil, example.Header_wy, &vef)
|
||||||
// sep := c.Split()
|
|
||||||
// url := ztool.Str_FastConcat(api_kg, `&hash=`, sep[0], `&album_id=`, sep[1], `&_=`, strconv.FormatInt(time.Now().UnixMilli(), 10))
|
|
||||||
// // jx.Debug(`Kg, Url: %s`, url)
|
|
||||||
// _, err := ztool.Net_HttpReq(http.MethodGet, url, nil, nil, &resp)
|
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// jx.Error(`Kg, HttpReq: %s`, err)
|
// jx.Error(`Wy, VefReq: %s`, err)
|
||||||
// msg = sources.ErrHttpReq
|
// msg = sources.ErrHttpReq
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// jx.Debug(`Kg, Resp: %+v`, resp)
|
// jx.Debug(`Wy, Vef: %+v`, vef)
|
||||||
// if resp.ErrCode != 0 {
|
// if vef.Code != 200 || !vef.Success {
|
||||||
// msg = ztool.Str_FastConcat(`Error: `, strconv.Itoa(resp.ErrCode))
|
// msg = ztool.Str_FastConcat(`暂不可用:`, vef.Message)
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// var data KgApi_Data
|
|
||||||
// err = ztool.Val_MapToStruct(resp.Data, &data)
|
|
||||||
// if err != nil {
|
|
||||||
// msg = err.Error()
|
|
||||||
// return
|
|
||||||
// }
|
// }
|
||||||
// if data.PlayBackupURL == `` {
|
// // 获取外链
|
||||||
// if data.PlayURL == `` {
|
// resp := wy_pool.Get().(*wm.PlayInfo)
|
||||||
// msg = sources.ErrNoLink
|
// defer wy_pool.Put(resp)
|
||||||
// return
|
// // 分流逻辑 (暂无其它节点)
|
||||||
// }
|
// // urls := [...]string{
|
||||||
// outlink = data.PlayURL
|
// // ztool.Str_FastConcat(`http://`, api_wy, `?id=`, c.MusicID, `&level=`, rquery, `&noCookie=true`),
|
||||||
// }
|
// // ztool.Str_FastConcat(`https://`, api_wy, `&id=`, c.MusicID, `&level=`, rquery, `&encodeType=`, c.Extname),
|
||||||
// outlink = data.PlayBackupURL
|
// // }
|
||||||
case sources.S_tx:
|
// // url := urls[rand.Intn(len(urls))]
|
||||||
if !env.Config.Source.Enable_Tx {
|
// url := ztool.Str_FastConcat(
|
||||||
msg = sources.ErrDisable
|
// `https://`, example.Api_wy, `&id=`, c.MusicID, `&level=`, rquery,
|
||||||
return
|
// `×tamp=`, strconv.FormatInt(time.Now().UnixMilli(), 10),
|
||||||
}
|
|
||||||
if len(c.MusicID) != 14 {
|
|
||||||
msg = sources.E_VefMusicId
|
|
||||||
return
|
|
||||||
}
|
|
||||||
outlink, msg = tx.Url(c.MusicID, c.Quality)
|
|
||||||
// if emsg != `` {
|
|
||||||
// msg = emsg
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// outlink = ourl
|
|
||||||
// case `otx`:
|
|
||||||
// resp := tx_pool.Get().(*res_tx)
|
|
||||||
// defer tx_pool.Put(resp)
|
|
||||||
|
|
||||||
// sep := c.Split()
|
|
||||||
// url := ztool.Str_FastConcat(api_tx,
|
|
||||||
// `{"comm":{"ct":24,"cv":0,"format":"json","uin":"10086"},"req":{"method":"GetCdnDispatch","module":"CDN.SrfCdnDispatchServer","param":{"calltype":0,"guid":"1535153710","userip":""}},"req_0":{"method":"CgiGetVkey","module":"vkey.GetVkeyServer","param":{`,
|
|
||||||
// func(s string) string {
|
|
||||||
// if s == `` {
|
|
||||||
// return ``
|
|
||||||
// }
|
|
||||||
// return ztool.Str_FastConcat(`"filename":["`, rquery, s, `.`, c.Extname, `"],`)
|
|
||||||
// }(sep[1]),
|
|
||||||
// `"guid":"1535153710","loginflag":1,"platform":"20","songmid":["`, sep[0], `"],"songtype":[0],"uin":"10086"}}}`,
|
|
||||||
// )
|
// )
|
||||||
// // jx.Debug(`Tx, Url: %s`, url)
|
// // jx.Debug(`Wy, Url: %v`, url)
|
||||||
// out, err := ztool.Net_HttpReq(http.MethodGet, url, nil, header_tx, &resp)
|
// // wy源增加后端重试 默认3次
|
||||||
|
// for i := 0; true; i++ {
|
||||||
|
// _, err := ztool.Net_HttpReq(http.MethodGet, url, nil, example.Header_wy, &resp)
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// jx.Error(`Tx, HttpReq: %s`, err)
|
// jx.Error(`HttpReq, Err: %s, ReTry: %v`, err, i)
|
||||||
// msg = errHttpReq
|
// if i > 3 {
|
||||||
|
// jx.Error(`Wy, HttpReq: %s`, err)
|
||||||
|
// msg = sources.ErrHttpReq
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// jx.Debug(`Tx, Resp: %s`, out)
|
// time.Sleep(time.Second)
|
||||||
// if resp.Code != 0 {
|
// continue
|
||||||
// msg = ztool.Str_FastConcat(`Error: `, strconv.Itoa(resp.Code))
|
// }
|
||||||
|
// break
|
||||||
|
// }
|
||||||
|
// jx.Debug(`Wy, Resp: %+v`, resp)
|
||||||
|
// if len(resp.Data) == 0 {
|
||||||
|
// msg = `No Data:Api接口忙,请稍后重试`
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// var data = resp.Data[0]
|
||||||
|
// if data.Code != 200 || data.FreeTrialInfo != nil {
|
||||||
|
// // jx.Error("发生错误, 返回数据:\n%#v", resp)
|
||||||
|
// msg = `触发风控或专辑单独收费: ` + strconv.Itoa(data.Code)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// if data.Level != rquery {
|
||||||
|
// msg = ztool.Str_FastConcat(`实际音质不匹配: `, rquery, ` <= `, data.Level) // 实际音质不匹配: exhigh <= standard
|
||||||
|
// if !env.Config.Source.ForceFallback {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// // jx.Info(`WyLink, RealQuality: %v`, data.Level)
|
||||||
|
// outlink = data.URL
|
||||||
|
// case sources.S_mg:
|
||||||
|
// if !env.Config.Source.Enable_Mg {
|
||||||
|
// msg = sources.ErrDisable
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// if len(c.MusicID) != 11 {
|
||||||
|
// msg = sources.E_VefMusicId
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// if mg.Url != nil {
|
||||||
|
// outlink, msg = mg.Url(c.MusicID, c.Quality)
|
||||||
|
// break
|
||||||
|
// }
|
||||||
|
// resp := mg_pool.Get().(*MgApi_Song)
|
||||||
|
// defer mg_pool.Put(resp)
|
||||||
|
|
||||||
|
// url := ztool.Str_FastConcat(`https://`, example.Api_mg, `?copyrightId=`, c.MusicID, `&type=`, rquery)
|
||||||
|
// // jx.Debug(`Mg, Url: %v`, url)
|
||||||
|
// _, err := ztool.Net_HttpReq(http.MethodGet, url, nil, example.Header_mg, &resp)
|
||||||
|
// if err != nil {
|
||||||
|
// jx.Error(`Mg, HttpReq: %s`, err)
|
||||||
|
// msg = sources.ErrHttpReq
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// jx.Debug(`Mg, Resp: %+v`, resp)
|
||||||
|
// if link := resp.Data.PlayURL; link != `` {
|
||||||
|
// outlink = `https:` + link
|
||||||
|
// } else {
|
||||||
|
// msg = ztool.Str_FastConcat(resp.Code, `: `, resp.Msg)
|
||||||
|
// }
|
||||||
|
// case sources.S_kw:
|
||||||
|
// if !env.Config.Source.Enable_Kw {
|
||||||
|
// msg = sources.ErrDisable
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// outlink, msg = kw.Url(c.MusicID, c.Quality)
|
||||||
|
// // if emsg != `` {
|
||||||
|
// // msg = emsg
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // outlink = ourl
|
||||||
|
// case sources.S_kg:
|
||||||
|
// if !env.Config.Source.Enable_Kg {
|
||||||
|
// msg = sources.ErrDisable
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// if len(c.MusicID) != 32 {
|
||||||
|
// msg = sources.E_VefMusicId
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// outlink, msg = kg.Url(c.MusicID, c.Quality)
|
||||||
|
// // if emsg != `` {
|
||||||
|
// // msg = emsg
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // outlink = ourl
|
||||||
|
// // case sources.S_kg:
|
||||||
|
// // if !env.Config.Custom.Kg_Enable {
|
||||||
|
// // msg = sources.ErrDisable
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // resp := kg_pool.Get().(*KgApi_Song)
|
||||||
|
// // defer kg_pool.Put(resp)
|
||||||
|
|
||||||
|
// // // sep := strings.Split(c.MusicID, `-`) // 分割 Hash-Album 如 6DC276334F56E22BE2A0E8254D332B45-13097991
|
||||||
|
// // // alb := func() string {
|
||||||
|
// // // if len(sep) >= 2 {
|
||||||
|
// // // return sep[1]
|
||||||
|
// // // }
|
||||||
|
// // // return ``
|
||||||
|
// // // }()
|
||||||
|
// // sep := c.Split()
|
||||||
|
// // url := ztool.Str_FastConcat(api_kg, `&hash=`, sep[0], `&album_id=`, sep[1], `&_=`, strconv.FormatInt(time.Now().UnixMilli(), 10))
|
||||||
|
// // // jx.Debug(`Kg, Url: %s`, url)
|
||||||
|
// // _, err := ztool.Net_HttpReq(http.MethodGet, url, nil, nil, &resp)
|
||||||
|
// // if err != nil {
|
||||||
|
// // jx.Error(`Kg, HttpReq: %s`, err)
|
||||||
|
// // msg = sources.ErrHttpReq
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // jx.Debug(`Kg, Resp: %+v`, resp)
|
||||||
|
// // if resp.ErrCode != 0 {
|
||||||
|
// // msg = ztool.Str_FastConcat(`Error: `, strconv.Itoa(resp.ErrCode))
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // var data KgApi_Data
|
||||||
|
// // err = ztool.Val_MapToStruct(resp.Data, &data)
|
||||||
|
// // if err != nil {
|
||||||
|
// // msg = err.Error()
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // if data.PlayBackupURL == `` {
|
||||||
|
// // if data.PlayURL == `` {
|
||||||
|
// // msg = sources.ErrNoLink
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // outlink = data.PlayURL
|
||||||
|
// // }
|
||||||
|
// // outlink = data.PlayBackupURL
|
||||||
|
// case sources.S_tx:
|
||||||
|
// if !env.Config.Source.Enable_Tx {
|
||||||
|
// msg = sources.ErrDisable
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// if len(c.MusicID) != 14 {
|
||||||
|
// msg = sources.E_VefMusicId
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// outlink, msg = tx.Url(c.MusicID, c.Quality)
|
||||||
|
// // if emsg != `` {
|
||||||
|
// // msg = emsg
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // outlink = ourl
|
||||||
|
// // case `otx`:
|
||||||
|
// // resp := tx_pool.Get().(*res_tx)
|
||||||
|
// // defer tx_pool.Put(resp)
|
||||||
|
|
||||||
|
// // sep := c.Split()
|
||||||
|
// // url := ztool.Str_FastConcat(api_tx,
|
||||||
|
// // `{"comm":{"ct":24,"cv":0,"format":"json","uin":"10086"},"req":{"method":"GetCdnDispatch","module":"CDN.SrfCdnDispatchServer","param":{"calltype":0,"guid":"1535153710","userip":""}},"req_0":{"method":"CgiGetVkey","module":"vkey.GetVkeyServer","param":{`,
|
||||||
|
// // func(s string) string {
|
||||||
|
// // if s == `` {
|
||||||
|
// // return ``
|
||||||
|
// // }
|
||||||
|
// // return ztool.Str_FastConcat(`"filename":["`, rquery, s, `.`, c.Extname, `"],`)
|
||||||
|
// // }(sep[1]),
|
||||||
|
// // `"guid":"1535153710","loginflag":1,"platform":"20","songmid":["`, sep[0], `"],"songtype":[0],"uin":"10086"}}}`,
|
||||||
|
// // )
|
||||||
|
// // // jx.Debug(`Tx, Url: %s`, url)
|
||||||
|
// // out, err := ztool.Net_HttpReq(http.MethodGet, url, nil, header_tx, &resp)
|
||||||
|
// // if err != nil {
|
||||||
|
// // jx.Error(`Tx, HttpReq: %s`, err)
|
||||||
|
// // msg = errHttpReq
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // jx.Debug(`Tx, Resp: %s`, out)
|
||||||
|
// // if resp.Code != 0 {
|
||||||
|
// // msg = ztool.Str_FastConcat(`Error: `, strconv.Itoa(resp.Code))
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // if resp.Req0.Data.Midurlinfo[0].Purl == `` {
|
||||||
|
// // msg = errNoLink
|
||||||
|
// // return
|
||||||
|
// // }
|
||||||
|
// // outlink = ztool.Str_FastConcat(`https://dl.stream.qqmusic.qq.com/`, resp.Req0.Data.Midurlinfo[0].Purl)
|
||||||
|
// default:
|
||||||
|
// msg = `不支持的平台`
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// if resp.Req0.Data.Midurlinfo[0].Purl == `` {
|
|
||||||
// msg = errNoLink
|
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// outlink = ztool.Str_FastConcat(`https://dl.stream.qqmusic.qq.com/`, resp.Req0.Data.Midurlinfo[0].Purl)
|
|
||||||
default:
|
|
||||||
msg = `不支持的平台`
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
@ -1,274 +1,274 @@
|
|||||||
package builtin
|
package builtin
|
||||||
|
|
||||||
import (
|
// import (
|
||||||
"lx-source/src/sources"
|
// "lx-source/src/sources"
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
// 网易音乐接口 (方格/简繁)
|
|
||||||
// WyApi_Song struct {
|
|
||||||
// Data []struct {
|
|
||||||
// ID int `json:"id"`
|
|
||||||
// URL string `json:"url"`
|
|
||||||
// Br int `json:"br"`
|
|
||||||
// Size int `json:"size"`
|
|
||||||
// Md5 string `json:"md5"`
|
|
||||||
// Code int `json:"code"`
|
|
||||||
// Expi int `json:"expi"`
|
|
||||||
// Type string `json:"type"`
|
|
||||||
// Gain float64 `json:"gain"`
|
|
||||||
// Peak float64 `json:"peak"`
|
|
||||||
// Fee int `json:"fee"`
|
|
||||||
// Uf interface{} `json:"uf"`
|
|
||||||
// Payed int `json:"payed"`
|
|
||||||
// Flag int `json:"flag"`
|
|
||||||
// CanExtend bool `json:"canExtend"`
|
|
||||||
// FreeTrialInfo interface{} `json:"freeTrialInfo"`
|
|
||||||
// Level string `json:"level"`
|
|
||||||
// EncodeType string `json:"encodeType"`
|
|
||||||
// FreeTrialPrivilege struct {
|
|
||||||
// ResConsumable bool `json:"resConsumable"`
|
|
||||||
// UserConsumable bool `json:"userConsumable"`
|
|
||||||
// ListenType interface{} `json:"listenType"`
|
|
||||||
// CannotListenReason interface{} `json:"cannotListenReason"`
|
|
||||||
// PlayReason interface{} `json:"playReason"`
|
|
||||||
// } `json:"freeTrialPrivilege"`
|
|
||||||
// FreeTimeTrialPrivilege struct {
|
|
||||||
// ResConsumable bool `json:"resConsumable"`
|
|
||||||
// UserConsumable bool `json:"userConsumable"`
|
|
||||||
// Type int `json:"type"`
|
|
||||||
// RemainTime int `json:"remainTime"`
|
|
||||||
// } `json:"freeTimeTrialPrivilege"`
|
|
||||||
// URLSource int `json:"urlSource"`
|
|
||||||
// RightSource int `json:"rightSource"`
|
|
||||||
// PodcastCtrp interface{} `json:"podcastCtrp"`
|
|
||||||
// EffectTypes interface{} `json:"effectTypes"`
|
|
||||||
// Time int `json:"time"`
|
|
||||||
// } `json:"data"`
|
|
||||||
// Code int `json:"code"`
|
|
||||||
// }
|
|
||||||
// WyApi_Vef struct {
|
|
||||||
// Code int16 `json:"code"`
|
|
||||||
// Success bool `json:"success"`
|
|
||||||
// Message string `json:"message"`
|
|
||||||
// }
|
|
||||||
// 咪咕音乐接口
|
|
||||||
MgApi_Song struct {
|
|
||||||
Code string `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data struct {
|
|
||||||
PlayURL string `json:"playUrl"`
|
|
||||||
FormatID string `json:"formatId"`
|
|
||||||
SalePrice string `json:"salePrice"`
|
|
||||||
BizType string `json:"bizType"`
|
|
||||||
BizCode string `json:"bizCode"`
|
|
||||||
AuditionsLength int `json:"auditionsLength"`
|
|
||||||
} `json:"data"`
|
|
||||||
}
|
|
||||||
// 酷我音乐接口 (波点)
|
|
||||||
// KwApi_Song struct {
|
|
||||||
// Code int `json:"code"`
|
|
||||||
// Msg string `json:"msg"`
|
|
||||||
// ReqID string `json:"reqId"`
|
|
||||||
// Data struct {
|
|
||||||
// Duration int `json:"duration"`
|
|
||||||
// AudioInfo struct {
|
|
||||||
// Bitrate string `json:"bitrate"`
|
|
||||||
// Format string `json:"format"`
|
|
||||||
// Level string `json:"level"`
|
|
||||||
// Size string `json:"size"`
|
|
||||||
// } `json:"audioInfo"`
|
|
||||||
// URL string `json:"url"`
|
|
||||||
// } `json:"data"`
|
|
||||||
// ProfileID string `json:"profileId"`
|
|
||||||
// CurTime int64 `json:"curTime"`
|
|
||||||
// }
|
|
||||||
// 酷狗试听接口
|
|
||||||
// KgApi_Song struct {
|
|
||||||
// Status int `json:"status"`
|
|
||||||
// ErrCode int `json:"err_code"`
|
|
||||||
// Data any `json:"data"`
|
|
||||||
// }
|
|
||||||
// KgApi_Data struct {
|
|
||||||
// // Hash string `json:"hash"`
|
|
||||||
// // Timelength int `json:"timelength"`
|
|
||||||
// // Filesize int `json:"filesize"`
|
|
||||||
// // AudioName string `json:"audio_name"`
|
|
||||||
// // HaveAlbum int `json:"have_album"`
|
|
||||||
// // AlbumName string `json:"album_name"`
|
|
||||||
// // AlbumID any `json:"album_id"`
|
|
||||||
// // Img string `json:"img"`
|
|
||||||
// // HaveMv int `json:"have_mv"`
|
|
||||||
// // VideoID any `json:"video_id"`
|
|
||||||
// // AuthorName string `json:"author_name"`
|
|
||||||
// // SongName string `json:"song_name"`
|
|
||||||
// // Lyrics string `json:"lyrics"`
|
|
||||||
// // AuthorID any `json:"author_id"`
|
|
||||||
// // Privilege int `json:"privilege"`
|
|
||||||
// // Privilege2 string `json:"privilege2"`
|
|
||||||
// PlayURL string `json:"play_url"`
|
|
||||||
// // Authors []struct {
|
|
||||||
// // AuthorID any `json:"author_id"`
|
|
||||||
// // AuthorName string `json:"author_name"`
|
|
||||||
// // IsPublish string `json:"is_publish"`
|
|
||||||
// // SizableAvatar string `json:"sizable_avatar"`
|
|
||||||
// // EAuthorID string `json:"e_author_id"`
|
|
||||||
// // Avatar string `json:"avatar"`
|
|
||||||
// // } `json:"authors"`
|
|
||||||
// // IsFreePart int `json:"is_free_part"`
|
|
||||||
// // Bitrate int `json:"bitrate"`
|
|
||||||
// // RecommendAlbumID string `json:"recommend_album_id"`
|
|
||||||
// // StoreType string `json:"store_type"`
|
|
||||||
// // AlbumAudioID int `json:"album_audio_id"`
|
|
||||||
// // IsPublish int `json:"is_publish"`
|
|
||||||
// // EAuthorID string `json:"e_author_id"`
|
|
||||||
// // AudioID any `json:"audio_id"`
|
|
||||||
// // HasPrivilege bool `json:"has_privilege"`
|
|
||||||
// PlayBackupURL string `json:"play_backup_url"`
|
|
||||||
// // SmallLibrarySong int `json:"small_library_song"`
|
|
||||||
// // EncodeAlbumID string `json:"encode_album_id"`
|
|
||||||
// // EncodeAlbumAudioID string `json:"encode_album_audio_id"`
|
|
||||||
// // EVideoID string `json:"e_video_id"`
|
|
||||||
// }
|
|
||||||
// 腾讯试听接口
|
|
||||||
// res_tx struct {
|
|
||||||
// Code int `json:"code"`
|
|
||||||
// // Ts int64 `json:"ts"`
|
|
||||||
// // StartTs int64 `json:"start_ts"`
|
|
||||||
// // Traceid string `json:"traceid"`
|
|
||||||
// // Req struct {
|
|
||||||
// // Code int `json:"code"`
|
|
||||||
// // Data struct {
|
|
||||||
// // Expiration int `json:"expiration"`
|
|
||||||
// // Freeflowsip []string `json:"freeflowsip"`
|
|
||||||
// // Keepalivefile string `json:"keepalivefile"`
|
|
||||||
// // Msg string `json:"msg"`
|
|
||||||
// // Retcode int `json:"retcode"`
|
|
||||||
// // Servercheck string `json:"servercheck"`
|
|
||||||
// // Sip []string `json:"sip"`
|
|
||||||
// // Testfile2G string `json:"testfile2g"`
|
|
||||||
// // Testfilewifi string `json:"testfilewifi"`
|
|
||||||
// // Uin string `json:"uin"`
|
|
||||||
// // Userip string `json:"userip"`
|
|
||||||
// // Vkey string `json:"vkey"`
|
|
||||||
// // } `json:"data"`
|
|
||||||
// // } `json:"req"`
|
|
||||||
// Req0 struct {
|
|
||||||
// Code int `json:"code"`
|
|
||||||
// Data struct {
|
|
||||||
// // Uin string `json:"uin"`
|
|
||||||
// // Retcode int `json:"retcode"`
|
|
||||||
// // VerifyType int `json:"verify_type"`
|
|
||||||
// // LoginKey string `json:"login_key"`
|
|
||||||
// // Msg string `json:"msg"`
|
|
||||||
// // Sip []string `json:"sip"`
|
|
||||||
// // Thirdip []string `json:"thirdip"`
|
|
||||||
// // Testfile2G string `json:"testfile2g"`
|
|
||||||
// // Testfilewifi string `json:"testfilewifi"`
|
|
||||||
// Midurlinfo []struct {
|
|
||||||
// // Songmid string `json:"songmid"`
|
|
||||||
// // Filename string `json:"filename"`
|
|
||||||
// Purl string `json:"purl"`
|
|
||||||
// // Errtype string `json:"errtype"`
|
|
||||||
// // P2Pfromtag int `json:"p2pfromtag"`
|
|
||||||
// // Qmdlfromtag int `json:"qmdlfromtag"`
|
|
||||||
// // CommonDownfromtag int `json:"common_downfromtag"`
|
|
||||||
// // VipDownfromtag int `json:"vip_downfromtag"`
|
|
||||||
// // Pdl int `json:"pdl"`
|
|
||||||
// // Premain int `json:"premain"`
|
|
||||||
// // Hisdown int `json:"hisdown"`
|
|
||||||
// // Hisbuy int `json:"hisbuy"`
|
|
||||||
// // UIAlert int `json:"uiAlert"`
|
|
||||||
// // Isbuy int `json:"isbuy"`
|
|
||||||
// // Pneedbuy int `json:"pneedbuy"`
|
|
||||||
// // Pneed int `json:"pneed"`
|
|
||||||
// // Isonly int `json:"isonly"`
|
|
||||||
// // Onecan int `json:"onecan"`
|
|
||||||
// // Result int `json:"result"`
|
|
||||||
// // Tips string `json:"tips"`
|
|
||||||
// // Opi48Kurl string `json:"opi48kurl"`
|
|
||||||
// // Opi96Kurl string `json:"opi96kurl"`
|
|
||||||
// // Opi192Kurl string `json:"opi192kurl"`
|
|
||||||
// // Opiflackurl string `json:"opiflackurl"`
|
|
||||||
// // Opi128Kurl string `json:"opi128kurl"`
|
|
||||||
// // Opi192Koggurl string `json:"opi192koggurl"`
|
|
||||||
// // Wififromtag string `json:"wififromtag"`
|
|
||||||
// // Flowfromtag string `json:"flowfromtag"`
|
|
||||||
// // Wifiurl string `json:"wifiurl"`
|
|
||||||
// // Flowurl string `json:"flowurl"`
|
|
||||||
// // Vkey string `json:"vkey"`
|
|
||||||
// // Opi30Surl string `json:"opi30surl"`
|
|
||||||
// // Ekey string `json:"ekey"`
|
|
||||||
// // AuthSwitch int `json:"auth_switch"`
|
|
||||||
// // Subcode int `json:"subcode"`
|
|
||||||
// // Opi96Koggurl string `json:"opi96koggurl"`
|
|
||||||
// // AuthSwitch2 int `json:"auth_switch2"`
|
|
||||||
// } `json:"midurlinfo"`
|
|
||||||
// // Servercheck string `json:"servercheck"`
|
|
||||||
// // Expiration int `json:"expiration"`
|
|
||||||
// } `json:"data"`
|
|
||||||
// } `json:"req_0"`
|
|
||||||
// }
|
|
||||||
)
|
|
||||||
|
|
||||||
// const (
|
|
||||||
// // Source
|
|
||||||
// s_wy = `wy`
|
|
||||||
// s_mg = `mg`
|
|
||||||
// s_kw = `kw`
|
|
||||||
// s_kg = `kg`
|
|
||||||
// s_tx = `tx`
|
|
||||||
// // s_lx = `lx`
|
|
||||||
// )
|
// )
|
||||||
|
|
||||||
var (
|
// type (
|
||||||
// 音质列表 ( [通用音质][音乐平台]对应音质 )
|
// // 网易音乐接口 (方格/简繁)
|
||||||
/*
|
// // WyApi_Song struct {
|
||||||
注: kg源使用对应hash匹配音质,故为空
|
// // Data []struct {
|
||||||
*/
|
// // ID int `json:"id"`
|
||||||
qualitys = map[string]map[string]string{
|
// // URL string `json:"url"`
|
||||||
sources.Q_128k: {
|
// // Br int `json:"br"`
|
||||||
sources.S_wy: `standard`,
|
// // Size int `json:"size"`
|
||||||
sources.S_mg: `1`,
|
// // Md5 string `json:"md5"`
|
||||||
sources.S_kw: sources.Q_128k,
|
// // Code int `json:"code"`
|
||||||
sources.S_kg: ``,
|
// // Expi int `json:"expi"`
|
||||||
sources.S_tx: `M500`,
|
// // Type string `json:"type"`
|
||||||
},
|
// // Gain float64 `json:"gain"`
|
||||||
sources.Q_320k: {
|
// // Peak float64 `json:"peak"`
|
||||||
sources.S_wy: `exhigh`,
|
// // Fee int `json:"fee"`
|
||||||
sources.S_mg: `2`,
|
// // Uf interface{} `json:"uf"`
|
||||||
sources.S_kw: sources.Q_320k,
|
// // Payed int `json:"payed"`
|
||||||
sources.S_kg: ``,
|
// // Flag int `json:"flag"`
|
||||||
sources.S_tx: `M800`,
|
// // CanExtend bool `json:"canExtend"`
|
||||||
},
|
// // FreeTrialInfo interface{} `json:"freeTrialInfo"`
|
||||||
sources.Q_flac: {
|
// // Level string `json:"level"`
|
||||||
sources.S_wy: `lossless`,
|
// // EncodeType string `json:"encodeType"`
|
||||||
sources.S_mg: `3`,
|
// // FreeTrialPrivilege struct {
|
||||||
sources.S_kw: `2000k`,
|
// // ResConsumable bool `json:"resConsumable"`
|
||||||
sources.S_kg: ``,
|
// // UserConsumable bool `json:"userConsumable"`
|
||||||
sources.S_tx: `F000`,
|
// // ListenType interface{} `json:"listenType"`
|
||||||
},
|
// // CannotListenReason interface{} `json:"cannotListenReason"`
|
||||||
sources.Q_fl24: {
|
// // PlayReason interface{} `json:"playReason"`
|
||||||
sources.S_wy: `hires`,
|
// // } `json:"freeTrialPrivilege"`
|
||||||
sources.S_mg: `4`,
|
// // FreeTimeTrialPrivilege struct {
|
||||||
sources.S_kg: ``,
|
// // ResConsumable bool `json:"resConsumable"`
|
||||||
// sources.S_tx: `RS01`,
|
// // UserConsumable bool `json:"userConsumable"`
|
||||||
},
|
// // Type int `json:"type"`
|
||||||
// `fl24`: {
|
// // RemainTime int `json:"remainTime"`
|
||||||
// s_wy: `hires`,
|
// // } `json:"freeTimeTrialPrivilege"`
|
||||||
// s_mg: `4`,
|
// // URLSource int `json:"urlSource"`
|
||||||
|
// // RightSource int `json:"rightSource"`
|
||||||
|
// // PodcastCtrp interface{} `json:"podcastCtrp"`
|
||||||
|
// // EffectTypes interface{} `json:"effectTypes"`
|
||||||
|
// // Time int `json:"time"`
|
||||||
|
// // } `json:"data"`
|
||||||
|
// // Code int `json:"code"`
|
||||||
|
// // }
|
||||||
|
// // WyApi_Vef struct {
|
||||||
|
// // Code int16 `json:"code"`
|
||||||
|
// // Success bool `json:"success"`
|
||||||
|
// // Message string `json:"message"`
|
||||||
|
// // }
|
||||||
|
// // 咪咕音乐接口
|
||||||
|
// MgApi_Song struct {
|
||||||
|
// Code string `json:"code"`
|
||||||
|
// Msg string `json:"msg"`
|
||||||
|
// Data struct {
|
||||||
|
// PlayURL string `json:"playUrl"`
|
||||||
|
// FormatID string `json:"formatId"`
|
||||||
|
// SalePrice string `json:"salePrice"`
|
||||||
|
// BizType string `json:"bizType"`
|
||||||
|
// BizCode string `json:"bizCode"`
|
||||||
|
// AuditionsLength int `json:"auditionsLength"`
|
||||||
|
// } `json:"data"`
|
||||||
|
// }
|
||||||
|
// // 酷我音乐接口 (波点)
|
||||||
|
// // KwApi_Song struct {
|
||||||
|
// // Code int `json:"code"`
|
||||||
|
// // Msg string `json:"msg"`
|
||||||
|
// // ReqID string `json:"reqId"`
|
||||||
|
// // Data struct {
|
||||||
|
// // Duration int `json:"duration"`
|
||||||
|
// // AudioInfo struct {
|
||||||
|
// // Bitrate string `json:"bitrate"`
|
||||||
|
// // Format string `json:"format"`
|
||||||
|
// // Level string `json:"level"`
|
||||||
|
// // Size string `json:"size"`
|
||||||
|
// // } `json:"audioInfo"`
|
||||||
|
// // URL string `json:"url"`
|
||||||
|
// // } `json:"data"`
|
||||||
|
// // ProfileID string `json:"profileId"`
|
||||||
|
// // CurTime int64 `json:"curTime"`
|
||||||
|
// // }
|
||||||
|
// // 酷狗试听接口
|
||||||
|
// // KgApi_Song struct {
|
||||||
|
// // Status int `json:"status"`
|
||||||
|
// // ErrCode int `json:"err_code"`
|
||||||
|
// // Data any `json:"data"`
|
||||||
|
// // }
|
||||||
|
// // KgApi_Data struct {
|
||||||
|
// // // Hash string `json:"hash"`
|
||||||
|
// // // Timelength int `json:"timelength"`
|
||||||
|
// // // Filesize int `json:"filesize"`
|
||||||
|
// // // AudioName string `json:"audio_name"`
|
||||||
|
// // // HaveAlbum int `json:"have_album"`
|
||||||
|
// // // AlbumName string `json:"album_name"`
|
||||||
|
// // // AlbumID any `json:"album_id"`
|
||||||
|
// // // Img string `json:"img"`
|
||||||
|
// // // HaveMv int `json:"have_mv"`
|
||||||
|
// // // VideoID any `json:"video_id"`
|
||||||
|
// // // AuthorName string `json:"author_name"`
|
||||||
|
// // // SongName string `json:"song_name"`
|
||||||
|
// // // Lyrics string `json:"lyrics"`
|
||||||
|
// // // AuthorID any `json:"author_id"`
|
||||||
|
// // // Privilege int `json:"privilege"`
|
||||||
|
// // // Privilege2 string `json:"privilege2"`
|
||||||
|
// // PlayURL string `json:"play_url"`
|
||||||
|
// // // Authors []struct {
|
||||||
|
// // // AuthorID any `json:"author_id"`
|
||||||
|
// // // AuthorName string `json:"author_name"`
|
||||||
|
// // // IsPublish string `json:"is_publish"`
|
||||||
|
// // // SizableAvatar string `json:"sizable_avatar"`
|
||||||
|
// // // EAuthorID string `json:"e_author_id"`
|
||||||
|
// // // Avatar string `json:"avatar"`
|
||||||
|
// // // } `json:"authors"`
|
||||||
|
// // // IsFreePart int `json:"is_free_part"`
|
||||||
|
// // // Bitrate int `json:"bitrate"`
|
||||||
|
// // // RecommendAlbumID string `json:"recommend_album_id"`
|
||||||
|
// // // StoreType string `json:"store_type"`
|
||||||
|
// // // AlbumAudioID int `json:"album_audio_id"`
|
||||||
|
// // // IsPublish int `json:"is_publish"`
|
||||||
|
// // // EAuthorID string `json:"e_author_id"`
|
||||||
|
// // // AudioID any `json:"audio_id"`
|
||||||
|
// // // HasPrivilege bool `json:"has_privilege"`
|
||||||
|
// // PlayBackupURL string `json:"play_backup_url"`
|
||||||
|
// // // SmallLibrarySong int `json:"small_library_song"`
|
||||||
|
// // // EncodeAlbumID string `json:"encode_album_id"`
|
||||||
|
// // // EncodeAlbumAudioID string `json:"encode_album_audio_id"`
|
||||||
|
// // // EVideoID string `json:"e_video_id"`
|
||||||
|
// // }
|
||||||
|
// // 腾讯试听接口
|
||||||
|
// // res_tx struct {
|
||||||
|
// // Code int `json:"code"`
|
||||||
|
// // // Ts int64 `json:"ts"`
|
||||||
|
// // // StartTs int64 `json:"start_ts"`
|
||||||
|
// // // Traceid string `json:"traceid"`
|
||||||
|
// // // Req struct {
|
||||||
|
// // // Code int `json:"code"`
|
||||||
|
// // // Data struct {
|
||||||
|
// // // Expiration int `json:"expiration"`
|
||||||
|
// // // Freeflowsip []string `json:"freeflowsip"`
|
||||||
|
// // // Keepalivefile string `json:"keepalivefile"`
|
||||||
|
// // // Msg string `json:"msg"`
|
||||||
|
// // // Retcode int `json:"retcode"`
|
||||||
|
// // // Servercheck string `json:"servercheck"`
|
||||||
|
// // // Sip []string `json:"sip"`
|
||||||
|
// // // Testfile2G string `json:"testfile2g"`
|
||||||
|
// // // Testfilewifi string `json:"testfilewifi"`
|
||||||
|
// // // Uin string `json:"uin"`
|
||||||
|
// // // Userip string `json:"userip"`
|
||||||
|
// // // Vkey string `json:"vkey"`
|
||||||
|
// // // } `json:"data"`
|
||||||
|
// // // } `json:"req"`
|
||||||
|
// // Req0 struct {
|
||||||
|
// // Code int `json:"code"`
|
||||||
|
// // Data struct {
|
||||||
|
// // // Uin string `json:"uin"`
|
||||||
|
// // // Retcode int `json:"retcode"`
|
||||||
|
// // // VerifyType int `json:"verify_type"`
|
||||||
|
// // // LoginKey string `json:"login_key"`
|
||||||
|
// // // Msg string `json:"msg"`
|
||||||
|
// // // Sip []string `json:"sip"`
|
||||||
|
// // // Thirdip []string `json:"thirdip"`
|
||||||
|
// // // Testfile2G string `json:"testfile2g"`
|
||||||
|
// // // Testfilewifi string `json:"testfilewifi"`
|
||||||
|
// // Midurlinfo []struct {
|
||||||
|
// // // Songmid string `json:"songmid"`
|
||||||
|
// // // Filename string `json:"filename"`
|
||||||
|
// // Purl string `json:"purl"`
|
||||||
|
// // // Errtype string `json:"errtype"`
|
||||||
|
// // // P2Pfromtag int `json:"p2pfromtag"`
|
||||||
|
// // // Qmdlfromtag int `json:"qmdlfromtag"`
|
||||||
|
// // // CommonDownfromtag int `json:"common_downfromtag"`
|
||||||
|
// // // VipDownfromtag int `json:"vip_downfromtag"`
|
||||||
|
// // // Pdl int `json:"pdl"`
|
||||||
|
// // // Premain int `json:"premain"`
|
||||||
|
// // // Hisdown int `json:"hisdown"`
|
||||||
|
// // // Hisbuy int `json:"hisbuy"`
|
||||||
|
// // // UIAlert int `json:"uiAlert"`
|
||||||
|
// // // Isbuy int `json:"isbuy"`
|
||||||
|
// // // Pneedbuy int `json:"pneedbuy"`
|
||||||
|
// // // Pneed int `json:"pneed"`
|
||||||
|
// // // Isonly int `json:"isonly"`
|
||||||
|
// // // Onecan int `json:"onecan"`
|
||||||
|
// // // Result int `json:"result"`
|
||||||
|
// // // Tips string `json:"tips"`
|
||||||
|
// // // Opi48Kurl string `json:"opi48kurl"`
|
||||||
|
// // // Opi96Kurl string `json:"opi96kurl"`
|
||||||
|
// // // Opi192Kurl string `json:"opi192kurl"`
|
||||||
|
// // // Opiflackurl string `json:"opiflackurl"`
|
||||||
|
// // // Opi128Kurl string `json:"opi128kurl"`
|
||||||
|
// // // Opi192Koggurl string `json:"opi192koggurl"`
|
||||||
|
// // // Wififromtag string `json:"wififromtag"`
|
||||||
|
// // // Flowfromtag string `json:"flowfromtag"`
|
||||||
|
// // // Wifiurl string `json:"wifiurl"`
|
||||||
|
// // // Flowurl string `json:"flowurl"`
|
||||||
|
// // // Vkey string `json:"vkey"`
|
||||||
|
// // // Opi30Surl string `json:"opi30surl"`
|
||||||
|
// // // Ekey string `json:"ekey"`
|
||||||
|
// // // AuthSwitch int `json:"auth_switch"`
|
||||||
|
// // // Subcode int `json:"subcode"`
|
||||||
|
// // // Opi96Koggurl string `json:"opi96koggurl"`
|
||||||
|
// // // AuthSwitch2 int `json:"auth_switch2"`
|
||||||
|
// // } `json:"midurlinfo"`
|
||||||
|
// // // Servercheck string `json:"servercheck"`
|
||||||
|
// // // Expiration int `json:"expiration"`
|
||||||
|
// // } `json:"data"`
|
||||||
|
// // } `json:"req_0"`
|
||||||
|
// // }
|
||||||
|
// )
|
||||||
|
|
||||||
|
// // const (
|
||||||
|
// // // Source
|
||||||
|
// // s_wy = `wy`
|
||||||
|
// // s_mg = `mg`
|
||||||
|
// // s_kw = `kw`
|
||||||
|
// // s_kg = `kg`
|
||||||
|
// // s_tx = `tx`
|
||||||
|
// // // s_lx = `lx`
|
||||||
|
// // )
|
||||||
|
|
||||||
|
// var (
|
||||||
|
// // 音质列表 ( [通用音质][音乐平台]对应音质 )
|
||||||
|
// /*
|
||||||
|
// 注: kg源使用对应hash匹配音质,故为空
|
||||||
|
// */
|
||||||
|
// qualitys = map[string]map[string]string{
|
||||||
|
// sources.Q_128k: {
|
||||||
|
// sources.S_wy: `standard`,
|
||||||
|
// sources.S_mg: `1`,
|
||||||
|
// sources.S_kw: sources.Q_128k,
|
||||||
|
// sources.S_kg: ``,
|
||||||
|
// sources.S_tx: `M500`,
|
||||||
// },
|
// },
|
||||||
}
|
// sources.Q_320k: {
|
||||||
// ApiAddr
|
// sources.S_wy: `exhigh`,
|
||||||
// api_wy string
|
// sources.S_mg: `2`,
|
||||||
// api_mg string
|
// sources.S_kw: sources.Q_320k,
|
||||||
// api_kw string
|
// sources.S_kg: ``,
|
||||||
// api_kg string = `https://wwwapi.kugou.com/yy/index.php?r=play/getdata&platid=4&mid=1`
|
// sources.S_tx: `M800`,
|
||||||
// api_tx string = `https://u.y.qq.com/cgi-bin/musicu.fcg?data=`
|
// },
|
||||||
// vef_wy string
|
// sources.Q_flac: {
|
||||||
// Headers
|
// sources.S_wy: `lossless`,
|
||||||
// header_wy map[string]string
|
// sources.S_mg: `3`,
|
||||||
// header_mg map[string]string
|
// sources.S_kw: `2000k`,
|
||||||
// header_kw map[string]string
|
// sources.S_kg: ``,
|
||||||
// header_tx = map[string]string{`Referer`: `https://y.qq.com/`}
|
// sources.S_tx: `F000`,
|
||||||
)
|
// },
|
||||||
|
// sources.Q_fl24: {
|
||||||
|
// sources.S_wy: `hires`,
|
||||||
|
// sources.S_mg: `4`,
|
||||||
|
// sources.S_kg: ``,
|
||||||
|
// // sources.S_tx: `RS01`,
|
||||||
|
// },
|
||||||
|
// // `fl24`: {
|
||||||
|
// // s_wy: `hires`,
|
||||||
|
// // s_mg: `4`,
|
||||||
|
// // },
|
||||||
|
// }
|
||||||
|
// // ApiAddr
|
||||||
|
// // api_wy string
|
||||||
|
// // api_mg string
|
||||||
|
// // api_kw string
|
||||||
|
// // api_kg string = `https://wwwapi.kugou.com/yy/index.php?r=play/getdata&platid=4&mid=1`
|
||||||
|
// // api_tx string = `https://u.y.qq.com/cgi-bin/musicu.fcg?data=`
|
||||||
|
// // vef_wy string
|
||||||
|
// // Headers
|
||||||
|
// // header_wy map[string]string
|
||||||
|
// // header_mg map[string]string
|
||||||
|
// // header_kw map[string]string
|
||||||
|
// // header_tx = map[string]string{`Referer`: `https://y.qq.com/`}
|
||||||
|
// )
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package kg
|
package kg
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/gob"
|
||||||
"lx-source/src/env"
|
"lx-source/src/env"
|
||||||
|
"lx-source/src/sources"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -10,6 +12,10 @@ import (
|
|||||||
"github.com/ZxwyWebSite/ztool"
|
"github.com/ZxwyWebSite/ztool"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
gob.Register(musicInfo{})
|
||||||
|
}
|
||||||
|
|
||||||
func getMusicInfo(hash_ string) (info musicInfo, emsg string) {
|
func getMusicInfo(hash_ string) (info musicInfo, emsg string) {
|
||||||
cquery := strings.Join([]string{`kg`, hash_, `info`}, `/`)
|
cquery := strings.Join([]string{`kg`, hash_, `info`}, `/`)
|
||||||
if cdata, ok := env.Cache.Get(cquery); ok {
|
if cdata, ok := env.Cache.Get(cquery); ok {
|
||||||
@ -59,6 +65,6 @@ func getMusicInfo(hash_ string) (info musicInfo, emsg string) {
|
|||||||
}
|
}
|
||||||
info = infoResp.Data[0][0]
|
info = infoResp.Data[0][0]
|
||||||
emsg = infoResp.Errmsg
|
emsg = infoResp.Errmsg
|
||||||
env.Cache.Set(cquery, info, 7200)
|
env.Cache.Set(cquery, info, sources.C_lx)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -89,10 +89,22 @@ func do_account_signin(loger *logs.Logger, now int64) (err error) {
|
|||||||
// 检查用户配置文件,获取mixsongmid
|
// 检查用户配置文件,获取mixsongmid
|
||||||
mixid := env.Config.Custom.Kg_Lite_MixId //`582534238`
|
mixid := env.Config.Custom.Kg_Lite_MixId //`582534238`
|
||||||
if mixid == `auto` || mixid == `` {
|
if mixid == `auto` || mixid == `` {
|
||||||
|
for i := 0; true; i++ {
|
||||||
mixid, err = randomMixSongMid()
|
mixid, err = randomMixSongMid()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
loger.Error(`ReTry: %v, Err: %s`, i, err)
|
||||||
|
if i >= 2 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// mixid, err = randomMixSongMid()
|
||||||
|
// if err != nil {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
loger.Info(`成功获取MixSongMid: ` + mixid)
|
loger.Info(`成功获取MixSongMid: ` + mixid)
|
||||||
} else {
|
} else {
|
||||||
loger.Info(`使用固定MixSongMid: ` + mixid)
|
loger.Info(`使用固定MixSongMid: ` + mixid)
|
||||||
|
@ -3,453 +3,453 @@ package kg
|
|||||||
type (
|
type (
|
||||||
musicInfo struct {
|
musicInfo struct {
|
||||||
AlbumAudioID string `json:"album_audio_id"`
|
AlbumAudioID string `json:"album_audio_id"`
|
||||||
AudioID string `json:"audio_id"`
|
// AudioID string `json:"audio_id"`
|
||||||
AuthorName string `json:"author_name"`
|
// AuthorName string `json:"author_name"`
|
||||||
OriAudioName string `json:"ori_audio_name"`
|
// OriAudioName string `json:"ori_audio_name"`
|
||||||
OfficialSongname string `json:"official_songname"`
|
// OfficialSongname string `json:"official_songname"`
|
||||||
Songname string `json:"songname"`
|
// Songname string `json:"songname"`
|
||||||
Remark string `json:"remark"`
|
// Remark string `json:"remark"`
|
||||||
SuffixAudioName string `json:"suffix_audio_name"`
|
// SuffixAudioName string `json:"suffix_audio_name"`
|
||||||
IsSearch string `json:"is_search"`
|
// IsSearch string `json:"is_search"`
|
||||||
IsOriginal string `json:"is_original"`
|
// IsOriginal string `json:"is_original"`
|
||||||
IsPublish string `json:"is_publish"`
|
// IsPublish string `json:"is_publish"`
|
||||||
MixsongType string `json:"mixsong_type"`
|
// MixsongType string `json:"mixsong_type"`
|
||||||
Version string `json:"version"`
|
// Version string `json:"version"`
|
||||||
Language string `json:"language"`
|
// Language string `json:"language"`
|
||||||
Bpm string `json:"bpm"`
|
// Bpm string `json:"bpm"`
|
||||||
BpmType string `json:"bpm_type"`
|
// BpmType string `json:"bpm_type"`
|
||||||
BpmDesc string `json:"bpm_desc"`
|
// BpmDesc string `json:"bpm_desc"`
|
||||||
PublishDate string `json:"publish_date"`
|
// PublishDate string `json:"publish_date"`
|
||||||
Extname string `json:"extname"`
|
// Extname string `json:"extname"`
|
||||||
AlbumInfo struct {
|
AlbumInfo struct {
|
||||||
AlbumID string `json:"album_id"`
|
AlbumID string `json:"album_id"`
|
||||||
AlbumName string `json:"album_name"`
|
// AlbumName string `json:"album_name"`
|
||||||
PublishDate string `json:"publish_date"`
|
// PublishDate string `json:"publish_date"`
|
||||||
Category string `json:"category"`
|
// Category string `json:"category"`
|
||||||
IsPublish string `json:"is_publish"`
|
// IsPublish string `json:"is_publish"`
|
||||||
SizableCover string `json:"sizable_cover"`
|
// SizableCover string `json:"sizable_cover"`
|
||||||
} `json:"album_info"`
|
} `json:"album_info"`
|
||||||
Classification []struct {
|
// Classification []struct {
|
||||||
Usage string `json:"usage"`
|
// Usage string `json:"usage"`
|
||||||
Status string `json:"status"`
|
// Status string `json:"status"`
|
||||||
Level string `json:"level"`
|
// Level string `json:"level"`
|
||||||
ResType string `json:"res_type"`
|
// ResType string `json:"res_type"`
|
||||||
Type string `json:"type"`
|
// Type string `json:"type"`
|
||||||
ID string `json:"id"`
|
// ID string `json:"id"`
|
||||||
ResID string `json:"res_id"`
|
// ResID string `json:"res_id"`
|
||||||
} `json:"classification"`
|
// } `json:"classification"`
|
||||||
AudioInfo struct {
|
AudioInfo struct {
|
||||||
IsFileHead string `json:"is_file_head"`
|
// IsFileHead string `json:"is_file_head"`
|
||||||
IsFileHead320 string `json:"is_file_head_320"`
|
// IsFileHead320 string `json:"is_file_head_320"`
|
||||||
AudioID string `json:"audio_id"`
|
// AudioID string `json:"audio_id"`
|
||||||
Hash string `json:"hash"`
|
// Hash string `json:"hash"`
|
||||||
Filesize string `json:"filesize"`
|
// Filesize string `json:"filesize"`
|
||||||
Timelength string `json:"timelength"`
|
// Timelength string `json:"timelength"`
|
||||||
Bitrate string `json:"bitrate"`
|
// Bitrate string `json:"bitrate"`
|
||||||
Hash128 string `json:"hash_128"`
|
Hash128 string `json:"hash_128"`
|
||||||
Filesize128 string `json:"filesize_128"`
|
// Filesize128 string `json:"filesize_128"`
|
||||||
Timelength128 string `json:"timelength_128"`
|
// Timelength128 string `json:"timelength_128"`
|
||||||
Hash320 string `json:"hash_320"`
|
Hash320 string `json:"hash_320"`
|
||||||
Filesize320 string `json:"filesize_320"`
|
// Filesize320 string `json:"filesize_320"`
|
||||||
Timelength320 string `json:"timelength_320"`
|
// Timelength320 string `json:"timelength_320"`
|
||||||
HashFlac string `json:"hash_flac"`
|
HashFlac string `json:"hash_flac"`
|
||||||
FilesizeFlac string `json:"filesize_flac"`
|
// FilesizeFlac string `json:"filesize_flac"`
|
||||||
TimelengthFlac string `json:"timelength_flac"`
|
// TimelengthFlac string `json:"timelength_flac"`
|
||||||
BitrateFlac string `json:"bitrate_flac"`
|
// BitrateFlac string `json:"bitrate_flac"`
|
||||||
HashHigh string `json:"hash_high"`
|
HashHigh string `json:"hash_high"`
|
||||||
FilesizeHigh string `json:"filesize_high"`
|
// FilesizeHigh string `json:"filesize_high"`
|
||||||
TimelengthHigh string `json:"timelength_high"`
|
// TimelengthHigh string `json:"timelength_high"`
|
||||||
BitrateHigh string `json:"bitrate_high"`
|
// BitrateHigh string `json:"bitrate_high"`
|
||||||
HashSuper string `json:"hash_super"`
|
HashSuper string `json:"hash_super"`
|
||||||
FilesizeSuper string `json:"filesize_super"`
|
// FilesizeSuper string `json:"filesize_super"`
|
||||||
TimelengthSuper string `json:"timelength_super"`
|
// TimelengthSuper string `json:"timelength_super"`
|
||||||
BitrateSuper string `json:"bitrate_super"`
|
// BitrateSuper string `json:"bitrate_super"`
|
||||||
HashVinylrecord string `json:"hash_vinylrecord"`
|
// HashVinylrecord string `json:"hash_vinylrecord"`
|
||||||
FilesizeVinylrecord string `json:"filesize_vinylrecord"`
|
// FilesizeVinylrecord string `json:"filesize_vinylrecord"`
|
||||||
TimelengthVinylrecord string `json:"timelength_vinylrecord"`
|
// TimelengthVinylrecord string `json:"timelength_vinylrecord"`
|
||||||
BitrateVinylrecord string `json:"bitrate_vinylrecord"`
|
// BitrateVinylrecord string `json:"bitrate_vinylrecord"`
|
||||||
HashMultichannel string `json:"hash_multichannel"`
|
// HashMultichannel string `json:"hash_multichannel"`
|
||||||
FilesizeMultichannel string `json:"filesize_multichannel"`
|
// FilesizeMultichannel string `json:"filesize_multichannel"`
|
||||||
TimelengthMultichannel string `json:"timelength_multichannel"`
|
// TimelengthMultichannel string `json:"timelength_multichannel"`
|
||||||
BitrateMultichannel string `json:"bitrate_multichannel"`
|
// BitrateMultichannel string `json:"bitrate_multichannel"`
|
||||||
HashDolby448 string `json:"hash_dolby_448"`
|
// HashDolby448 string `json:"hash_dolby_448"`
|
||||||
FilesizeDolby448 string `json:"filesize_dolby_448"`
|
// FilesizeDolby448 string `json:"filesize_dolby_448"`
|
||||||
TimelengthDolby448 string `json:"timelength_dolby_448"`
|
// TimelengthDolby448 string `json:"timelength_dolby_448"`
|
||||||
BitrateDolby448 string `json:"bitrate_dolby_448"`
|
// BitrateDolby448 string `json:"bitrate_dolby_448"`
|
||||||
HashDolby640 string `json:"hash_dolby_640"`
|
// HashDolby640 string `json:"hash_dolby_640"`
|
||||||
FilesizeDolby640 string `json:"filesize_dolby_640"`
|
// FilesizeDolby640 string `json:"filesize_dolby_640"`
|
||||||
TimelengthDolby640 string `json:"timelength_dolby_640"`
|
// TimelengthDolby640 string `json:"timelength_dolby_640"`
|
||||||
BitrateDolby640 string `json:"bitrate_dolby_640"`
|
// BitrateDolby640 string `json:"bitrate_dolby_640"`
|
||||||
HashDolby768 string `json:"hash_dolby_768"`
|
// HashDolby768 string `json:"hash_dolby_768"`
|
||||||
FilesizeDolby768 string `json:"filesize_dolby_768"`
|
// FilesizeDolby768 string `json:"filesize_dolby_768"`
|
||||||
TimelengthDolby768 string `json:"timelength_dolby_768"`
|
// TimelengthDolby768 string `json:"timelength_dolby_768"`
|
||||||
BitrateDolby768 string `json:"bitrate_dolby_768"`
|
// BitrateDolby768 string `json:"bitrate_dolby_768"`
|
||||||
AudioGroupID string `json:"audio_group_id"`
|
// AudioGroupID string `json:"audio_group_id"`
|
||||||
ExtnameSuper string `json:"extname_super"`
|
// ExtnameSuper string `json:"extname_super"`
|
||||||
Extname string `json:"extname"`
|
// Extname string `json:"extname"`
|
||||||
FailProcess int `json:"fail_process"`
|
// FailProcess int `json:"fail_process"`
|
||||||
PayType int `json:"pay_type"`
|
// PayType int `json:"pay_type"`
|
||||||
Type string `json:"type"`
|
// Type string `json:"type"`
|
||||||
OldCpy int `json:"old_cpy"`
|
// OldCpy int `json:"old_cpy"`
|
||||||
Privilege string `json:"privilege"`
|
// Privilege string `json:"privilege"`
|
||||||
Privilege128 string `json:"privilege_128"`
|
// Privilege128 string `json:"privilege_128"`
|
||||||
Privilege320 string `json:"privilege_320"`
|
// Privilege320 string `json:"privilege_320"`
|
||||||
PrivilegeFlac string `json:"privilege_flac"`
|
// PrivilegeFlac string `json:"privilege_flac"`
|
||||||
PrivilegeHigh string `json:"privilege_high"`
|
// PrivilegeHigh string `json:"privilege_high"`
|
||||||
PrivilegeSuper string `json:"privilege_super"`
|
// PrivilegeSuper string `json:"privilege_super"`
|
||||||
PrivilegeVinylrecord string `json:"privilege_vinylrecord"`
|
// PrivilegeVinylrecord string `json:"privilege_vinylrecord"`
|
||||||
PrivilegeMultichannel string `json:"privilege_multichannel"`
|
// PrivilegeMultichannel string `json:"privilege_multichannel"`
|
||||||
PrivilegeDolby448 string `json:"privilege_dolby_448"`
|
// PrivilegeDolby448 string `json:"privilege_dolby_448"`
|
||||||
PrivilegeDolby640 string `json:"privilege_dolby_640"`
|
// PrivilegeDolby640 string `json:"privilege_dolby_640"`
|
||||||
PrivilegeDolby768 string `json:"privilege_dolby_768"`
|
// PrivilegeDolby768 string `json:"privilege_dolby_768"`
|
||||||
TransParam struct {
|
// TransParam struct {
|
||||||
HashOffset struct {
|
// HashOffset struct {
|
||||||
StartByte int `json:"start_byte"`
|
// StartByte int `json:"start_byte"`
|
||||||
EndByte int `json:"end_byte"`
|
// EndByte int `json:"end_byte"`
|
||||||
StartMs int `json:"start_ms"`
|
// StartMs int `json:"start_ms"`
|
||||||
EndMs int `json:"end_ms"`
|
// EndMs int `json:"end_ms"`
|
||||||
OffsetHash string `json:"offset_hash"`
|
// OffsetHash string `json:"offset_hash"`
|
||||||
FileType int `json:"file_type"`
|
// FileType int `json:"file_type"`
|
||||||
ClipHash string `json:"clip_hash"`
|
// ClipHash string `json:"clip_hash"`
|
||||||
} `json:"hash_offset"`
|
// } `json:"hash_offset"`
|
||||||
MusicpackAdvance int `json:"musicpack_advance"`
|
// MusicpackAdvance int `json:"musicpack_advance"`
|
||||||
PayBlockTpl int `json:"pay_block_tpl"`
|
// PayBlockTpl int `json:"pay_block_tpl"`
|
||||||
Display int `json:"display"`
|
// Display int `json:"display"`
|
||||||
DisplayRate int `json:"display_rate"`
|
// DisplayRate int `json:"display_rate"`
|
||||||
CpyGrade int `json:"cpy_grade"`
|
// CpyGrade int `json:"cpy_grade"`
|
||||||
CpyLevel int `json:"cpy_level"`
|
// CpyLevel int `json:"cpy_level"`
|
||||||
Cid int `json:"cid"`
|
// Cid int `json:"cid"`
|
||||||
CpyAttr0 int `json:"cpy_attr0"`
|
// CpyAttr0 int `json:"cpy_attr0"`
|
||||||
Classmap struct {
|
// Classmap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"classmap"`
|
// } `json:"classmap"`
|
||||||
InitPubDay int `json:"init_pub_day"`
|
// InitPubDay int `json:"init_pub_day"`
|
||||||
Qualitymap struct {
|
// Qualitymap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"qualitymap"`
|
// } `json:"qualitymap"`
|
||||||
Language string `json:"language"`
|
// Language string `json:"language"`
|
||||||
} `json:"trans_param"`
|
// } `json:"trans_param"`
|
||||||
} `json:"audio_info"`
|
} `json:"audio_info"`
|
||||||
}
|
}
|
||||||
playInfo struct {
|
playInfo struct {
|
||||||
Hash string `json:"hash"`
|
// Hash string `json:"hash"`
|
||||||
Classmap struct {
|
// Classmap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"classmap"`
|
// } `json:"classmap"`
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
Volume float64 `json:"volume"`
|
// Volume float64 `json:"volume"`
|
||||||
StdHashTime int `json:"std_hash_time"`
|
// StdHashTime int `json:"std_hash_time"`
|
||||||
URL []string `json:"url"`
|
URL []string `json:"url"`
|
||||||
StdHash string `json:"std_hash"`
|
// StdHash string `json:"std_hash"`
|
||||||
TransParam struct {
|
// TransParam struct {
|
||||||
Display int `json:"display"`
|
// Display int `json:"display"`
|
||||||
DisplayRate int `json:"display_rate"`
|
// DisplayRate int `json:"display_rate"`
|
||||||
} `json:"trans_param"`
|
// } `json:"trans_param"`
|
||||||
FileHead int `json:"fileHead"`
|
// FileHead int `json:"fileHead"`
|
||||||
VolumePeak float64 `json:"volume_peak"`
|
// VolumePeak float64 `json:"volume_peak"`
|
||||||
BitRate int `json:"bitRate"`
|
// BitRate int `json:"bitRate"`
|
||||||
TimeLength int `json:"timeLength"`
|
// TimeLength int `json:"timeLength"`
|
||||||
VolumeGain int `json:"volume_gain"`
|
// VolumeGain int `json:"volume_gain"`
|
||||||
Q int `json:"q"`
|
// Q int `json:"q"`
|
||||||
FileName string `json:"fileName"`
|
// FileName string `json:"fileName"`
|
||||||
ExtName string `json:"extName"`
|
// ExtName string `json:"extName"`
|
||||||
FileSize int `json:"fileSize"`
|
// FileSize int `json:"fileSize"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
type rankInfo struct {
|
type rankInfo struct {
|
||||||
Data struct {
|
Data struct {
|
||||||
Timestamp int `json:"timestamp"`
|
// Timestamp int `json:"timestamp"`
|
||||||
Total int `json:"total"`
|
// Total int `json:"total"`
|
||||||
Info []struct {
|
Info []struct {
|
||||||
LastSort int `json:"last_sort"`
|
// LastSort int `json:"last_sort"`
|
||||||
Authors []struct {
|
// Authors []struct {
|
||||||
SizableAvatar string `json:"sizable_avatar"`
|
// SizableAvatar string `json:"sizable_avatar"`
|
||||||
IsPublish int `json:"is_publish"`
|
// IsPublish int `json:"is_publish"`
|
||||||
AuthorName string `json:"author_name"`
|
// AuthorName string `json:"author_name"`
|
||||||
AuthorID int `json:"author_id"`
|
// AuthorID int `json:"author_id"`
|
||||||
} `json:"authors"`
|
// } `json:"authors"`
|
||||||
RankCount int `json:"rank_count"`
|
// RankCount int `json:"rank_count"`
|
||||||
RankIDPublishDate string `json:"rank_id_publish_date"`
|
// RankIDPublishDate string `json:"rank_id_publish_date"`
|
||||||
Songname string `json:"songname"`
|
// Songname string `json:"songname"`
|
||||||
TopicURL320 string `json:"topic_url_320"`
|
// TopicURL320 string `json:"topic_url_320"`
|
||||||
Sqhash string `json:"sqhash"`
|
// Sqhash string `json:"sqhash"`
|
||||||
FailProcess int `json:"fail_process"`
|
// FailProcess int `json:"fail_process"`
|
||||||
PayType int `json:"pay_type"`
|
// PayType int `json:"pay_type"`
|
||||||
RecommendReason string `json:"recommend_reason"`
|
// RecommendReason string `json:"recommend_reason"`
|
||||||
RpType string `json:"rp_type"`
|
// RpType string `json:"rp_type"`
|
||||||
AlbumID string `json:"album_id"`
|
// AlbumID string `json:"album_id"`
|
||||||
PrivilegeHigh int `json:"privilege_high"`
|
// PrivilegeHigh int `json:"privilege_high"`
|
||||||
TopicURLSq string `json:"topic_url_sq"`
|
// TopicURLSq string `json:"topic_url_sq"`
|
||||||
RankCid int `json:"rank_cid"`
|
// RankCid int `json:"rank_cid"`
|
||||||
Inlist int `json:"inlist"`
|
// Inlist int `json:"inlist"`
|
||||||
Three20Filesize int `json:"320filesize"`
|
// Three20Filesize int `json:"320filesize"`
|
||||||
PkgPrice320 int `json:"pkg_price_320"`
|
// PkgPrice320 int `json:"pkg_price_320"`
|
||||||
Feetype int `json:"feetype"`
|
// Feetype int `json:"feetype"`
|
||||||
Price320 int `json:"price_320"`
|
// Price320 int `json:"price_320"`
|
||||||
DurationHigh int `json:"duration_high"`
|
// DurationHigh int `json:"duration_high"`
|
||||||
FailProcess320 int `json:"fail_process_320"`
|
// FailProcess320 int `json:"fail_process_320"`
|
||||||
Zone string `json:"zone"`
|
// Zone string `json:"zone"`
|
||||||
TopicURL string `json:"topic_url"`
|
// TopicURL string `json:"topic_url"`
|
||||||
RpPublish int `json:"rp_publish"`
|
// RpPublish int `json:"rp_publish"`
|
||||||
TransObj struct {
|
// TransObj struct {
|
||||||
RankShowSort int `json:"rank_show_sort"`
|
// RankShowSort int `json:"rank_show_sort"`
|
||||||
} `json:"trans_obj"`
|
// } `json:"trans_obj"`
|
||||||
Hash string `json:"hash"`
|
// Hash string `json:"hash"`
|
||||||
Sqfilesize int `json:"sqfilesize"`
|
// Sqfilesize int `json:"sqfilesize"`
|
||||||
Sqprivilege int `json:"sqprivilege"`
|
// Sqprivilege int `json:"sqprivilege"`
|
||||||
PayTypeSq int `json:"pay_type_sq"`
|
// PayTypeSq int `json:"pay_type_sq"`
|
||||||
Bitrate int `json:"bitrate"`
|
// Bitrate int `json:"bitrate"`
|
||||||
PkgPriceSq int `json:"pkg_price_sq"`
|
// PkgPriceSq int `json:"pkg_price_sq"`
|
||||||
HasAccompany int `json:"has_accompany"`
|
// HasAccompany int `json:"has_accompany"`
|
||||||
Musical interface{} `json:"musical"`
|
// Musical interface{} `json:"musical"`
|
||||||
PayType320 int `json:"pay_type_320"`
|
// PayType320 int `json:"pay_type_320"`
|
||||||
Issue int `json:"issue"`
|
// Issue int `json:"issue"`
|
||||||
ExtnameSuper string `json:"extname_super"`
|
// ExtnameSuper string `json:"extname_super"`
|
||||||
DurationSuper int `json:"duration_super"`
|
// DurationSuper int `json:"duration_super"`
|
||||||
BitrateSuper int `json:"bitrate_super"`
|
// BitrateSuper int `json:"bitrate_super"`
|
||||||
HashHigh string `json:"hash_high"`
|
// HashHigh string `json:"hash_high"`
|
||||||
Duration int `json:"duration"`
|
// Duration int `json:"duration"`
|
||||||
Three20Hash string `json:"320hash"`
|
// Three20Hash string `json:"320hash"`
|
||||||
PriceSq int `json:"price_sq"`
|
// PriceSq int `json:"price_sq"`
|
||||||
OldCpy int `json:"old_cpy"`
|
// OldCpy int `json:"old_cpy"`
|
||||||
AlbumAudioID int `json:"album_audio_id"`
|
// AlbumAudioID int `json:"album_audio_id"`
|
||||||
M4Afilesize int `json:"m4afilesize"`
|
// M4Afilesize int `json:"m4afilesize"`
|
||||||
PkgPrice int `json:"pkg_price"`
|
// PkgPrice int `json:"pkg_price"`
|
||||||
First int `json:"first"`
|
// First int `json:"first"`
|
||||||
AudioID int `json:"audio_id"`
|
// AudioID int `json:"audio_id"`
|
||||||
HashSuper string `json:"hash_super"`
|
// HashSuper string `json:"hash_super"`
|
||||||
Addtime string `json:"addtime"`
|
// Addtime string `json:"addtime"`
|
||||||
FilesizeHigh int `json:"filesize_high"`
|
// FilesizeHigh int `json:"filesize_high"`
|
||||||
Price int `json:"price"`
|
// Price int `json:"price"`
|
||||||
Privilege int `json:"privilege"`
|
// Privilege int `json:"privilege"`
|
||||||
AlbumSizableCover string `json:"album_sizable_cover"`
|
// AlbumSizableCover string `json:"album_sizable_cover"`
|
||||||
Mvdata []struct {
|
// Mvdata []struct {
|
||||||
Typ int `json:"typ"`
|
// Typ int `json:"typ"`
|
||||||
Trk string `json:"trk"`
|
// Trk string `json:"trk"`
|
||||||
Hash string `json:"hash"`
|
// Hash string `json:"hash"`
|
||||||
ID string `json:"id"`
|
// ID string `json:"id"`
|
||||||
} `json:"mvdata,omitempty"`
|
// } `json:"mvdata,omitempty"`
|
||||||
Sort int `json:"sort"`
|
// Sort int `json:"sort"`
|
||||||
TransParam struct {
|
// TransParam struct {
|
||||||
CpyLevel int `json:"cpy_level"`
|
// CpyLevel int `json:"cpy_level"`
|
||||||
Classmap struct {
|
// Classmap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"classmap"`
|
// } `json:"classmap"`
|
||||||
CpyGrade int `json:"cpy_grade"`
|
// CpyGrade int `json:"cpy_grade"`
|
||||||
Qualitymap struct {
|
// Qualitymap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"qualitymap"`
|
// } `json:"qualitymap"`
|
||||||
PayBlockTpl int `json:"pay_block_tpl"`
|
// PayBlockTpl int `json:"pay_block_tpl"`
|
||||||
Cid int `json:"cid"`
|
// Cid int `json:"cid"`
|
||||||
Language string `json:"language"`
|
// Language string `json:"language"`
|
||||||
HashMultitrack string `json:"hash_multitrack"`
|
// HashMultitrack string `json:"hash_multitrack"`
|
||||||
CpyAttr0 int `json:"cpy_attr0"`
|
// CpyAttr0 int `json:"cpy_attr0"`
|
||||||
Ipmap struct {
|
// Ipmap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"ipmap"`
|
// } `json:"ipmap"`
|
||||||
AppidBlock string `json:"appid_block"`
|
// AppidBlock string `json:"appid_block"`
|
||||||
MusicpackAdvance int `json:"musicpack_advance"`
|
// MusicpackAdvance int `json:"musicpack_advance"`
|
||||||
Display int `json:"display"`
|
// Display int `json:"display"`
|
||||||
DisplayRate int `json:"display_rate"`
|
// DisplayRate int `json:"display_rate"`
|
||||||
} `json:"trans_param"`
|
// } `json:"trans_param"`
|
||||||
FilesizeSuper int `json:"filesize_super"`
|
// FilesizeSuper int `json:"filesize_super"`
|
||||||
Filename string `json:"filename"`
|
Filename string `json:"filename"`
|
||||||
BitrateHigh int `json:"bitrate_high"`
|
// BitrateHigh int `json:"bitrate_high"`
|
||||||
Remark string `json:"remark"`
|
// Remark string `json:"remark"`
|
||||||
Extname string `json:"extname"`
|
// Extname string `json:"extname"`
|
||||||
Filesize int `json:"filesize"`
|
// Filesize int `json:"filesize"`
|
||||||
Isfirst int `json:"isfirst"`
|
// Isfirst int `json:"isfirst"`
|
||||||
Mvhash string `json:"mvhash"`
|
// Mvhash string `json:"mvhash"`
|
||||||
Three20Privilege int `json:"320privilege"`
|
// Three20Privilege int `json:"320privilege"`
|
||||||
PrivilegeSuper int `json:"privilege_super"`
|
// PrivilegeSuper int `json:"privilege_super"`
|
||||||
FailProcessSq int `json:"fail_process_sq"`
|
// FailProcessSq int `json:"fail_process_sq"`
|
||||||
} `json:"info"`
|
} `json:"info"`
|
||||||
} `json:"data"`
|
} `json:"data"`
|
||||||
Errcode int `json:"errcode"`
|
// Errcode int `json:"errcode"`
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type searchInfo struct {
|
type searchInfo struct {
|
||||||
Data struct {
|
Data struct {
|
||||||
AlgPath string `json:"AlgPath"`
|
// AlgPath string `json:"AlgPath"`
|
||||||
Aggregation struct {
|
// Aggregation struct {
|
||||||
} `json:"aggregation"`
|
// } `json:"aggregation"`
|
||||||
Allowerr int `json:"allowerr"`
|
// Allowerr int `json:"allowerr"`
|
||||||
Chinesecount int `json:"chinesecount"`
|
// Chinesecount int `json:"chinesecount"`
|
||||||
Correctionforce int `json:"correctionforce"`
|
// Correctionforce int `json:"correctionforce"`
|
||||||
Correctionrelate string `json:"correctionrelate"`
|
// Correctionrelate string `json:"correctionrelate"`
|
||||||
Correctionsubject string `json:"correctionsubject"`
|
// Correctionsubject string `json:"correctionsubject"`
|
||||||
Correctiontip string `json:"correctiontip"`
|
// Correctiontip string `json:"correctiontip"`
|
||||||
Correctiontype int `json:"correctiontype"`
|
// Correctiontype int `json:"correctiontype"`
|
||||||
From int `json:"from"`
|
// From int `json:"from"`
|
||||||
Isshareresult int `json:"isshareresult"`
|
// Isshareresult int `json:"isshareresult"`
|
||||||
Istag int `json:"istag"`
|
// Istag int `json:"istag"`
|
||||||
Istagresult int `json:"istagresult"`
|
// Istagresult int `json:"istagresult"`
|
||||||
Lists []struct {
|
Lists []struct {
|
||||||
A320Privilege int `json:"A320Privilege"`
|
// A320Privilege int `json:"A320Privilege"`
|
||||||
ASQPrivilege int `json:"ASQPrivilege"`
|
// ASQPrivilege int `json:"ASQPrivilege"`
|
||||||
Accompany int `json:"Accompany"`
|
// Accompany int `json:"Accompany"`
|
||||||
AlbumAux string `json:"AlbumAux"`
|
// AlbumAux string `json:"AlbumAux"`
|
||||||
AlbumID string `json:"AlbumID"`
|
// AlbumID string `json:"AlbumID"`
|
||||||
AlbumName string `json:"AlbumName"`
|
// AlbumName string `json:"AlbumName"`
|
||||||
AlbumPrivilege int `json:"AlbumPrivilege"`
|
// AlbumPrivilege int `json:"AlbumPrivilege"`
|
||||||
AudioCdn int `json:"AudioCdn"`
|
// AudioCdn int `json:"AudioCdn"`
|
||||||
Audioid int `json:"Audioid"`
|
// Audioid int `json:"Audioid"`
|
||||||
Auxiliary string `json:"Auxiliary"`
|
// Auxiliary string `json:"Auxiliary"`
|
||||||
Bitrate int `json:"Bitrate"`
|
// Bitrate int `json:"Bitrate"`
|
||||||
Category int `json:"Category"`
|
// Category int `json:"Category"`
|
||||||
Duration int `json:"Duration"`
|
// Duration int `json:"Duration"`
|
||||||
ExtName string `json:"ExtName"`
|
// ExtName string `json:"ExtName"`
|
||||||
FailProcess int `json:"FailProcess"`
|
// FailProcess int `json:"FailProcess"`
|
||||||
FileHash string `json:"FileHash"`
|
// FileHash string `json:"FileHash"`
|
||||||
FileName string `json:"FileName"`
|
// FileName string `json:"FileName"`
|
||||||
FileSize int `json:"FileSize"`
|
// FileSize int `json:"FileSize"`
|
||||||
FoldType int `json:"FoldType"`
|
// FoldType int `json:"FoldType"`
|
||||||
Grp []interface{} `json:"Grp"`
|
// Grp []interface{} `json:"Grp"`
|
||||||
HQBitrate int `json:"HQBitrate"`
|
// HQBitrate int `json:"HQBitrate"`
|
||||||
HQDuration int `json:"HQDuration"`
|
// HQDuration int `json:"HQDuration"`
|
||||||
HQExtName string `json:"HQExtName"`
|
// HQExtName string `json:"HQExtName"`
|
||||||
HQFailProcess int `json:"HQFailProcess"`
|
// HQFailProcess int `json:"HQFailProcess"`
|
||||||
HQFileHash string `json:"HQFileHash"`
|
// HQFileHash string `json:"HQFileHash"`
|
||||||
HQFileSize int `json:"HQFileSize"`
|
// HQFileSize int `json:"HQFileSize"`
|
||||||
HQPayType int `json:"HQPayType"`
|
// HQPayType int `json:"HQPayType"`
|
||||||
HQPkgPrice int `json:"HQPkgPrice"`
|
// HQPkgPrice int `json:"HQPkgPrice"`
|
||||||
HQPrice int `json:"HQPrice"`
|
// HQPrice int `json:"HQPrice"`
|
||||||
HQPrivilege int `json:"HQPrivilege"`
|
// HQPrivilege int `json:"HQPrivilege"`
|
||||||
HasAlbum int `json:"HasAlbum"`
|
// HasAlbum int `json:"HasAlbum"`
|
||||||
HeatLevel int `json:"HeatLevel"`
|
// HeatLevel int `json:"HeatLevel"`
|
||||||
HiFiQuality int `json:"HiFiQuality"`
|
// HiFiQuality int `json:"HiFiQuality"`
|
||||||
ID string `json:"ID"`
|
// ID string `json:"ID"`
|
||||||
Image string `json:"Image"`
|
// Image string `json:"Image"`
|
||||||
IsOriginal int `json:"IsOriginal"`
|
// IsOriginal int `json:"IsOriginal"`
|
||||||
M4ASize int `json:"M4aSize"`
|
// M4ASize int `json:"M4aSize"`
|
||||||
MatchFlag int `json:"MatchFlag"`
|
// MatchFlag int `json:"MatchFlag"`
|
||||||
MixSongID string `json:"MixSongID"`
|
MixSongID string `json:"MixSongID"`
|
||||||
MvHash string `json:"MvHash"`
|
// MvHash string `json:"MvHash"`
|
||||||
MvTrac int `json:"MvTrac"`
|
// MvTrac int `json:"MvTrac"`
|
||||||
MvType int `json:"MvType"`
|
// MvType int `json:"MvType"`
|
||||||
OldCpy int `json:"OldCpy"`
|
// OldCpy int `json:"OldCpy"`
|
||||||
OriOtherName string `json:"OriOtherName"`
|
// OriOtherName string `json:"OriOtherName"`
|
||||||
OriSongName string `json:"OriSongName"`
|
// OriSongName string `json:"OriSongName"`
|
||||||
OtherName string `json:"OtherName"`
|
// OtherName string `json:"OtherName"`
|
||||||
OwnerCount int `json:"OwnerCount"`
|
// OwnerCount int `json:"OwnerCount"`
|
||||||
PayType int `json:"PayType"`
|
// PayType int `json:"PayType"`
|
||||||
PkgPrice int `json:"PkgPrice"`
|
// PkgPrice int `json:"PkgPrice"`
|
||||||
Price int `json:"Price"`
|
// Price int `json:"Price"`
|
||||||
Privilege int `json:"Privilege"`
|
// Privilege int `json:"Privilege"`
|
||||||
Publish int `json:"Publish"`
|
// Publish int `json:"Publish"`
|
||||||
PublishAge int `json:"PublishAge"`
|
// PublishAge int `json:"PublishAge"`
|
||||||
PublishTime string `json:"PublishTime"`
|
// PublishTime string `json:"PublishTime"`
|
||||||
QualityLevel int `json:"QualityLevel"`
|
// QualityLevel int `json:"QualityLevel"`
|
||||||
RankID int `json:"RankId"`
|
// RankID int `json:"RankId"`
|
||||||
Res struct {
|
// Res struct {
|
||||||
FailProcess int `json:"FailProcess"`
|
// FailProcess int `json:"FailProcess"`
|
||||||
PayType int `json:"PayType"`
|
// PayType int `json:"PayType"`
|
||||||
PkgPrice int `json:"PkgPrice"`
|
// PkgPrice int `json:"PkgPrice"`
|
||||||
Price int `json:"Price"`
|
// Price int `json:"Price"`
|
||||||
Privilege int `json:"Privilege"`
|
// Privilege int `json:"Privilege"`
|
||||||
} `json:"Res"`
|
// } `json:"Res"`
|
||||||
ResBitrate int `json:"ResBitrate"`
|
// ResBitrate int `json:"ResBitrate"`
|
||||||
ResDuration int `json:"ResDuration"`
|
// ResDuration int `json:"ResDuration"`
|
||||||
ResFileHash string `json:"ResFileHash"`
|
// ResFileHash string `json:"ResFileHash"`
|
||||||
ResFileSize int `json:"ResFileSize"`
|
// ResFileSize int `json:"ResFileSize"`
|
||||||
SQBitrate int `json:"SQBitrate"`
|
// SQBitrate int `json:"SQBitrate"`
|
||||||
SQDuration int `json:"SQDuration"`
|
// SQDuration int `json:"SQDuration"`
|
||||||
SQExtName string `json:"SQExtName"`
|
// SQExtName string `json:"SQExtName"`
|
||||||
SQFailProcess int `json:"SQFailProcess"`
|
// SQFailProcess int `json:"SQFailProcess"`
|
||||||
SQFileHash string `json:"SQFileHash"`
|
// SQFileHash string `json:"SQFileHash"`
|
||||||
SQFileSize int `json:"SQFileSize"`
|
// SQFileSize int `json:"SQFileSize"`
|
||||||
SQPayType int `json:"SQPayType"`
|
// SQPayType int `json:"SQPayType"`
|
||||||
SQPkgPrice int `json:"SQPkgPrice"`
|
// SQPkgPrice int `json:"SQPkgPrice"`
|
||||||
SQPrice int `json:"SQPrice"`
|
// SQPrice int `json:"SQPrice"`
|
||||||
SQPrivilege int `json:"SQPrivilege"`
|
// SQPrivilege int `json:"SQPrivilege"`
|
||||||
Scid int `json:"Scid"`
|
// Scid int `json:"Scid"`
|
||||||
ShowingFlag int `json:"ShowingFlag"`
|
// ShowingFlag int `json:"ShowingFlag"`
|
||||||
SingerID []int `json:"SingerId"`
|
// SingerID []int `json:"SingerId"`
|
||||||
SingerName string `json:"SingerName"`
|
// SingerName string `json:"SingerName"`
|
||||||
Singers []struct {
|
// Singers []struct {
|
||||||
ID int `json:"id"`
|
// ID int `json:"id"`
|
||||||
IPID int `json:"ip_id"`
|
// IPID int `json:"ip_id"`
|
||||||
Name string `json:"name"`
|
// Name string `json:"name"`
|
||||||
} `json:"Singers"`
|
// } `json:"Singers"`
|
||||||
SongLabel string `json:"SongLabel"`
|
// SongLabel string `json:"SongLabel"`
|
||||||
SongName string `json:"SongName"`
|
// SongName string `json:"SongName"`
|
||||||
Source string `json:"Source"`
|
// Source string `json:"Source"`
|
||||||
SourceID int `json:"SourceID"`
|
// SourceID int `json:"SourceID"`
|
||||||
Suffix string `json:"Suffix"`
|
// Suffix string `json:"Suffix"`
|
||||||
SuperBitrate int `json:"SuperBitrate"`
|
// SuperBitrate int `json:"SuperBitrate"`
|
||||||
SuperDuration int `json:"SuperDuration"`
|
// SuperDuration int `json:"SuperDuration"`
|
||||||
SuperExtName string `json:"SuperExtName"`
|
// SuperExtName string `json:"SuperExtName"`
|
||||||
SuperFileHash string `json:"SuperFileHash"`
|
// SuperFileHash string `json:"SuperFileHash"`
|
||||||
SuperFileSize int `json:"SuperFileSize"`
|
// SuperFileSize int `json:"SuperFileSize"`
|
||||||
TagContent string `json:"TagContent"`
|
// TagContent string `json:"TagContent"`
|
||||||
TagDetails []struct {
|
// TagDetails []struct {
|
||||||
Content string `json:"content"`
|
// Content string `json:"content"`
|
||||||
Rankid int `json:"rankid"`
|
// Rankid int `json:"rankid"`
|
||||||
Type int `json:"type"`
|
// Type int `json:"type"`
|
||||||
Version int `json:"version"`
|
// Version int `json:"version"`
|
||||||
} `json:"TagDetails"`
|
// } `json:"TagDetails"`
|
||||||
TopID int `json:"TopID"`
|
// TopID int `json:"TopID"`
|
||||||
TopicRemark string `json:"TopicRemark"`
|
// TopicRemark string `json:"TopicRemark"`
|
||||||
TopicURL string `json:"TopicUrl"`
|
// TopicURL string `json:"TopicUrl"`
|
||||||
Type string `json:"Type"`
|
// Type string `json:"Type"`
|
||||||
Uploader string `json:"Uploader"`
|
// Uploader string `json:"Uploader"`
|
||||||
UploaderContent string `json:"UploaderContent"`
|
// UploaderContent string `json:"UploaderContent"`
|
||||||
MvTotal int `json:"mvTotal"`
|
// MvTotal int `json:"mvTotal"`
|
||||||
Mvdata []struct {
|
// Mvdata []struct {
|
||||||
Hash string `json:"hash"`
|
// Hash string `json:"hash"`
|
||||||
ID string `json:"id"`
|
// ID string `json:"id"`
|
||||||
Trk string `json:"trk"`
|
// Trk string `json:"trk"`
|
||||||
Typ int `json:"typ"`
|
// Typ int `json:"typ"`
|
||||||
} `json:"mvdata"`
|
// } `json:"mvdata"`
|
||||||
RecommendType int `json:"recommend_type"`
|
// RecommendType int `json:"recommend_type"`
|
||||||
TransParam struct {
|
// TransParam struct {
|
||||||
AppidBlock string `json:"appid_block"`
|
// AppidBlock string `json:"appid_block"`
|
||||||
Cid int `json:"cid"`
|
// Cid int `json:"cid"`
|
||||||
Classmap struct {
|
// Classmap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"classmap"`
|
// } `json:"classmap"`
|
||||||
CpyAttr0 int `json:"cpy_attr0"`
|
// CpyAttr0 int `json:"cpy_attr0"`
|
||||||
CpyGrade int `json:"cpy_grade"`
|
// CpyGrade int `json:"cpy_grade"`
|
||||||
CpyLevel int `json:"cpy_level"`
|
// CpyLevel int `json:"cpy_level"`
|
||||||
Display int `json:"display"`
|
// Display int `json:"display"`
|
||||||
DisplayRate int `json:"display_rate"`
|
// DisplayRate int `json:"display_rate"`
|
||||||
HashMultitrack string `json:"hash_multitrack"`
|
// HashMultitrack string `json:"hash_multitrack"`
|
||||||
Ipmap struct {
|
// Ipmap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"ipmap"`
|
// } `json:"ipmap"`
|
||||||
Language string `json:"language"`
|
// Language string `json:"language"`
|
||||||
MusicpackAdvance int `json:"musicpack_advance"`
|
// MusicpackAdvance int `json:"musicpack_advance"`
|
||||||
PayBlockTpl int `json:"pay_block_tpl"`
|
// PayBlockTpl int `json:"pay_block_tpl"`
|
||||||
Qualitymap struct {
|
// Qualitymap struct {
|
||||||
Attr0 int `json:"attr0"`
|
// Attr0 int `json:"attr0"`
|
||||||
} `json:"qualitymap"`
|
// } `json:"qualitymap"`
|
||||||
SongnameSuffix string `json:"songname_suffix"`
|
// SongnameSuffix string `json:"songname_suffix"`
|
||||||
} `json:"trans_param"`
|
// } `json:"trans_param"`
|
||||||
Vvid string `json:"vvid"`
|
// Vvid string `json:"vvid"`
|
||||||
} `json:"lists"`
|
} `json:"lists"`
|
||||||
Page int `json:"page"`
|
// Page int `json:"page"`
|
||||||
Pagesize int `json:"pagesize"`
|
// Pagesize int `json:"pagesize"`
|
||||||
Searchfull int `json:"searchfull"`
|
// Searchfull int `json:"searchfull"`
|
||||||
SecAggre struct {
|
// SecAggre struct {
|
||||||
} `json:"sec_aggre"`
|
// } `json:"sec_aggre"`
|
||||||
SecAggreV2 []interface{} `json:"sec_aggre_v2"`
|
// SecAggreV2 []interface{} `json:"sec_aggre_v2"`
|
||||||
SectagInfo struct {
|
// SectagInfo struct {
|
||||||
IsSectag int `json:"is_sectag"`
|
// IsSectag int `json:"is_sectag"`
|
||||||
} `json:"sectag_info"`
|
// } `json:"sectag_info"`
|
||||||
Size int `json:"size"`
|
// Size int `json:"size"`
|
||||||
Subjecttype int `json:"subjecttype"`
|
// Subjecttype int `json:"subjecttype"`
|
||||||
Total int `json:"total"`
|
Total int `json:"total"`
|
||||||
} `json:"data"`
|
} `json:"data"`
|
||||||
ErrorCode int `json:"error_code"`
|
// ErrorCode int `json:"error_code"`
|
||||||
ErrorMsg string `json:"error_msg"`
|
ErrorMsg string `json:"error_msg"`
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type refreshInfo struct {
|
type refreshInfo struct {
|
||||||
Data string `json:"data"`
|
// Data string `json:"data"`
|
||||||
ErrorCode int `json:"error_code"`
|
ErrorCode int `json:"error_code"`
|
||||||
ErrorMsg string `json:"error_msg"`
|
ErrorMsg string `json:"error_msg"`
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
|
@ -79,7 +79,7 @@ func bdapi(songMid, quality string) (ourl, msg string) {
|
|||||||
`https://bd-api.kuwo.cn/api/service/music/downloadInfo/`, songMid,
|
`https://bd-api.kuwo.cn/api/service/music/downloadInfo/`, songMid,
|
||||||
`?isMv=0&format=`, info.E,
|
`?isMv=0&format=`, info.E,
|
||||||
`&br=`, info.H, info.E, //`&level=`,
|
`&br=`, info.H, info.E, //`&level=`,
|
||||||
`&uin=`, env.Config.Custom.Kw_Bd_Uid,
|
`&uid=`, env.Config.Custom.Kw_Bd_Uid,
|
||||||
`&token=`, env.Config.Custom.Kw_Bd_Token,
|
`&token=`, env.Config.Custom.Kw_Bd_Token,
|
||||||
)
|
)
|
||||||
// jx.Debug(`Kw, Url: %s`, url)
|
// jx.Debug(`Kw, Url: %s`, url)
|
||||||
|
41
src/sources/custom/mg/albuminfo.go
Normal file
41
src/sources/custom/mg/albuminfo.go
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package mg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/gob"
|
||||||
|
"errors"
|
||||||
|
"lx-source/src/env"
|
||||||
|
"lx-source/src/sources"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/ZxwyWebSite/ztool"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
gob.Register(albumInfo{})
|
||||||
|
}
|
||||||
|
|
||||||
|
func getAlbumInfo(aid string) (info albumInfo, err error) {
|
||||||
|
cquery := strings.Join([]string{`mg`, aid, `ainfo`}, `/`)
|
||||||
|
if cdata, ok := env.Cache.Get(cquery); ok {
|
||||||
|
if cinfo, ok := cdata.(albumInfo); ok {
|
||||||
|
info = cinfo
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err = ztool.Net_Request(
|
||||||
|
http.MethodGet, ztool.Str_FastConcat(
|
||||||
|
`https://app.c.nf.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?needSimple=01&resourceId=`, aid, `&resourceType=2003`,
|
||||||
|
), nil,
|
||||||
|
[]ztool.Net_ReqHandlerFunc{ztool.Net_ReqAddHeaders()},
|
||||||
|
[]ztool.Net_ResHandlerFunc{ztool.Net_ResToStruct(&info)},
|
||||||
|
)
|
||||||
|
if err == nil {
|
||||||
|
if len(info.Resource) == 0 {
|
||||||
|
err = errors.New(`no Album Resource`)
|
||||||
|
} else {
|
||||||
|
env.Cache.Set(cquery, info, sources.C_lx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
41
src/sources/custom/mg/musicinfo.go
Normal file
41
src/sources/custom/mg/musicinfo.go
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package mg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/gob"
|
||||||
|
"errors"
|
||||||
|
"lx-source/src/env"
|
||||||
|
"lx-source/src/sources"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/ZxwyWebSite/ztool"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
gob.Register(musicInfo{})
|
||||||
|
}
|
||||||
|
|
||||||
|
func getMusicInfo(cid string) (info musicInfo, err error) {
|
||||||
|
cquery := strings.Join([]string{`mg`, cid, `minfo`}, `/`)
|
||||||
|
if cdata, ok := env.Cache.Get(cquery); ok {
|
||||||
|
if cinfo, ok := cdata.(musicInfo); ok {
|
||||||
|
info = cinfo
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err = ztool.Net_Request(
|
||||||
|
http.MethodGet, ztool.Str_FastConcat(
|
||||||
|
`https://c.musicapp.migu.cn/MIGUM2.0/v1.0/content/resourceinfo.do?copyrightId=`, cid, `&resourceType=2`,
|
||||||
|
), nil,
|
||||||
|
[]ztool.Net_ReqHandlerFunc{ztool.Net_ReqAddHeaders()},
|
||||||
|
[]ztool.Net_ResHandlerFunc{ztool.Net_ResToStruct(&info)},
|
||||||
|
)
|
||||||
|
if err == nil {
|
||||||
|
if len(info.Resource) == 0 {
|
||||||
|
err = errors.New(`no Music Resource`)
|
||||||
|
} else {
|
||||||
|
env.Cache.Set(cquery, info, sources.C_lx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
@ -37,6 +37,9 @@ func init() {
|
|||||||
}
|
}
|
||||||
mg_pool = &sync.Pool{New: func() any { return new(playInfo) }}
|
mg_pool = &sync.Pool{New: func() any { return new(playInfo) }}
|
||||||
Url = mcustom
|
Url = mcustom
|
||||||
|
case `2`, `malbum`:
|
||||||
|
loger.Debug(`use malbum`)
|
||||||
|
Url = malbum
|
||||||
default:
|
default:
|
||||||
loger.Fatal(`未定义的接口模式,请检查配置 [Custom].Mg_Mode`)
|
loger.Fatal(`未定义的接口模式,请检查配置 [Custom].Mg_Mode`)
|
||||||
}
|
}
|
||||||
@ -46,12 +49,12 @@ func init() {
|
|||||||
|
|
||||||
func builtin(songMid, quality string) (ourl, msg string) {
|
func builtin(songMid, quality string) (ourl, msg string) {
|
||||||
loger := env.Loger.NewGroup(`Mg`)
|
loger := env.Loger.NewGroup(`Mg`)
|
||||||
|
defer loger.Free()
|
||||||
rquality, ok := qualitys[quality]
|
rquality, ok := qualitys[quality]
|
||||||
if !ok {
|
if !ok {
|
||||||
msg = sources.E_QNotSupport
|
msg = sources.E_QNotSupport
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer loger.Free()
|
|
||||||
resp := mg_pool.Get().(*mgApi_Song)
|
resp := mg_pool.Get().(*mgApi_Song)
|
||||||
defer mg_pool.Put(resp)
|
defer mg_pool.Put(resp)
|
||||||
url := ztool.Str_FastConcat(`https://`, example.Api_mg, `?copyrightId=`, songMid, `&type=`, rquality)
|
url := ztool.Str_FastConcat(`https://`, example.Api_mg, `?copyrightId=`, songMid, `&type=`, rquality)
|
||||||
@ -66,6 +69,7 @@ func builtin(songMid, quality string) (ourl, msg string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
loger.Debug(`Resp: %+v`, resp)
|
loger.Debug(`Resp: %+v`, resp)
|
||||||
|
// ourl, msg = resp.Url(rquality)
|
||||||
if resp.Data.PlayURL != `` {
|
if resp.Data.PlayURL != `` {
|
||||||
ourl = `https:` + utils.DelQuery(resp.Data.PlayURL)
|
ourl = `https:` + utils.DelQuery(resp.Data.PlayURL)
|
||||||
} else {
|
} else {
|
||||||
@ -126,3 +130,56 @@ func mcustom(songMid, quality string) (ourl, msg string) {
|
|||||||
ourl = utils.DelQuery(resp.Data.URL)
|
ourl = utils.DelQuery(resp.Data.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func malbum(songMid, quality string) (ourl, msg string) {
|
||||||
|
loger := env.Loger.NewGroup(`Mg`)
|
||||||
|
defer loger.Free()
|
||||||
|
rquality, ok := qualityMap[quality]
|
||||||
|
if !ok {
|
||||||
|
msg = sources.E_QNotSupport
|
||||||
|
return
|
||||||
|
}
|
||||||
|
minfo, err := getMusicInfo(songMid)
|
||||||
|
if err != nil {
|
||||||
|
msg = err.Error()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loger.Debug(`mInfo: %+v`, minfo)
|
||||||
|
var hasQuality bool
|
||||||
|
for _, v := range minfo.Resource[0].NewRateFormats {
|
||||||
|
if hasQuality = v.FormatType == rquality; hasQuality {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !hasQuality {
|
||||||
|
msg = sources.E_QNotMatch
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ainfo, err := getAlbumInfo(minfo.Resource[0].AlbumID)
|
||||||
|
if err != nil {
|
||||||
|
msg = err.Error()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loger.Debug(`aInfo: %+v`, ainfo)
|
||||||
|
for _, v := range ainfo.Resource[0].SongItems {
|
||||||
|
if v.CopyrightID == songMid {
|
||||||
|
for _, w := range v.NewRateFormats {
|
||||||
|
if w.FormatType == rquality {
|
||||||
|
if rquality == `PQ` || rquality == `HQ` {
|
||||||
|
ourl = w.URL
|
||||||
|
} else {
|
||||||
|
ourl = w.AndroidURL
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ourl == `` {
|
||||||
|
msg = sources.E_NoLink
|
||||||
|
} else {
|
||||||
|
ourl = `https://freetyst.nf.migu.cn` + ourl[24:]
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
37
src/sources/custom/mg/refresh.go
Normal file
37
src/sources/custom/mg/refresh.go
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package mg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"lx-source/src/env"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/ZxwyWebSite/ztool"
|
||||||
|
"github.com/ZxwyWebSite/ztool/logs"
|
||||||
|
)
|
||||||
|
|
||||||
|
func refresh(loger *logs.Logger, now int64) error {
|
||||||
|
var out map[string]any
|
||||||
|
err := ztool.Net_Request(
|
||||||
|
http.MethodPost,
|
||||||
|
`https://m.music.migu.cn/migumusic/h5/user/auth/userActiveNotice`,
|
||||||
|
nil,
|
||||||
|
[]ztool.Net_ReqHandlerFunc{ztool.Net_ReqAddHeaders(mgheader)},
|
||||||
|
[]ztool.Net_ResHandlerFunc{ztool.Net_ResToStruct(&out)},
|
||||||
|
)
|
||||||
|
if err == nil {
|
||||||
|
if out[`code`].(int) != http.StatusOK {
|
||||||
|
return errors.New(out[`msg`].(string))
|
||||||
|
} else {
|
||||||
|
loger.Info(`咪咕session保活成功`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
env.Inits.Add(func() {
|
||||||
|
if env.Config.Custom.Mg_Refresh_Enable && false {
|
||||||
|
env.Tasker.Add(`mg_refresh`, refresh, 86000, true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -43,6 +43,25 @@ type playInfo struct {
|
|||||||
Info string `json:"info"`
|
Info string `json:"info"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// func (resp *playInfo) Url(rquality string) (ourl, emsg string) {
|
||||||
|
// if resp.Code != `000000` {
|
||||||
|
// emsg = resp.Info
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// if resp.Data.URL == `` {
|
||||||
|
// emsg = `No Data: 无返回链接`
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// if resp.Data.AudioFormatType != rquality {
|
||||||
|
// emsg = ztool.Str_FastConcat(`实际音质不匹配: `, rquality, ` <= `, resp.Data.AudioFormatType)
|
||||||
|
// if !env.Config.Source.ForceFallback {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// ourl = utils.DelQuery(resp.Data.URL)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
type mgApi_Song struct {
|
type mgApi_Song struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Msg string `json:"msg"`
|
Msg string `json:"msg"`
|
||||||
@ -55,3 +74,460 @@ type mgApi_Song struct {
|
|||||||
AuditionsLength int `json:"auditionsLength"`
|
AuditionsLength int `json:"auditionsLength"`
|
||||||
} `json:"data"`
|
} `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// func (resp *mgApi_Song) Url(string) (ourl, emsg string) {
|
||||||
|
// if resp.Data.PlayURL != `` {
|
||||||
|
// ourl = `https:` + utils.DelQuery(resp.Data.PlayURL)
|
||||||
|
// } else {
|
||||||
|
// emsg = ztool.Str_FastConcat(resp.Code, `: `, resp.Msg)
|
||||||
|
// }
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
type musicInfo struct {
|
||||||
|
// Code string `json:"code"`
|
||||||
|
// Info string `json:"info"`
|
||||||
|
Resource []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// RefID string `json:"refId"`
|
||||||
|
// CopyrightID string `json:"copyrightId"`
|
||||||
|
// ContentID string `json:"contentId"`
|
||||||
|
// SongID string `json:"songId"`
|
||||||
|
// SongName string `json:"songName"`
|
||||||
|
// SingerID string `json:"singerId"`
|
||||||
|
// Singer string `json:"singer"`
|
||||||
|
AlbumID string `json:"albumId"`
|
||||||
|
// Album string `json:"album"`
|
||||||
|
// AlbumImgs []struct {
|
||||||
|
// ImgSizeType string `json:"imgSizeType"`
|
||||||
|
// Img string `json:"img"`
|
||||||
|
// FileID string `json:"fileId"`
|
||||||
|
// WebpImg string `json:"webpImg"`
|
||||||
|
// } `json:"albumImgs"`
|
||||||
|
// OpNumItem struct {
|
||||||
|
// PlayNum int `json:"playNum"`
|
||||||
|
// PlayNumDesc string `json:"playNumDesc"`
|
||||||
|
// KeepNum int `json:"keepNum"`
|
||||||
|
// KeepNumDesc string `json:"keepNumDesc"`
|
||||||
|
// CommentNum int `json:"commentNum"`
|
||||||
|
// CommentNumDesc string `json:"commentNumDesc"`
|
||||||
|
// ShareNum int `json:"shareNum"`
|
||||||
|
// ShareNumDesc string `json:"shareNumDesc"`
|
||||||
|
// OrderNumByWeek int `json:"orderNumByWeek"`
|
||||||
|
// OrderNumByWeekDesc string `json:"orderNumByWeekDesc"`
|
||||||
|
// OrderNumByTotal int `json:"orderNumByTotal"`
|
||||||
|
// OrderNumByTotalDesc string `json:"orderNumByTotalDesc"`
|
||||||
|
// ThumbNum int `json:"thumbNum"`
|
||||||
|
// ThumbNumDesc string `json:"thumbNumDesc"`
|
||||||
|
// FollowNum int `json:"followNum"`
|
||||||
|
// FollowNumDesc string `json:"followNumDesc"`
|
||||||
|
// SubscribeNum int `json:"subscribeNum"`
|
||||||
|
// SubscribeNumDesc string `json:"subscribeNumDesc"`
|
||||||
|
// LivePlayNum int `json:"livePlayNum"`
|
||||||
|
// LivePlayNumDesc string `json:"livePlayNumDesc"`
|
||||||
|
// PopularNum int `json:"popularNum"`
|
||||||
|
// PopularNumDesc string `json:"popularNumDesc"`
|
||||||
|
// BookingNum int `json:"bookingNum"`
|
||||||
|
// BookingNumDesc string `json:"bookingNumDesc"`
|
||||||
|
// SettingNum int `json:"settingNum"`
|
||||||
|
// SettingNumDesc string `json:"settingNumDesc"`
|
||||||
|
// CallNum int `json:"callNum"`
|
||||||
|
// CallNumDesc string `json:"callNumDesc"`
|
||||||
|
// CallingPlayNum int `json:"callingPlayNum"`
|
||||||
|
// CallingPlayNumDesc string `json:"callingPlayNumDesc"`
|
||||||
|
// CallingPlayDuration int `json:"callingPlayDuration"`
|
||||||
|
// CallingPlayDurationDesc string `json:"callingPlayDurationDesc"`
|
||||||
|
// CalledPlayDuration int `json:"calledPlayDuration"`
|
||||||
|
// CalledPlayDurationDesc string `json:"calledPlayDurationDesc"`
|
||||||
|
// RingtoneAppPlayNum int `json:"ringtoneAppPlayNum"`
|
||||||
|
// RingtoneAppPlayNumDesc string `json:"ringtoneAppPlayNumDesc"`
|
||||||
|
// RingtoneAppSettingNum int `json:"ringtoneAppSettingNum"`
|
||||||
|
// RingtoneAppSettingNumDesc string `json:"ringtoneAppSettingNumDesc"`
|
||||||
|
// } `json:"opNumItem"`
|
||||||
|
// ToneControl string `json:"toneControl"`
|
||||||
|
// RelatedSongs []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// ResourceTypeName string `json:"resourceTypeName"`
|
||||||
|
// CopyrightID string `json:"copyrightId"`
|
||||||
|
// ProductID string `json:"productId"`
|
||||||
|
// } `json:"relatedSongs"`
|
||||||
|
// RateFormats []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// FormatType string `json:"formatType"`
|
||||||
|
// Format string `json:"format"`
|
||||||
|
// Size string `json:"size"`
|
||||||
|
// FileType string `json:"fileType,omitempty"`
|
||||||
|
// Price string `json:"price"`
|
||||||
|
// AndroidFileType string `json:"androidFileType,omitempty"`
|
||||||
|
// IosFileType string `json:"iosFileType,omitempty"`
|
||||||
|
// IosSize string `json:"iosSize,omitempty"`
|
||||||
|
// AndroidSize string `json:"androidSize,omitempty"`
|
||||||
|
// IosFormat string `json:"iosFormat,omitempty"`
|
||||||
|
// AndroidFormat string `json:"androidFormat,omitempty"`
|
||||||
|
// IosAccuracyLevel string `json:"iosAccuracyLevel,omitempty"`
|
||||||
|
// AndroidAccuracyLevel string `json:"androidAccuracyLevel,omitempty"`
|
||||||
|
// } `json:"rateFormats"`
|
||||||
|
NewRateFormats []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
FormatType string `json:"formatType"`
|
||||||
|
// Format string `json:"format"`
|
||||||
|
// Size string `json:"size"`
|
||||||
|
// FileType string `json:"fileType,omitempty"`
|
||||||
|
// Price string `json:"price"`
|
||||||
|
// AndroidFileType string `json:"androidFileType,omitempty"`
|
||||||
|
// IosFileType string `json:"iosFileType,omitempty"`
|
||||||
|
// IosSize string `json:"iosSize,omitempty"`
|
||||||
|
// AndroidSize string `json:"androidSize,omitempty"`
|
||||||
|
// IosFormat string `json:"iosFormat,omitempty"`
|
||||||
|
// AndroidFormat string `json:"androidFormat,omitempty"`
|
||||||
|
// IosAccuracyLevel string `json:"iosAccuracyLevel,omitempty"`
|
||||||
|
// AndroidAccuracyLevel string `json:"androidAccuracyLevel,omitempty"`
|
||||||
|
} `json:"newRateFormats"`
|
||||||
|
// LrcURL string `json:"lrcUrl"`
|
||||||
|
// TagList []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// TagID string `json:"tagId"`
|
||||||
|
// TagName string `json:"tagName"`
|
||||||
|
// TagDesc string `json:"tagDesc,omitempty"`
|
||||||
|
// } `json:"tagList"`
|
||||||
|
// DigitalColumnID string `json:"digitalColumnId"`
|
||||||
|
// Copyright string `json:"copyright"`
|
||||||
|
// ValidStatus bool `json:"validStatus"`
|
||||||
|
// SongDescs string `json:"songDescs"`
|
||||||
|
// SongAliasName string `json:"songAliasName"`
|
||||||
|
// IsInDAlbum string `json:"isInDAlbum"`
|
||||||
|
// IsInSideDalbum string `json:"isInSideDalbum"`
|
||||||
|
// IsInSalesPeriod string `json:"isInSalesPeriod"`
|
||||||
|
// SongType string `json:"songType"`
|
||||||
|
// MrcURL string `json:"mrcUrl"`
|
||||||
|
// InvalidateDate string `json:"invalidateDate"`
|
||||||
|
// DalbumID string `json:"dalbumId"`
|
||||||
|
// TrcURL string `json:"trcUrl"`
|
||||||
|
// VipType string `json:"vipType"`
|
||||||
|
// ScopeOfcopyright string `json:"scopeOfcopyright"`
|
||||||
|
// AuditionsType string `json:"auditionsType"`
|
||||||
|
// FirstIcon string `json:"firstIcon"`
|
||||||
|
// TranslateName string `json:"translateName"`
|
||||||
|
// ChargeAuditions string `json:"chargeAuditions"`
|
||||||
|
// OldChargeAuditions string `json:"oldChargeAuditions"`
|
||||||
|
// SongIcon string `json:"songIcon"`
|
||||||
|
// CodeRate struct {
|
||||||
|
// PQ struct {
|
||||||
|
// CodeRateChargeAuditions string `json:"codeRateChargeAuditions"`
|
||||||
|
// IsCodeRateDownload string `json:"isCodeRateDownload"`
|
||||||
|
// CodeRateFileSize string `json:"codeRateFileSize"`
|
||||||
|
// } `json:"PQ"`
|
||||||
|
// HQ struct {
|
||||||
|
// CodeRateChargeAuditions string `json:"codeRateChargeAuditions"`
|
||||||
|
// IsCodeRateDownload string `json:"isCodeRateDownload"`
|
||||||
|
// } `json:"HQ"`
|
||||||
|
// SQ struct {
|
||||||
|
// CodeRateChargeAuditions string `json:"codeRateChargeAuditions"`
|
||||||
|
// IsCodeRateDownload string `json:"isCodeRateDownload"`
|
||||||
|
// ContentIDSQ string `json:"contentIdSQ"`
|
||||||
|
// } `json:"SQ"`
|
||||||
|
// } `json:"codeRate"`
|
||||||
|
// IsDownload string `json:"isDownload"`
|
||||||
|
// CopyrightType string `json:"copyrightType"`
|
||||||
|
// HasMv string `json:"hasMv"`
|
||||||
|
// TopQuality string `json:"topQuality"`
|
||||||
|
// PreSale string `json:"preSale"`
|
||||||
|
// IsShare string `json:"isShare"`
|
||||||
|
// IsCollection string `json:"isCollection"`
|
||||||
|
// Length string `json:"length"`
|
||||||
|
// SingerImg struct {
|
||||||
|
// Num421 struct {
|
||||||
|
// SingerName string `json:"singerName"`
|
||||||
|
// MiguImgItems []struct {
|
||||||
|
// ImgSizeType string `json:"imgSizeType"`
|
||||||
|
// Img string `json:"img"`
|
||||||
|
// FileID string `json:"fileId"`
|
||||||
|
// WebpImg string `json:"webpImg"`
|
||||||
|
// } `json:"miguImgItems"`
|
||||||
|
// } `json:"421"`
|
||||||
|
// } `json:"singerImg"`
|
||||||
|
// SongNamePinyin string `json:"songNamePinyin"`
|
||||||
|
// AlbumNamePinyin string `json:"albumNamePinyin"`
|
||||||
|
// Artists []struct {
|
||||||
|
// ID string `json:"id"`
|
||||||
|
// Name string `json:"name"`
|
||||||
|
// NameSpelling string `json:"nameSpelling"`
|
||||||
|
// } `json:"artists"`
|
||||||
|
// LandscapImg string `json:"landscapImg"`
|
||||||
|
// VipLogo string `json:"vipLogo"`
|
||||||
|
// VipDownload string `json:"vipDownload"`
|
||||||
|
// FirstPublish string `json:"firstPublish"`
|
||||||
|
// ShowTag []string `json:"showTag"`
|
||||||
|
// MaterialValidStatus bool `json:"materialValidStatus"`
|
||||||
|
// NeedEncrypt string `json:"needEncrypt"`
|
||||||
|
// ForeverListen bool `json:"foreverListen"`
|
||||||
|
// HasAssociatedRing bool `json:"hasAssociatedRing"`
|
||||||
|
} `json:"resource"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type albumInfo struct {
|
||||||
|
// Code string `json:"code"`
|
||||||
|
// Info string `json:"info"`
|
||||||
|
Resource []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// AlbumID string `json:"albumId"`
|
||||||
|
// ImgItems []struct {
|
||||||
|
// ImgSizeType string `json:"imgSizeType"`
|
||||||
|
// Img string `json:"img"`
|
||||||
|
// FileID string `json:"fileId"`
|
||||||
|
// WebpImg string `json:"webpImg"`
|
||||||
|
// } `json:"imgItems"`
|
||||||
|
// Title string `json:"title"`
|
||||||
|
// Singer string `json:"singer"`
|
||||||
|
// SingerID string `json:"singerId"`
|
||||||
|
// SingerImgs []struct {
|
||||||
|
// ImgSizeType string `json:"imgSizeType"`
|
||||||
|
// Img string `json:"img"`
|
||||||
|
// FileID string `json:"fileId"`
|
||||||
|
// WebpImg string `json:"webpImg"`
|
||||||
|
// } `json:"singerImgs"`
|
||||||
|
// Summary string `json:"summary"`
|
||||||
|
// TotalCount string `json:"totalCount"`
|
||||||
|
// PublishTime string `json:"publishTime"`
|
||||||
|
// PublishCorp string `json:"publishCorp"`
|
||||||
|
// OpNumItem struct {
|
||||||
|
// PlayNum int `json:"playNum"`
|
||||||
|
// PlayNumDesc string `json:"playNumDesc"`
|
||||||
|
// KeepNum int `json:"keepNum"`
|
||||||
|
// KeepNumDesc string `json:"keepNumDesc"`
|
||||||
|
// CommentNum int `json:"commentNum"`
|
||||||
|
// CommentNumDesc string `json:"commentNumDesc"`
|
||||||
|
// ShareNum int `json:"shareNum"`
|
||||||
|
// ShareNumDesc string `json:"shareNumDesc"`
|
||||||
|
// OrderNumByWeek int `json:"orderNumByWeek"`
|
||||||
|
// OrderNumByWeekDesc string `json:"orderNumByWeekDesc"`
|
||||||
|
// OrderNumByTotal int `json:"orderNumByTotal"`
|
||||||
|
// OrderNumByTotalDesc string `json:"orderNumByTotalDesc"`
|
||||||
|
// ThumbNum int `json:"thumbNum"`
|
||||||
|
// ThumbNumDesc string `json:"thumbNumDesc"`
|
||||||
|
// FollowNum int `json:"followNum"`
|
||||||
|
// FollowNumDesc string `json:"followNumDesc"`
|
||||||
|
// SubscribeNum int `json:"subscribeNum"`
|
||||||
|
// SubscribeNumDesc string `json:"subscribeNumDesc"`
|
||||||
|
// LivePlayNum int `json:"livePlayNum"`
|
||||||
|
// LivePlayNumDesc string `json:"livePlayNumDesc"`
|
||||||
|
// PopularNum int `json:"popularNum"`
|
||||||
|
// PopularNumDesc string `json:"popularNumDesc"`
|
||||||
|
// BookingNum int `json:"bookingNum"`
|
||||||
|
// BookingNumDesc string `json:"bookingNumDesc"`
|
||||||
|
// SettingNum int `json:"settingNum"`
|
||||||
|
// SettingNumDesc string `json:"settingNumDesc"`
|
||||||
|
// CallNum int `json:"callNum"`
|
||||||
|
// CallNumDesc string `json:"callNumDesc"`
|
||||||
|
// CallingPlayNum int `json:"callingPlayNum"`
|
||||||
|
// CallingPlayNumDesc string `json:"callingPlayNumDesc"`
|
||||||
|
// CallingPlayDuration int `json:"callingPlayDuration"`
|
||||||
|
// CallingPlayDurationDesc string `json:"callingPlayDurationDesc"`
|
||||||
|
// CalledPlayDuration int `json:"calledPlayDuration"`
|
||||||
|
// CalledPlayDurationDesc string `json:"calledPlayDurationDesc"`
|
||||||
|
// RingtoneAppPlayNum int `json:"ringtoneAppPlayNum"`
|
||||||
|
// RingtoneAppPlayNumDesc string `json:"ringtoneAppPlayNumDesc"`
|
||||||
|
// RingtoneAppSettingNum int `json:"ringtoneAppSettingNum"`
|
||||||
|
// RingtoneAppSettingNumDesc string `json:"ringtoneAppSettingNumDesc"`
|
||||||
|
// } `json:"opNumItem"`
|
||||||
|
// Tags []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// TagID string `json:"tagId"`
|
||||||
|
// TagName string `json:"tagName"`
|
||||||
|
// TagDesc string `json:"tagDesc,omitempty"`
|
||||||
|
// } `json:"tags"`
|
||||||
|
// AlbumAliasName string `json:"albumAliasName"`
|
||||||
|
// AlbumClass string `json:"albumClass"`
|
||||||
|
// Language string `json:"language"`
|
||||||
|
// PublishCompany string `json:"publishCompany"`
|
||||||
|
// PublishDate string `json:"publishDate"`
|
||||||
|
// TranslateName string `json:"translateName"`
|
||||||
|
SongItems []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// RefID string `json:"refId"`
|
||||||
|
CopyrightID string `json:"copyrightId"`
|
||||||
|
// ContentID string `json:"contentId"`
|
||||||
|
// SongID string `json:"songId"`
|
||||||
|
// SongName string `json:"songName"`
|
||||||
|
// SingerID string `json:"singerId"`
|
||||||
|
// Singer string `json:"singer"`
|
||||||
|
// AlbumID string `json:"albumId"`
|
||||||
|
// Album string `json:"album"`
|
||||||
|
// AlbumImgs []struct {
|
||||||
|
// ImgSizeType string `json:"imgSizeType"`
|
||||||
|
// Img string `json:"img"`
|
||||||
|
// FileID string `json:"fileId"`
|
||||||
|
// WebpImg string `json:"webpImg"`
|
||||||
|
// } `json:"albumImgs"`
|
||||||
|
// OpNumItem struct {
|
||||||
|
// PlayNum int `json:"playNum"`
|
||||||
|
// PlayNumDesc string `json:"playNumDesc"`
|
||||||
|
// KeepNum int `json:"keepNum"`
|
||||||
|
// KeepNumDesc string `json:"keepNumDesc"`
|
||||||
|
// CommentNum int `json:"commentNum"`
|
||||||
|
// CommentNumDesc string `json:"commentNumDesc"`
|
||||||
|
// ShareNum int `json:"shareNum"`
|
||||||
|
// ShareNumDesc string `json:"shareNumDesc"`
|
||||||
|
// OrderNumByWeek int `json:"orderNumByWeek"`
|
||||||
|
// OrderNumByWeekDesc string `json:"orderNumByWeekDesc"`
|
||||||
|
// OrderNumByTotal int `json:"orderNumByTotal"`
|
||||||
|
// OrderNumByTotalDesc string `json:"orderNumByTotalDesc"`
|
||||||
|
// ThumbNum int `json:"thumbNum"`
|
||||||
|
// ThumbNumDesc string `json:"thumbNumDesc"`
|
||||||
|
// FollowNum int `json:"followNum"`
|
||||||
|
// FollowNumDesc string `json:"followNumDesc"`
|
||||||
|
// SubscribeNum int `json:"subscribeNum"`
|
||||||
|
// SubscribeNumDesc string `json:"subscribeNumDesc"`
|
||||||
|
// LivePlayNum int `json:"livePlayNum"`
|
||||||
|
// LivePlayNumDesc string `json:"livePlayNumDesc"`
|
||||||
|
// PopularNum int `json:"popularNum"`
|
||||||
|
// PopularNumDesc string `json:"popularNumDesc"`
|
||||||
|
// BookingNum int `json:"bookingNum"`
|
||||||
|
// BookingNumDesc string `json:"bookingNumDesc"`
|
||||||
|
// SettingNum int `json:"settingNum"`
|
||||||
|
// SettingNumDesc string `json:"settingNumDesc"`
|
||||||
|
// CallNum int `json:"callNum"`
|
||||||
|
// CallNumDesc string `json:"callNumDesc"`
|
||||||
|
// CallingPlayNum int `json:"callingPlayNum"`
|
||||||
|
// CallingPlayNumDesc string `json:"callingPlayNumDesc"`
|
||||||
|
// CallingPlayDuration int `json:"callingPlayDuration"`
|
||||||
|
// CallingPlayDurationDesc string `json:"callingPlayDurationDesc"`
|
||||||
|
// CalledPlayDuration int `json:"calledPlayDuration"`
|
||||||
|
// CalledPlayDurationDesc string `json:"calledPlayDurationDesc"`
|
||||||
|
// RingtoneAppPlayNum int `json:"ringtoneAppPlayNum"`
|
||||||
|
// RingtoneAppPlayNumDesc string `json:"ringtoneAppPlayNumDesc"`
|
||||||
|
// RingtoneAppSettingNum int `json:"ringtoneAppSettingNum"`
|
||||||
|
// RingtoneAppSettingNumDesc string `json:"ringtoneAppSettingNumDesc"`
|
||||||
|
// } `json:"opNumItem"`
|
||||||
|
// ToneControl string `json:"toneControl"`
|
||||||
|
// RelatedSongs []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// ResourceTypeName string `json:"resourceTypeName"`
|
||||||
|
// CopyrightID string `json:"copyrightId"`
|
||||||
|
// ProductID string `json:"productId"`
|
||||||
|
// } `json:"relatedSongs"`
|
||||||
|
// RateFormats []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// FormatType string `json:"formatType"`
|
||||||
|
// URL string `json:"url,omitempty"`
|
||||||
|
// Format string `json:"format"`
|
||||||
|
// Size string `json:"size"`
|
||||||
|
// FileType string `json:"fileType,omitempty"`
|
||||||
|
// Price string `json:"price"`
|
||||||
|
// IosURL string `json:"iosUrl,omitempty"`
|
||||||
|
// AndroidURL string `json:"androidUrl,omitempty"`
|
||||||
|
// AndroidFileType string `json:"androidFileType,omitempty"`
|
||||||
|
// IosFileType string `json:"iosFileType,omitempty"`
|
||||||
|
// IosSize string `json:"iosSize,omitempty"`
|
||||||
|
// AndroidSize string `json:"androidSize,omitempty"`
|
||||||
|
// IosFormat string `json:"iosFormat,omitempty"`
|
||||||
|
// AndroidFormat string `json:"androidFormat,omitempty"`
|
||||||
|
// IosAccuracyLevel string `json:"iosAccuracyLevel,omitempty"`
|
||||||
|
// AndroidAccuracyLevel string `json:"androidAccuracyLevel,omitempty"`
|
||||||
|
// } `json:"rateFormats"`
|
||||||
|
NewRateFormats []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
FormatType string `json:"formatType"`
|
||||||
|
URL string `json:"url,omitempty"`
|
||||||
|
// Format string `json:"format"`
|
||||||
|
// Size string `json:"size"`
|
||||||
|
// FileType string `json:"fileType,omitempty"`
|
||||||
|
// Price string `json:"price"`
|
||||||
|
// IosURL string `json:"iosUrl,omitempty"`
|
||||||
|
AndroidURL string `json:"androidUrl,omitempty"`
|
||||||
|
// AndroidFileType string `json:"androidFileType,omitempty"`
|
||||||
|
// IosFileType string `json:"iosFileType,omitempty"`
|
||||||
|
// IosSize string `json:"iosSize,omitempty"`
|
||||||
|
// AndroidSize string `json:"androidSize,omitempty"`
|
||||||
|
// IosFormat string `json:"iosFormat,omitempty"`
|
||||||
|
// AndroidFormat string `json:"androidFormat,omitempty"`
|
||||||
|
// IosAccuracyLevel string `json:"iosAccuracyLevel,omitempty"`
|
||||||
|
// AndroidAccuracyLevel string `json:"androidAccuracyLevel,omitempty"`
|
||||||
|
} `json:"newRateFormats"`
|
||||||
|
// LrcURL string `json:"lrcUrl"`
|
||||||
|
// TagList []struct {
|
||||||
|
// ResourceType string `json:"resourceType"`
|
||||||
|
// TagID string `json:"tagId"`
|
||||||
|
// TagName string `json:"tagName"`
|
||||||
|
// TagDesc string `json:"tagDesc,omitempty"`
|
||||||
|
// } `json:"tagList"`
|
||||||
|
// DigitalColumnID string `json:"digitalColumnId"`
|
||||||
|
// Copyright string `json:"copyright"`
|
||||||
|
// ValidStatus bool `json:"validStatus"`
|
||||||
|
// SongDescs string `json:"songDescs"`
|
||||||
|
// SongAliasName string `json:"songAliasName"`
|
||||||
|
// IsInDAlbum string `json:"isInDAlbum"`
|
||||||
|
// IsInSideDalbum string `json:"isInSideDalbum"`
|
||||||
|
// IsInSalesPeriod string `json:"isInSalesPeriod"`
|
||||||
|
// SongType string `json:"songType"`
|
||||||
|
// MrcURL string `json:"mrcUrl"`
|
||||||
|
// InvalidateDate string `json:"invalidateDate"`
|
||||||
|
// DalbumID string `json:"dalbumId"`
|
||||||
|
// TrackNumber string `json:"trackNumber"`
|
||||||
|
// TrcURL string `json:"trcUrl"`
|
||||||
|
// Disc string `json:"disc"`
|
||||||
|
// VipType string `json:"vipType"`
|
||||||
|
// ScopeOfcopyright string `json:"scopeOfcopyright"`
|
||||||
|
// AuditionsType string `json:"auditionsType"`
|
||||||
|
// FirstIcon string `json:"firstIcon"`
|
||||||
|
// TranslateName string `json:"translateName,omitempty"`
|
||||||
|
// ChargeAuditions string `json:"chargeAuditions"`
|
||||||
|
// OldChargeAuditions string `json:"oldChargeAuditions"`
|
||||||
|
// SongIcon string `json:"songIcon"`
|
||||||
|
// CodeRate struct {
|
||||||
|
// PQ struct {
|
||||||
|
// CodeRateChargeAuditions string `json:"codeRateChargeAuditions"`
|
||||||
|
// IsCodeRateDownload string `json:"isCodeRateDownload"`
|
||||||
|
// CodeRateFileSize string `json:"codeRateFileSize"`
|
||||||
|
// } `json:"PQ"`
|
||||||
|
// HQ struct {
|
||||||
|
// CodeRateChargeAuditions string `json:"codeRateChargeAuditions"`
|
||||||
|
// IsCodeRateDownload string `json:"isCodeRateDownload"`
|
||||||
|
// } `json:"HQ"`
|
||||||
|
// SQ struct {
|
||||||
|
// CodeRateChargeAuditions string `json:"codeRateChargeAuditions"`
|
||||||
|
// IsCodeRateDownload string `json:"isCodeRateDownload"`
|
||||||
|
// ContentIDSQ string `json:"contentIdSQ"`
|
||||||
|
// } `json:"SQ"`
|
||||||
|
// } `json:"codeRate"`
|
||||||
|
// IsDownload string `json:"isDownload"`
|
||||||
|
// CopyrightType string `json:"copyrightType"`
|
||||||
|
// HasMv string `json:"hasMv"`
|
||||||
|
// TopQuality string `json:"topQuality"`
|
||||||
|
// PreSale string `json:"preSale"`
|
||||||
|
// IsShare string `json:"isShare"`
|
||||||
|
// IsCollection string `json:"isCollection"`
|
||||||
|
// Length string `json:"length"`
|
||||||
|
// SingerImg struct {
|
||||||
|
// Num421 struct {
|
||||||
|
// SingerName string `json:"singerName"`
|
||||||
|
// MiguImgItems []struct {
|
||||||
|
// ImgSizeType string `json:"imgSizeType"`
|
||||||
|
// Img string `json:"img"`
|
||||||
|
// FileID string `json:"fileId"`
|
||||||
|
// WebpImg string `json:"webpImg"`
|
||||||
|
// } `json:"miguImgItems"`
|
||||||
|
// } `json:"421"`
|
||||||
|
// } `json:"singerImg"`
|
||||||
|
// SongNamePinyin string `json:"songNamePinyin"`
|
||||||
|
// AlbumNamePinyin string `json:"albumNamePinyin"`
|
||||||
|
// Artists []struct {
|
||||||
|
// ID string `json:"id"`
|
||||||
|
// Name string `json:"name"`
|
||||||
|
// NameSpelling string `json:"nameSpelling"`
|
||||||
|
// } `json:"artists"`
|
||||||
|
// LandscapImg string `json:"landscapImg"`
|
||||||
|
// VipLogo string `json:"vipLogo"`
|
||||||
|
// VipDownload string `json:"vipDownload"`
|
||||||
|
// FirstPublish string `json:"firstPublish"`
|
||||||
|
// ShowTag []string `json:"showTag"`
|
||||||
|
// MaterialValidStatus bool `json:"materialValidStatus"`
|
||||||
|
// NeedEncrypt string `json:"needEncrypt"`
|
||||||
|
// ForeverListen bool `json:"foreverListen"`
|
||||||
|
// HasAssociatedRing bool `json:"hasAssociatedRing"`
|
||||||
|
// LoginListenFlag string `json:"loginListenFlag,omitempty"`
|
||||||
|
// MvCopyright string `json:"mvCopyright,omitempty"`
|
||||||
|
// ForeverListenFlag string `json:"foreverListenFlag,omitempty"`
|
||||||
|
} `json:"songItems"`
|
||||||
|
} `json:"resource"`
|
||||||
|
}
|
||||||
|
@ -27,5 +27,20 @@ var (
|
|||||||
sources.Q_320k: `2`,
|
sources.Q_320k: `2`,
|
||||||
sources.Q_flac: `3`,
|
sources.Q_flac: `3`,
|
||||||
sources.Q_fl24: `4`,
|
sources.Q_fl24: `4`,
|
||||||
|
|
||||||
|
sources.Q_master: `5`,
|
||||||
|
}
|
||||||
|
// qualitysReverse = map[string]string {
|
||||||
|
// `000009`: sources.Q_128k,
|
||||||
|
// `020010`: sources.Q_320k,
|
||||||
|
// `011002`: sources.Q_flac,
|
||||||
|
// `011005`: sources.Q_fl24,
|
||||||
|
// }
|
||||||
|
mgheader = map[string]string{
|
||||||
|
`Origin`: `https://m.music.migu.cn`,
|
||||||
|
`Referer`: `https://m.music.migu.cn/v4/`,
|
||||||
|
`By`: ``,
|
||||||
|
`channel`: ``,
|
||||||
|
`Cookie`: ``,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -1,13 +1,19 @@
|
|||||||
package tx
|
package tx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/gob"
|
||||||
"lx-source/src/env"
|
"lx-source/src/env"
|
||||||
|
"lx-source/src/sources"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ZxwyWebSite/ztool"
|
"github.com/ZxwyWebSite/ztool"
|
||||||
"github.com/ZxwyWebSite/ztool/x/bytesconv"
|
"github.com/ZxwyWebSite/ztool/x/bytesconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
gob.Register(musicInfo{})
|
||||||
|
}
|
||||||
|
|
||||||
func getMusicInfo(songMid string) (infoBody musicInfo, emsg string) {
|
func getMusicInfo(songMid string) (infoBody musicInfo, emsg string) {
|
||||||
cquery := strings.Join([]string{`tx`, songMid, `info`}, `/`)
|
cquery := strings.Join([]string{`tx`, songMid, `info`}, `/`)
|
||||||
if cdata, ok := env.Cache.Get(cquery); ok {
|
if cdata, ok := env.Cache.Get(cquery); ok {
|
||||||
@ -37,6 +43,6 @@ func getMusicInfo(songMid string) (infoBody musicInfo, emsg string) {
|
|||||||
return //nil, `获取音乐信息失败`
|
return //nil, `获取音乐信息失败`
|
||||||
}
|
}
|
||||||
infoBody = infoResp.Req.Data
|
infoBody = infoResp.Req.Data
|
||||||
env.Cache.Set(cquery, infoBody, 7200)
|
env.Cache.Set(cquery, infoBody, sources.C_lx)
|
||||||
return //infoBody.Req.Data, ``
|
return //infoBody.Req.Data, ``
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,8 @@ import (
|
|||||||
返回结果
|
返回结果
|
||||||
更新:
|
更新:
|
||||||
可通过 goto loop 实现,但可能会导致逻辑混乱 (想使用账号获取正常链接却返回试听链接)
|
可通过 goto loop 实现,但可能会导致逻辑混乱 (想使用账号获取正常链接却返回试听链接)
|
||||||
|
2024-03-16:
|
||||||
|
正常获取->128k获取->试听获取
|
||||||
*/
|
*/
|
||||||
|
|
||||||
func Url(songMid, quality string) (ourl, msg string) {
|
func Url(songMid, quality string) (ourl, msg string) {
|
||||||
@ -54,7 +56,12 @@ func Url(songMid, quality string) (ourl, msg string) {
|
|||||||
}
|
}
|
||||||
var strFileName string
|
var strFileName string
|
||||||
tryLink := infoBody.TrackInfo.Pay.PayPlay == 1 && /*uauthst == ``&&*/ !env.Config.Custom.Tx_Enable
|
tryLink := infoBody.TrackInfo.Pay.PayPlay == 1 && /*uauthst == ``&&*/ !env.Config.Custom.Tx_Enable
|
||||||
|
Loop:
|
||||||
if tryLink {
|
if tryLink {
|
||||||
|
if infoBody.TrackInfo.Vs[0] == `` {
|
||||||
|
msg = sources.ErrNoLink
|
||||||
|
return
|
||||||
|
}
|
||||||
strFileName = ztool.Str_FastConcat(`RS02`, infoBody.TrackInfo.Vs[0], `.`, sources.X_mp3)
|
strFileName = ztool.Str_FastConcat(`RS02`, infoBody.TrackInfo.Vs[0], `.`, sources.X_mp3)
|
||||||
} else {
|
} else {
|
||||||
strFileName = ztool.Str_FastConcat(infoFile.H, infoBody.TrackInfo.File.MediaMid, `.`, infoFile.E)
|
strFileName = ztool.Str_FastConcat(infoFile.H, infoBody.TrackInfo.File.MediaMid, `.`, infoFile.E)
|
||||||
@ -92,6 +99,16 @@ func Url(songMid, quality string) (ourl, msg string) {
|
|||||||
}
|
}
|
||||||
infoData := infoResp.Req0.Data.Midurlinfo[0]
|
infoData := infoResp.Req0.Data.Midurlinfo[0]
|
||||||
if infoData.Purl == `` {
|
if infoData.Purl == `` {
|
||||||
|
if env.Config.Source.ForceFallback && !tryLink {
|
||||||
|
if quality != sources.Q_128k && infoBody.TrackInfo.Pay.PayPlay == 0 {
|
||||||
|
msg = `Fallback to 128k`
|
||||||
|
infoFile = fileInfo[sources.Q_128k]
|
||||||
|
} else {
|
||||||
|
msg = `Fallbacked`
|
||||||
|
tryLink = true
|
||||||
|
}
|
||||||
|
goto Loop
|
||||||
|
}
|
||||||
msg = sources.E_NoLink //`无法获取音乐链接`
|
msg = sources.E_NoLink //`无法获取音乐链接`
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -102,8 +119,10 @@ func Url(songMid, quality string) (ourl, msg string) {
|
|||||||
// }
|
// }
|
||||||
if realQuality != infoFile.H && !tryLink {
|
if realQuality != infoFile.H && !tryLink {
|
||||||
msg = sources.E_QNotMatch
|
msg = sources.E_QNotMatch
|
||||||
|
if !env.Config.Source.ForceFallback {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ourl = ztool.Str_FastConcat(`https://ws.stream.qqmusic.qq.com/`, infoData.Purl)
|
}
|
||||||
|
ourl = `https://ws.stream.qqmusic.qq.com/` + infoData.Purl
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"lx-source/src/env"
|
"lx-source/src/env"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/ZxwyWebSite/ztool"
|
"github.com/ZxwyWebSite/ztool"
|
||||||
"github.com/ZxwyWebSite/ztool/logs"
|
"github.com/ZxwyWebSite/ztool/logs"
|
||||||
@ -129,7 +130,9 @@ func refresh(loger *logs.Logger, now int64) error {
|
|||||||
loger.Info(`刷新登录成功`)
|
loger.Info(`刷新登录成功`)
|
||||||
env.Config.Custom.Tx_Uuin = resp.Req1.Data.StrMusicId
|
env.Config.Custom.Tx_Uuin = resp.Req1.Data.StrMusicId
|
||||||
env.Config.Custom.Tx_Ukey = resp.Req1.Data.MusicKey
|
env.Config.Custom.Tx_Ukey = resp.Req1.Data.MusicKey
|
||||||
env.Config.Custom.Tx_Refresh_Interval = now + 432000 //(每5天刷新一次) //1209600 - 86000 // 14天提前一天
|
tnow := time.Now()
|
||||||
|
env.Config.Custom.Tx_Refresh_Interval = time.Date(tnow.Year(), tnow.Month(), tnow.Day()+5, 0, 0, 0, 0, tnow.Location()).Unix()
|
||||||
|
// env.Config.Custom.Tx_Refresh_Interval = now + 432000 //(每5天刷新一次) //1209600 - 86000 // 14天提前一天
|
||||||
loger.Debug(`Resp: %+v`, resp)
|
loger.Debug(`Resp: %+v`, resp)
|
||||||
loger.Debug(`Uuin: %v, Ukey: %v`, resp.Req1.Data.StrMusicId, resp.Req1.Data.MusicKey)
|
loger.Debug(`Uuin: %v, Ukey: %v`, resp.Req1.Data.StrMusicId, resp.Req1.Data.MusicKey)
|
||||||
loger.Debug(`ExpiresAt: %v, Real: %v`, resp.Req1.Data.ExpiredAt, env.Config.Custom.Tx_Refresh_Interval)
|
loger.Debug(`ExpiresAt: %v, Real: %v`, resp.Req1.Data.ExpiredAt, env.Config.Custom.Tx_Refresh_Interval)
|
||||||
|
@ -74,173 +74,173 @@ type musicInfo struct {
|
|||||||
// Wikiurl string `json:"wikiurl"`
|
// Wikiurl string `json:"wikiurl"`
|
||||||
// } `json:"extras"`
|
// } `json:"extras"`
|
||||||
TrackInfo struct {
|
TrackInfo struct {
|
||||||
ID int `json:"id"`
|
// ID int `json:"id"`
|
||||||
Type int `json:"type"`
|
// Type int `json:"type"`
|
||||||
Mid string `json:"mid"`
|
// Mid string `json:"mid"`
|
||||||
Name string `json:"name"`
|
// Name string `json:"name"`
|
||||||
Title string `json:"title"`
|
// Title string `json:"title"`
|
||||||
Subtitle string `json:"subtitle"`
|
// Subtitle string `json:"subtitle"`
|
||||||
Singer []struct {
|
// Singer []struct {
|
||||||
ID int `json:"id"`
|
// ID int `json:"id"`
|
||||||
Mid string `json:"mid"`
|
// Mid string `json:"mid"`
|
||||||
Name string `json:"name"`
|
// Name string `json:"name"`
|
||||||
Title string `json:"title"`
|
// Title string `json:"title"`
|
||||||
Type int `json:"type"`
|
// Type int `json:"type"`
|
||||||
Uin int `json:"uin"`
|
// Uin int `json:"uin"`
|
||||||
} `json:"singer"`
|
// } `json:"singer"`
|
||||||
Album struct {
|
// Album struct {
|
||||||
ID int `json:"id"`
|
// ID int `json:"id"`
|
||||||
Mid string `json:"mid"`
|
// Mid string `json:"mid"`
|
||||||
Name string `json:"name"`
|
// Name string `json:"name"`
|
||||||
Title string `json:"title"`
|
// Title string `json:"title"`
|
||||||
Subtitle string `json:"subtitle"`
|
// Subtitle string `json:"subtitle"`
|
||||||
TimePublic string `json:"time_public"`
|
// TimePublic string `json:"time_public"`
|
||||||
Pmid string `json:"pmid"`
|
// Pmid string `json:"pmid"`
|
||||||
} `json:"album"`
|
// } `json:"album"`
|
||||||
Mv struct {
|
// Mv struct {
|
||||||
ID int `json:"id"`
|
// ID int `json:"id"`
|
||||||
Vid string `json:"vid"`
|
// Vid string `json:"vid"`
|
||||||
Name string `json:"name"`
|
// Name string `json:"name"`
|
||||||
Title string `json:"title"`
|
// Title string `json:"title"`
|
||||||
Vt int `json:"vt"`
|
// Vt int `json:"vt"`
|
||||||
} `json:"mv"`
|
// } `json:"mv"`
|
||||||
Interval int `json:"interval"`
|
// Interval int `json:"interval"`
|
||||||
Isonly int `json:"isonly"`
|
// Isonly int `json:"isonly"`
|
||||||
Language int `json:"language"`
|
// Language int `json:"language"`
|
||||||
Genre int `json:"genre"`
|
// Genre int `json:"genre"`
|
||||||
IndexCd int `json:"index_cd"`
|
// IndexCd int `json:"index_cd"`
|
||||||
IndexAlbum int `json:"index_album"`
|
// IndexAlbum int `json:"index_album"`
|
||||||
TimePublic string `json:"time_public"`
|
// TimePublic string `json:"time_public"`
|
||||||
Status int `json:"status"`
|
// Status int `json:"status"`
|
||||||
Fnote int `json:"fnote"`
|
// Fnote int `json:"fnote"`
|
||||||
File struct {
|
File struct {
|
||||||
MediaMid string `json:"media_mid"`
|
MediaMid string `json:"media_mid"`
|
||||||
Size24Aac int `json:"size_24aac"`
|
// Size24Aac int `json:"size_24aac"`
|
||||||
Size48Aac int `json:"size_48aac"`
|
// Size48Aac int `json:"size_48aac"`
|
||||||
Size96Aac int `json:"size_96aac"`
|
// Size96Aac int `json:"size_96aac"`
|
||||||
Size192Ogg int `json:"size_192ogg"`
|
// Size192Ogg int `json:"size_192ogg"`
|
||||||
Size192Aac int `json:"size_192aac"`
|
// Size192Aac int `json:"size_192aac"`
|
||||||
Size128Mp3 int `json:"size_128mp3"`
|
// Size128Mp3 int `json:"size_128mp3"`
|
||||||
Size320Mp3 int `json:"size_320mp3"`
|
// Size320Mp3 int `json:"size_320mp3"`
|
||||||
SizeApe int `json:"size_ape"`
|
// SizeApe int `json:"size_ape"`
|
||||||
SizeFlac int `json:"size_flac"`
|
// SizeFlac int `json:"size_flac"`
|
||||||
SizeDts int `json:"size_dts"`
|
// SizeDts int `json:"size_dts"`
|
||||||
SizeTry int `json:"size_try"`
|
// SizeTry int `json:"size_try"`
|
||||||
TryBegin int `json:"try_begin"`
|
// TryBegin int `json:"try_begin"`
|
||||||
TryEnd int `json:"try_end"`
|
// TryEnd int `json:"try_end"`
|
||||||
URL string `json:"url"`
|
// URL string `json:"url"`
|
||||||
SizeHires int `json:"size_hires"`
|
// SizeHires int `json:"size_hires"`
|
||||||
HiresSample int `json:"hires_sample"`
|
// HiresSample int `json:"hires_sample"`
|
||||||
HiresBitdepth int `json:"hires_bitdepth"`
|
// HiresBitdepth int `json:"hires_bitdepth"`
|
||||||
B30S int `json:"b_30s"`
|
// B30S int `json:"b_30s"`
|
||||||
E30S int `json:"e_30s"`
|
// E30S int `json:"e_30s"`
|
||||||
Size96Ogg int `json:"size_96ogg"`
|
// Size96Ogg int `json:"size_96ogg"`
|
||||||
Size360Ra []interface{} `json:"size_360ra"`
|
// Size360Ra []interface{} `json:"size_360ra"`
|
||||||
SizeDolby int `json:"size_dolby"`
|
// SizeDolby int `json:"size_dolby"`
|
||||||
SizeNew []int `json:"size_new"`
|
// SizeNew []int `json:"size_new"`
|
||||||
} `json:"file"`
|
} `json:"file"`
|
||||||
Pay struct {
|
Pay struct {
|
||||||
PayMonth int `json:"pay_month"`
|
// PayMonth int `json:"pay_month"`
|
||||||
PriceTrack int `json:"price_track"`
|
// PriceTrack int `json:"price_track"`
|
||||||
PriceAlbum int `json:"price_album"`
|
// PriceAlbum int `json:"price_album"`
|
||||||
PayPlay int `json:"pay_play"`
|
PayPlay int `json:"pay_play"`
|
||||||
PayDown int `json:"pay_down"`
|
// PayDown int `json:"pay_down"`
|
||||||
PayStatus int `json:"pay_status"`
|
// PayStatus int `json:"pay_status"`
|
||||||
TimeFree int `json:"time_free"`
|
// TimeFree int `json:"time_free"`
|
||||||
} `json:"pay"`
|
} `json:"pay"`
|
||||||
Action struct {
|
// Action struct {
|
||||||
Switch int `json:"switch"`
|
// Switch int `json:"switch"`
|
||||||
Msgid int `json:"msgid"`
|
// Msgid int `json:"msgid"`
|
||||||
Alert int `json:"alert"`
|
// Alert int `json:"alert"`
|
||||||
Icons int `json:"icons"`
|
// Icons int `json:"icons"`
|
||||||
Msgshare int `json:"msgshare"`
|
// Msgshare int `json:"msgshare"`
|
||||||
Msgfav int `json:"msgfav"`
|
// Msgfav int `json:"msgfav"`
|
||||||
Msgdown int `json:"msgdown"`
|
// Msgdown int `json:"msgdown"`
|
||||||
Msgpay int `json:"msgpay"`
|
// Msgpay int `json:"msgpay"`
|
||||||
Switch2 int `json:"switch2"`
|
// Switch2 int `json:"switch2"`
|
||||||
Icon2 int `json:"icon2"`
|
// Icon2 int `json:"icon2"`
|
||||||
} `json:"action"`
|
// } `json:"action"`
|
||||||
Ksong struct {
|
// Ksong struct {
|
||||||
ID int `json:"id"`
|
// ID int `json:"id"`
|
||||||
Mid string `json:"mid"`
|
// Mid string `json:"mid"`
|
||||||
} `json:"ksong"`
|
// } `json:"ksong"`
|
||||||
Volume struct {
|
// Volume struct {
|
||||||
Gain float64 `json:"gain"`
|
// Gain float64 `json:"gain"`
|
||||||
Peak float64 `json:"peak"`
|
// Peak float64 `json:"peak"`
|
||||||
Lra float64 `json:"lra"`
|
// Lra float64 `json:"lra"`
|
||||||
} `json:"volume"`
|
// } `json:"volume"`
|
||||||
Label string `json:"label"`
|
// Label string `json:"label"`
|
||||||
URL string `json:"url"`
|
// URL string `json:"url"`
|
||||||
Bpm int `json:"bpm"`
|
// Bpm int `json:"bpm"`
|
||||||
Version int `json:"version"`
|
// Version int `json:"version"`
|
||||||
Trace string `json:"trace"`
|
// Trace string `json:"trace"`
|
||||||
DataType int `json:"data_type"`
|
// DataType int `json:"data_type"`
|
||||||
ModifyStamp int `json:"modify_stamp"`
|
// ModifyStamp int `json:"modify_stamp"`
|
||||||
Pingpong string `json:"pingpong"`
|
// Pingpong string `json:"pingpong"`
|
||||||
Ppurl string `json:"ppurl"`
|
// Ppurl string `json:"ppurl"`
|
||||||
Tid int `json:"tid"`
|
// Tid int `json:"tid"`
|
||||||
Ov int `json:"ov"`
|
// Ov int `json:"ov"`
|
||||||
Sa int `json:"sa"`
|
// Sa int `json:"sa"`
|
||||||
Es string `json:"es"`
|
// Es string `json:"es"`
|
||||||
Vs []string `json:"vs"`
|
Vs []string `json:"vs"`
|
||||||
Vi []int `json:"vi"`
|
// Vi []int `json:"vi"`
|
||||||
Ktag string `json:"ktag"`
|
// Ktag string `json:"ktag"`
|
||||||
Vf []float64 `json:"vf"`
|
// Vf []float64 `json:"vf"`
|
||||||
} `json:"track_info"`
|
} `json:"track_info"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type playInfo struct {
|
type playInfo struct {
|
||||||
Code int `json:"code"`
|
// Code int `json:"code"`
|
||||||
Data struct {
|
Data struct {
|
||||||
Uin string `json:"uin"`
|
// Uin string `json:"uin"`
|
||||||
Retcode int `json:"retcode"`
|
// Retcode int `json:"retcode"`
|
||||||
VerifyType int `json:"verify_type"`
|
// VerifyType int `json:"verify_type"`
|
||||||
LoginKey string `json:"login_key"`
|
// LoginKey string `json:"login_key"`
|
||||||
Msg string `json:"msg"`
|
// Msg string `json:"msg"`
|
||||||
Sip []string `json:"sip"`
|
// Sip []string `json:"sip"`
|
||||||
Thirdip []string `json:"thirdip"`
|
// Thirdip []string `json:"thirdip"`
|
||||||
Testfile2G string `json:"testfile2g"`
|
// Testfile2G string `json:"testfile2g"`
|
||||||
Testfilewifi string `json:"testfilewifi"`
|
// Testfilewifi string `json:"testfilewifi"`
|
||||||
Midurlinfo []struct {
|
Midurlinfo []struct {
|
||||||
Songmid string `json:"songmid"`
|
// Songmid string `json:"songmid"`
|
||||||
Filename string `json:"filename"`
|
Filename string `json:"filename"`
|
||||||
Purl string `json:"purl"`
|
Purl string `json:"purl"`
|
||||||
Errtype string `json:"errtype"`
|
// Errtype string `json:"errtype"`
|
||||||
P2Pfromtag int `json:"p2pfromtag"`
|
// P2Pfromtag int `json:"p2pfromtag"`
|
||||||
Qmdlfromtag int `json:"qmdlfromtag"`
|
// Qmdlfromtag int `json:"qmdlfromtag"`
|
||||||
CommonDownfromtag int `json:"common_downfromtag"`
|
// CommonDownfromtag int `json:"common_downfromtag"`
|
||||||
VipDownfromtag int `json:"vip_downfromtag"`
|
// VipDownfromtag int `json:"vip_downfromtag"`
|
||||||
Pdl int `json:"pdl"`
|
// Pdl int `json:"pdl"`
|
||||||
Premain int `json:"premain"`
|
// Premain int `json:"premain"`
|
||||||
Hisdown int `json:"hisdown"`
|
// Hisdown int `json:"hisdown"`
|
||||||
Hisbuy int `json:"hisbuy"`
|
// Hisbuy int `json:"hisbuy"`
|
||||||
UIAlert int `json:"uiAlert"`
|
// UIAlert int `json:"uiAlert"`
|
||||||
Isbuy int `json:"isbuy"`
|
// Isbuy int `json:"isbuy"`
|
||||||
Pneedbuy int `json:"pneedbuy"`
|
// Pneedbuy int `json:"pneedbuy"`
|
||||||
Pneed int `json:"pneed"`
|
// Pneed int `json:"pneed"`
|
||||||
Isonly int `json:"isonly"`
|
// Isonly int `json:"isonly"`
|
||||||
Onecan int `json:"onecan"`
|
// Onecan int `json:"onecan"`
|
||||||
Result int `json:"result"`
|
// Result int `json:"result"`
|
||||||
Tips string `json:"tips"`
|
// Tips string `json:"tips"`
|
||||||
Opi48Kurl string `json:"opi48kurl"`
|
// Opi48Kurl string `json:"opi48kurl"`
|
||||||
Opi96Kurl string `json:"opi96kurl"`
|
// Opi96Kurl string `json:"opi96kurl"`
|
||||||
Opi192Kurl string `json:"opi192kurl"`
|
// Opi192Kurl string `json:"opi192kurl"`
|
||||||
Opiflackurl string `json:"opiflackurl"`
|
// Opiflackurl string `json:"opiflackurl"`
|
||||||
Opi128Kurl string `json:"opi128kurl"`
|
// Opi128Kurl string `json:"opi128kurl"`
|
||||||
Opi192Koggurl string `json:"opi192koggurl"`
|
// Opi192Koggurl string `json:"opi192koggurl"`
|
||||||
Wififromtag string `json:"wififromtag"`
|
// Wififromtag string `json:"wififromtag"`
|
||||||
Flowfromtag string `json:"flowfromtag"`
|
// Flowfromtag string `json:"flowfromtag"`
|
||||||
Wifiurl string `json:"wifiurl"`
|
// Wifiurl string `json:"wifiurl"`
|
||||||
Flowurl string `json:"flowurl"`
|
// Flowurl string `json:"flowurl"`
|
||||||
Vkey string `json:"vkey"`
|
// Vkey string `json:"vkey"`
|
||||||
Opi30Surl string `json:"opi30surl"`
|
// Opi30Surl string `json:"opi30surl"`
|
||||||
Ekey string `json:"ekey"`
|
// Ekey string `json:"ekey"`
|
||||||
AuthSwitch int `json:"auth_switch"`
|
// AuthSwitch int `json:"auth_switch"`
|
||||||
Subcode int `json:"subcode"`
|
// Subcode int `json:"subcode"`
|
||||||
Opi96Koggurl string `json:"opi96koggurl"`
|
// Opi96Koggurl string `json:"opi96koggurl"`
|
||||||
AuthSwitch2 int `json:"auth_switch2"`
|
// AuthSwitch2 int `json:"auth_switch2"`
|
||||||
} `json:"midurlinfo"`
|
} `json:"midurlinfo"`
|
||||||
Servercheck string `json:"servercheck"`
|
// Servercheck string `json:"servercheck"`
|
||||||
Expiration int `json:"expiration"`
|
// Expiration int `json:"expiration"`
|
||||||
} `json:"data"`
|
} `json:"data"`
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"lx-source/src/env"
|
"lx-source/src/env"
|
||||||
wy "lx-source/src/sources/custom/wy/modules"
|
wy "lx-source/src/sources/custom/wy/modules"
|
||||||
"maps"
|
"maps"
|
||||||
|
"time"
|
||||||
|
|
||||||
// "time"
|
// "time"
|
||||||
|
|
||||||
@ -59,7 +60,9 @@ func refresh(loger *logs.Logger, now int64) error {
|
|||||||
// env.Config.Custom.Wy_Refresh_Interval = now + 86000
|
// env.Config.Custom.Wy_Refresh_Interval = now + 86000
|
||||||
// loger.Debug(`MUSIC_U 不变, 1天 后 继续执行`) //`未发现有效结果,将在下次检测时再次尝试`
|
// loger.Debug(`MUSIC_U 不变, 1天 后 继续执行`) //`未发现有效结果,将在下次检测时再次尝试`
|
||||||
// }
|
// }
|
||||||
env.Config.Custom.Wy_Refresh_Interval = now + 86000
|
tnow := time.Now()
|
||||||
|
env.Config.Custom.Wy_Refresh_Interval = time.Date(tnow.Year(), tnow.Month(), tnow.Day()+1, 0, 0, 0, 0, tnow.Location()).Unix()
|
||||||
|
// env.Config.Custom.Wy_Refresh_Interval = now + 86000
|
||||||
err = env.Cfg.Save(``)
|
err = env.Cfg.Save(``)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
loger.Info(`配置更新成功`)
|
loger.Info(`配置更新成功`)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package sources
|
package sources
|
||||||
|
|
||||||
import (
|
// import (
|
||||||
"lx-source/src/caches"
|
// "lx-source/src/caches"
|
||||||
)
|
// )
|
||||||
|
|
||||||
// var Loger = env.Loger.NewGroup(`Sources`) // JieXiApis
|
// var Loger = env.Loger.NewGroup(`Sources`) // JieXiApis
|
||||||
|
|
||||||
@ -71,18 +71,18 @@ var (
|
|||||||
验证部分放到GetLink里
|
验证部分放到GetLink里
|
||||||
|
|
||||||
*/
|
*/
|
||||||
type Source interface {
|
// type Source interface {
|
||||||
Verify(*caches.Query) (string, bool) // 验证是否可用 <查询参数> <rquery,ok>
|
// Verify(*caches.Query) (string, bool) // 验证是否可用 <查询参数> <rquery,ok>
|
||||||
GetLink(*caches.Query) (string, string) // 查询获取链接 <查询参数> <链接,信息>
|
// GetLink(*caches.Query) (string, string) // 查询获取链接 <查询参数> <链接,信息>
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 默认空接口
|
// 默认空接口
|
||||||
type NullSource struct{}
|
// type NullSource struct{}
|
||||||
|
|
||||||
func (*NullSource) Verify(*caches.Query) (string, bool) { return ``, false }
|
// func (*NullSource) Verify(*caches.Query) (string, bool) { return ``, false }
|
||||||
func (*NullSource) GetLink(*caches.Query) (string, string) { return ``, `NullSource` }
|
// func (*NullSource) GetLink(*caches.Query) (string, string) { return ``, `NullSource` }
|
||||||
|
|
||||||
var UseSource Source = &NullSource{} // = &builtin.Source{}
|
// var UseSource Source = &NullSource{} // = &builtin.Source{}
|
||||||
|
|
||||||
// 统一错误
|
// 统一错误
|
||||||
// type (
|
// type (
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//go:build extapp
|
||||||
|
|
||||||
package sources
|
package sources
|
||||||
|
|
||||||
// MusicFree 数据结构
|
// MusicFree 数据结构
|
||||||
|
19
update.md
19
update.md
@ -3,6 +3,25 @@
|
|||||||
<!-- #### \# 2024-02-14 v1.0.3-rel (release)
|
<!-- #### \# 2024-02-14 v1.0.3-rel (release)
|
||||||
+ **停止更新:感谢这三个月的陪伴,现因无力维护,停止后续更新,发布最后版本,大家有缘再见** -->
|
+ **停止更新:感谢这三个月的陪伴,现因无力维护,停止后续更新,发布最后版本,大家有缘再见** -->
|
||||||
|
|
||||||
|
#### \# 2024-03-16 v1.0.3-rc2 (dev)
|
||||||
|
+ Mg源新增接口,无需登录账号(二次查询,速度较慢)
|
||||||
|
+ 清理部分结构体未使用字段
|
||||||
|
+ Tx源支持音质Fallback
|
||||||
|
+ Kg源Lite签到重试
|
||||||
|
<!-- + 移除Wy源内置接口(上游停止服务) -->
|
||||||
|
|
||||||
|
#### \# 2024-03-08 v1.0.3-rc2 (dev)
|
||||||
|
+ 完善音质验证部分
|
||||||
|
+ 刷新登录更新时间统一为指定日期0时0秒
|
||||||
|
<!-- + Mg源支持网页版接口 -->
|
||||||
|
|
||||||
|
#### \# 2024-02-22 v1.0.3-rc2 (dev)
|
||||||
|
+ 清理无用代码,删除旧版Router
|
||||||
|
+ 支持将内存缓存写入文件,重启程序不丢数据
|
||||||
|
+ 优化计划任务逻辑: 发生错误不更新下次执行时间,以便在下次检测时重试
|
||||||
|
+ **注:开学在即,项目暂缓更新**
|
||||||
|
<!-- + 引入GORM和SQLite驱动 (支持不开cgo编译,但可能会导致数据库性能下降) -->
|
||||||
|
|
||||||
#### \# 2024-02-22 v1.0.3-rc1 (dev)
|
#### \# 2024-02-22 v1.0.3-rc1 (dev)
|
||||||
+ 修复wy源sky音质获取,增加更高音质常量
|
+ 修复wy源sky音质获取,增加更高音质常量
|
||||||
+ (dolby->高清环绕, sky->沉浸环绕, master->超清母带)
|
+ (dolby->高清环绕, sky->沉浸环绕, master->超清母带)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user