From 25353190054b8e3605f4c318f0bc0d2cd81c8a7b Mon Sep 17 00:00:00 2001 From: ZxwyWebSite Date: Sat, 23 Dec 2023 03:58:34 +0800 Subject: [PATCH] 2023-12-22 v1.0.2-b0.4 --- .gitignore | 2 +- src/caches/cache.go | 29 ++++-- src/caches/localcache/local.go | 3 +- src/env/env.go | 2 +- src/middleware/auth/auth.go | 18 ++++ src/middleware/dynlink/dynlink.go | 26 ++++++ src/router/router.go | 13 ++- src/sources/builtin/driver.go | 118 ++++++++++++++++++++++++ src/sources/builtin/types.go | 147 ++++++++++++++++++++++++++++++ src/sources/source.go | 3 +- update.md | 15 +++ 11 files changed, 354 insertions(+), 22 deletions(-) create mode 100644 src/sources/builtin/driver.go create mode 100644 src/sources/builtin/types.go diff --git a/.gitignore b/.gitignore index 8904517..0a7efd3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ outdated/ # conf.ini test.go test_test.go -src/sources/builtin/ \ No newline at end of file +# src/sources/builtin/ \ No newline at end of file diff --git a/src/caches/cache.go b/src/caches/cache.go index f29693a..017a603 100644 --- a/src/caches/cache.go +++ b/src/caches/cache.go @@ -1,7 +1,7 @@ package caches import ( - "lx-source/src/env" + "sync" "github.com/ZxwyWebSite/ztool" ) @@ -39,13 +39,16 @@ func (*Nullcache) Stat() bool { return false } func (*Nullcache) Init() error { return nil } var ( - Loger = env.Loger.NewGroup(`Caches`) - + // Loger = env.Loger.NewGroup(`Caches`) UseCache Cache = &Nullcache{} - // ErrNotInited = errors.New(`缓存策略未初始化`) + query_pool = sync.Pool{New: func() any { return new(Query) }} ) +// 对象池相关 (注:结构体释放时一定要清理未导出字段) +func newQuery() *Query { return query_pool.Get().(*Query) } +func (c *Query) Free() { c.query = ``; query_pool.Put(c) } + // 根据音质判断文件后缀 func rext(q string) string { if q == `128k` || q == `320k` { @@ -56,12 +59,18 @@ func rext(q string) string { // 生成查询参数 (必须使用此函数初始化) func NewQuery(s, id, q string) *Query { - return &Query{ - Source: s, - MusicID: id, - Quality: q, - Extname: rext(q), - } + out := newQuery() + out.Source = s + out.MusicID = id + out.Quality = q + out.Extname = rext(q) + return out + // return &Query{ + // Source: s, + // MusicID: id, + // Quality: q, + // Extname: rext(q), + // } } // 获取旧版查询字符串 diff --git a/src/caches/localcache/local.go b/src/caches/localcache/local.go index ae9815c..3b2eba8 100644 --- a/src/caches/localcache/local.go +++ b/src/caches/localcache/local.go @@ -3,6 +3,7 @@ package localcache import ( "errors" "lx-source/src/caches" + "lx-source/src/env" "net/url" "os" "strings" @@ -16,7 +17,7 @@ type Cache struct { state bool // 激活状态 } -var loger = caches.Loger.AppGroup(`local`) +var loger = env.Loger.NewGroup(`Caches`) //caches.Loger.AppGroup(`local`) func (c *Cache) getLink(q string) string { return ztool.Str_FastConcat(c.Bind, `/file/`, q) // c.Addr + `file/` + q diff --git a/src/env/env.go b/src/env/env.go index d49dca2..3e05a0a 100644 --- a/src/env/env.go +++ b/src/env/env.go @@ -9,7 +9,7 @@ import ( ) const ( - Version = `1.0.2-β0.3` + Version = `1.0.2-β0.4` ) var ( diff --git a/src/middleware/auth/auth.go b/src/middleware/auth/auth.go index f78d7ca..c267438 100644 --- a/src/middleware/auth/auth.go +++ b/src/middleware/auth/auth.go @@ -8,6 +8,24 @@ import ( "github.com/gin-gonic/gin" ) +func InitHandler(h gin.HandlerFunc) (out []gin.HandlerFunc) { + loger := env.Loger.NewGroup(`AuthHandler`) + // ApiKey + if env.Config.Auth.ApiKey_Enable { + loger.Debug(`ApiKeyAuth Enabled`) + out = append(out, func(c *gin.Context) { + resp.Wrap(c, func() *resp.Resp { + if auth := c.Request.Header.Get(`X-LxM-Auth`); auth != env.Config.Auth.ApiKey_Value { + loger.Debug(`验证失败: %q`, auth) + return &resp.Resp{Code: 3, Msg: `验证Key失败, 请联系网站管理员`} + } + return nil + }) + }) + } + return append(out, h) +} + // 请求验证 func AuthHandler(c *gin.Context) { loger := env.Loger.NewGroup(`AuthHandler`) diff --git a/src/middleware/dynlink/dynlink.go b/src/middleware/dynlink/dynlink.go index c616d06..2ba6b14 100644 --- a/src/middleware/dynlink/dynlink.go +++ b/src/middleware/dynlink/dynlink.go @@ -26,6 +26,32 @@ func LoadHandler(r *gin.Engine) { // 动态链暂未完成... } +// Doc 动态链 +/* + 0. 链接格式 + - (Mode: 链接模式 0:本地/1:远程, Link: 真实链接), id(uint32 4294967295) + - yyyymmdd/unixsecond/hex(:s/:id/:q).format(flac24bit->fl24) + 1. 传入参数 (得到音乐链接后生成随机链并写入缓存) + + Data1 查询缓存 + - key: "lx/0000000001/320k" + - val: "`{cache.Path}/file/`20231221/1703176257/6c782f303030303030303030312f3332306b.mp3" + + Data2 直链缓存 + - key: "20231221/1703176257/6c782f303030303030303030312f3332306b.mp3" + - val: "&DynLink{Mode: 0, Link: 'cache/lx/0000000001/320k'}" + 2. 查询缓存 + - key: "20231221/1703176257/6c782f303030303030303030312f3332306b.mp3" + - val: "&DynLink{Mode: 0, Link: 'cache/lx/0000000001/320k'}" + - va2: "&DynLink{Mode: 1, Link: 'http://127.0.0.1/file/lx/0000000001/320k.mp3'}" + 3. 实际数据 (访问 /file/:t/:x/:f) + + if Mode==0 本地数据直接发送 + - c.File(Link) + + if Mode==1 远程数据302跳转 + - c.Redirect(Link) + + 0. 实现思路 + +*/ + // func FileHandler() gin.HandlerFunc { // loger := env.Loger.NewGroup(`DynLink`) // // 为了兼容原静态链,必须设置3个参数 diff --git a/src/router/router.go b/src/router/router.go index 36ca1e6..89b1161 100644 --- a/src/router/router.go +++ b/src/router/router.go @@ -52,7 +52,7 @@ func InitRouter() *gin.Engine { // r.StaticFile(`/favicon.ico`, `public/icon.ico`) // r.StaticFile(`/lx-custom-source.js`, `public/lx-custom-source.js`) // 解析接口 - r.GET(`/link/:s/:id/:q`, auth.AuthHandler, linkHandler) + r.GET(`/link/:s/:id/:q`, auth.InitHandler(linkHandler)...) dynlink.LoadHandler(r) // r.GET(`/file/:t/:x/:f`, dynlink.FileHandler()) // if cache, ok := caches.UseCache.(*localcache.Cache); ok { @@ -86,21 +86,18 @@ const ( func linkHandler(c *gin.Context) { resp.Wrap(c, func() *resp.Resp { // 获取传入参数 检查合法性 - // parmlen := len(c.Params) - // parms := make(map[string]string, parmlen) - // for i := 0; i < parmlen; i++ { - // parms[c.Params[i].Key] = c.Params[i].Value - // } parms := util.ParaMap(c) // 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 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 env.Loger.NewGroup(`LinkQuery`).Debug(`s: %v, id: %v, q: %v`, s, id, q) - if ztool.Chk_IsNil(s, q, id) { + if ztool.Chk_IsNilStr(s, q, id) { return &resp.Resp{Code: 6, Msg: `参数不全`} // http.StatusBadRequest } cquery := caches.NewQuery(s, id, q) + // 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: `不支持的平台或音质`} @@ -110,6 +107,7 @@ func linkHandler(c *gin.Context) { clink, ok := env.Cache.Get(cquery.Query()) if ok { if str, ok := clink.(string); ok { + env.Loger.NewGroup(`MemCache`).Debug(`MemHIT [%q]=>[%q]`, cquery.Query(), str) if str == `` { return &resp.Resp{Code: 2, Msg: `MemCache Reject`} // 拒绝请求,当前一段时间内解析出错 } @@ -149,6 +147,7 @@ func linkHandler(c *gin.Context) { } } // 无法获取直链 直接返回原链接 + env.Cache.Set(cquery.Query(), outlink, 1200) return &resp.Resp{Msg: CacheMISS, Data: outlink} }) } diff --git a/src/sources/builtin/driver.go b/src/sources/builtin/driver.go new file mode 100644 index 0000000..1783ffe --- /dev/null +++ b/src/sources/builtin/driver.go @@ -0,0 +1,118 @@ +// 内置解析源 +package builtin + +import ( + "lx-source/src/caches" + "lx-source/src/env" + "lx-source/src/sources" + "net/http" + "strings" + "sync" + "time" + + "github.com/ZxwyWebSite/ztool" +) + +type Source struct{} + +// 预检 (兼容旧接口) +func (s *Source) Verify(c *caches.Query) (rquery string, ok bool) { + rquery, ok = qualitys[c.Quality][c.Source] + return +} + +var ( + // 并发对象池 (用户限制在Router处实现) + wy_pool = &sync.Pool{New: func() any { return new(FyApi_Song) }} + mg_pool = &sync.Pool{New: func() any { return new(MgApi_Song) }} + kw_pool = &sync.Pool{New: func() any { return new(KwApi_Song) }} +) + +// 查询 +func (s *Source) GetLink(c *caches.Query) (outlink string, msg string) { + rquery, ok := s.Verify(c) + if !ok { + msg = sources.Err_Verify //`Verify Failed` + return + } + // var outlink string + jx := env.Loger.NewGroup(`Sources`) //sources.Loger.AppGroup(`builtin`) //env.Loger.NewGroup(`JieXiApis`) + switch c.Source { + case s_wy: + resp := wy_pool.Get().(*FyApi_Song) + defer wy_pool.Put(resp) + + url := ztool.Str_FastConcat(`http://`, api_wy, `?id=`, c.MusicID, `&level=`, rquery, `&noCookie=true`) + // jx.Debug(`Wy, Url: %v`, url) + // wy源增加后端重试 默认3次 + for i := 0; true; i++ { + _, err := ztool.Net_HttpReq(http.MethodGet, url, nil, header_wy, &resp) + if err != nil { + jx.Error(`HttpReq, Err: %s, ReTry: %v`, err, i) + if i > 3 { + msg = err.Error() + 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.FreeTrialInfo != nil { + // jx.Error("发生错误, 返回数据:\n%#v", resp) + msg = `触发风控或专辑单独收费` + return + } + if data.Level != rquery { + msg = `实际音质不匹配` + return + } + // jx.Info(`WyLink, RealQuality: %v`, data.Level) + outlink = data.URL + case s_mg: + resp := mg_pool.Get().(*MgApi_Song) + defer mg_pool.Put(resp) + + url := ztool.Str_FastConcat(`https://`, api_mg, `?copyrightId=`, c.MusicID, `&type=`, rquery) + // jx.Debug(`Mg, Url: %v`, url) + _, err := ztool.Net_HttpReq(http.MethodGet, url, nil, header_mg, &resp) + if err != nil { + msg = err.Error() + return + } + jx.Debug(`Mg, Resp: %+v`, resp) + if link := resp.Data.PlayURL; link != `` { + outlink = `https:` + link + } // else { + // jx.Debug(`Mg, Err: %#v`, resp) + // } + case s_kw: + resp := kw_pool.Get().(*KwApi_Song) + defer kw_pool.Put(resp) + + url := ztool.Str_FastConcat(`https://`, api_kw, `/`, c.MusicID, `?isMv=0&format=`, c.Extname, `&br=`, rquery, c.Extname, `&level=`) + // jx.Debug(`Kw, Url: %s`, url) + _, err := ztool.Net_HttpReq(http.MethodGet, url, nil, header_kw, &resp) + if err != nil { + msg = err.Error() + return + } + jx.Debug(`Kw, Resp: %+v`, resp) + if resp.Code != 200 || resp.Data.AudioInfo.Bitrate == `1` { + // jx.Debug(`Kw, Err: %#v`, resp) + msg = ztool.Str_FastConcat(`failed: `, resp.Msg) + return + } + outlink = strings.Split(resp.Data.URL, `?`)[0] + default: + msg = `不支持的平台` + return + } + return +} diff --git a/src/sources/builtin/types.go b/src/sources/builtin/types.go new file mode 100644 index 0000000..9120313 --- /dev/null +++ b/src/sources/builtin/types.go @@ -0,0 +1,147 @@ +package builtin + +import "github.com/ZxwyWebSite/ztool" + +type ( + // 方格音乐接口 + FyApi_Song struct { + Code int `json:"code"` + 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"` + } + // 咪咕音乐接口 + 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"` + } +) + +const ( + // Source + s_wy = `wy` + s_mg = `mg` + s_kw = `kw` + // s_kg = `kg` + // s_tx = `tx` + // s_lx = `lx` +) + +var ( + // 音质列表 ( [通用音质][音乐平台]对应音质 ) + qualitys = map[string]map[string]string{ + `128k`: { + s_wy: `standard`, + s_mg: `1`, + s_kw: `128k`, + }, + `320k`: { + s_wy: `exhigh`, + s_mg: `2`, + s_kw: `320k`, + }, + `flac`: { + s_wy: `lossless`, + s_mg: `3`, + s_kw: `2000k`, + }, + `flac24bit`: { + s_wy: `hires`, + s_mg: `4`, + }, + `fl24`: { + s_wy: `hires`, + s_mg: `4`, + }, + } + // ApiAddr + api_wy string + api_mg string + api_kw string + // Headers + header_wy map[string]string + header_mg map[string]string + header_kw map[string]string +) + +func init() { + // InitBuiltInSource + var initdata = struct { + Api_Wy *string + Api_Mg *string + Api_Kw *string + Header_Wy *map[string]string + Header_Mg *map[string]string + Header_Kw *map[string]string + }{ + Api_Wy: &api_wy, + Api_Mg: &api_mg, + Api_Kw: &api_kw, + Header_Wy: &header_wy, + Header_Mg: &header_mg, + Header_Kw: &header_kw, + } + data := []byte{0x59, 0x7f, 0x3, 0x1, 0x2, 0xff, 0x80, 0x0, 0x1, 0x6, 0x1, 0x6, 0x41, 0x70, 0x69, 0x5f, 0x57, 0x79, 0x1, 0xc, 0x0, 0x1, 0x6, 0x41, 0x70, 0x69, 0x5f, 0x4d, 0x67, 0x1, 0xc, 0x0, 0x1, 0x6, 0x41, 0x70, 0x69, 0x5f, 0x4b, 0x77, 0x1, 0xc, 0x0, 0x1, 0x9, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x57, 0x79, 0x1, 0xff, 0x82, 0x0, 0x1, 0x9, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x4d, 0x67, 0x1, 0xff, 0x82, 0x0, 0x1, 0x9, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x4b, 0x77, 0x1, 0xff, 0x82, 0x0, 0x0, 0x0, 0x21, 0xff, 0x81, 0x4, 0x1, 0x1, 0x11, 0x6d, 0x61, 0x70, 0x5b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x1, 0xff, 0x82, 0x0, 0x1, 0xc, 0x1, 0xc, 0x0, 0x0, 0xfe, 0x4, 0xa, 0xff, 0x80, 0x1, 0x19, 0x6e, 0x6d, 0x2e, 0x66, 0x79, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x6f, 0x6e, 0x67, 0x2f, 0x75, 0x72, 0x6c, 0x2f, 0x76, 0x31, 0x1, 0x36, 0x6d, 0x2e, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x2e, 0x6d, 0x69, 0x67, 0x75, 0x2e, 0x63, 0x6e, 0x2f, 0x6d, 0x69, 0x67, 0x75, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x2f, 0x68, 0x35, 0x2f, 0x70, 0x6c, 0x61, 0x79, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x67, 0x65, 0x74, 0x53, 0x6f, 0x6e, 0x67, 0x50, 0x6c, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x1, 0x2d, 0x62, 0x64, 0x2d, 0x61, 0x70, 0x69, 0x2e, 0x6b, 0x75, 0x77, 0x6f, 0x2e, 0x63, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x2f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x1, 0x1, 0x6, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0xfe, 0x2, 0xaa, 0x4d, 0x55, 0x53, 0x49, 0x43, 0x5f, 0x55, 0x3d, 0x30, 0x30, 0x42, 0x34, 0x43, 0x31, 0x45, 0x33, 0x46, 0x44, 0x37, 0x37, 0x34, 0x31, 0x30, 0x37, 0x38, 0x30, 0x45, 0x46, 0x31, 0x43, 0x30, 0x38, 0x34, 0x30, 0x44, 0x30, 0x38, 0x46, 0x33, 0x46, 0x35, 0x45, 0x37, 0x30, 0x33, 0x30, 0x45, 0x32, 0x44, 0x30, 0x35, 0x32, 0x43, 0x41, 0x38, 0x45, 0x43, 0x39, 0x38, 0x41, 0x37, 0x33, 0x36, 0x38, 0x46, 0x37, 0x41, 0x37, 0x46, 0x36, 0x36, 0x34, 0x39, 0x42, 0x32, 0x31, 0x36, 0x45, 0x39, 0x35, 0x33, 0x33, 0x41, 0x31, 0x41, 0x31, 0x37, 0x34, 0x44, 0x37, 0x32, 0x43, 0x43, 0x41, 0x44, 0x46, 0x39, 0x39, 0x35, 0x35, 0x34, 0x32, 0x32, 0x38, 0x45, 0x38, 0x35, 0x32, 0x44, 0x45, 0x34, 0x36, 0x42, 0x42, 0x44, 0x32, 0x45, 0x41, 0x32, 0x41, 0x36, 0x42, 0x32, 0x41, 0x31, 0x34, 0x33, 0x33, 0x41, 0x33, 0x44, 0x46, 0x34, 0x38, 0x42, 0x36, 0x32, 0x45, 0x41, 0x41, 0x37, 0x36, 0x46, 0x43, 0x31, 0x38, 0x43, 0x44, 0x35, 0x39, 0x32, 0x35, 0x36, 0x46, 0x45, 0x46, 0x36, 0x45, 0x37, 0x36, 0x44, 0x33, 0x39, 0x46, 0x42, 0x34, 0x32, 0x44, 0x46, 0x37, 0x36, 0x43, 0x45, 0x35, 0x30, 0x36, 0x38, 0x43, 0x36, 0x39, 0x45, 0x33, 0x39, 0x34, 0x34, 0x45, 0x33, 0x41, 0x36, 0x45, 0x38, 0x45, 0x33, 0x43, 0x32, 0x36, 0x31, 0x33, 0x35, 0x44, 0x42, 0x45, 0x30, 0x44, 0x39, 0x37, 0x39, 0x31, 0x46, 0x43, 0x45, 0x30, 0x42, 0x44, 0x35, 0x32, 0x34, 0x42, 0x44, 0x32, 0x37, 0x46, 0x36, 0x32, 0x32, 0x36, 0x46, 0x44, 0x36, 0x34, 0x36, 0x30, 0x42, 0x30, 0x35, 0x36, 0x34, 0x36, 0x41, 0x35, 0x34, 0x39, 0x41, 0x35, 0x43, 0x34, 0x32, 0x39, 0x46, 0x35, 0x45, 0x30, 0x31, 0x45, 0x42, 0x41, 0x34, 0x45, 0x32, 0x44, 0x38, 0x44, 0x36, 0x31, 0x35, 0x42, 0x44, 0x37, 0x31, 0x35, 0x41, 0x37, 0x44, 0x32, 0x34, 0x35, 0x42, 0x31, 0x33, 0x44, 0x39, 0x45, 0x35, 0x37, 0x30, 0x45, 0x38, 0x37, 0x44, 0x30, 0x41, 0x44, 0x41, 0x36, 0x30, 0x38, 0x41, 0x36, 0x30, 0x37, 0x46, 0x32, 0x46, 0x41, 0x45, 0x46, 0x32, 0x32, 0x41, 0x46, 0x38, 0x45, 0x45, 0x39, 0x34, 0x46, 0x38, 0x32, 0x37, 0x41, 0x46, 0x31, 0x35, 0x30, 0x45, 0x39, 0x45, 0x31, 0x43, 0x35, 0x31, 0x37, 0x43, 0x42, 0x30, 0x46, 0x31, 0x35, 0x38, 0x38, 0x45, 0x46, 0x38, 0x46, 0x31, 0x44, 0x36, 0x31, 0x39, 0x34, 0x37, 0x43, 0x34, 0x33, 0x37, 0x38, 0x34, 0x39, 0x38, 0x35, 0x43, 0x46, 0x37, 0x34, 0x46, 0x36, 0x39, 0x34, 0x35, 0x38, 0x37, 0x34, 0x38, 0x39, 0x36, 0x30, 0x43, 0x45, 0x39, 0x32, 0x30, 0x35, 0x33, 0x43, 0x41, 0x37, 0x32, 0x42, 0x35, 0x46, 0x45, 0x46, 0x39, 0x32, 0x43, 0x39, 0x33, 0x46, 0x31, 0x32, 0x46, 0x33, 0x36, 0x37, 0x31, 0x34, 0x46, 0x30, 0x42, 0x33, 0x34, 0x36, 0x43, 0x32, 0x45, 0x41, 0x46, 0x38, 0x39, 0x46, 0x41, 0x41, 0x35, 0x31, 0x36, 0x41, 0x38, 0x39, 0x37, 0x34, 0x45, 0x38, 0x43, 0x46, 0x35, 0x33, 0x44, 0x35, 0x34, 0x39, 0x32, 0x44, 0x45, 0x39, 0x35, 0x45, 0x44, 0x38, 0x35, 0x39, 0x31, 0x43, 0x43, 0x43, 0x46, 0x34, 0x35, 0x41, 0x45, 0x42, 0x36, 0x32, 0x37, 0x43, 0x39, 0x33, 0x42, 0x30, 0x43, 0x44, 0x33, 0x37, 0x30, 0x41, 0x45, 0x46, 0x42, 0x36, 0x35, 0x36, 0x45, 0x41, 0x44, 0x41, 0x44, 0x30, 0x33, 0x31, 0x46, 0x36, 0x38, 0x38, 0x41, 0x36, 0x42, 0x42, 0x32, 0x43, 0x45, 0x33, 0x43, 0x39, 0x46, 0x41, 0x33, 0x31, 0x42, 0x44, 0x36, 0x31, 0x36, 0x36, 0x41, 0x31, 0x36, 0x41, 0x42, 0x45, 0x42, 0x45, 0x44, 0x41, 0x44, 0x46, 0x43, 0x46, 0x45, 0x46, 0x42, 0x44, 0x43, 0x45, 0x44, 0x35, 0x44, 0x34, 0x45, 0x31, 0x32, 0x46, 0x46, 0x46, 0x31, 0x34, 0x30, 0x33, 0x43, 0x34, 0x46, 0x32, 0x42, 0x35, 0x41, 0x33, 0x46, 0x32, 0x34, 0x32, 0x32, 0x45, 0x46, 0x39, 0x44, 0x30, 0x38, 0x37, 0x38, 0x43, 0x30, 0x42, 0x35, 0x32, 0x44, 0x30, 0x38, 0x39, 0x36, 0x37, 0x44, 0x35, 0x38, 0x45, 0x32, 0x45, 0x39, 0x44, 0x41, 0x43, 0x45, 0x37, 0x35, 0x34, 0x34, 0x30, 0x34, 0x45, 0x32, 0x44, 0x36, 0x45, 0x31, 0x46, 0x38, 0x31, 0x46, 0x35, 0x32, 0x41, 0x31, 0x46, 0x31, 0x37, 0x33, 0x35, 0x43, 0x41, 0x39, 0x46, 0x42, 0x42, 0x38, 0x35, 0x44, 0x37, 0x35, 0x38, 0x46, 0x38, 0x31, 0x45, 0x30, 0x41, 0x37, 0x43, 0x42, 0x41, 0x34, 0x31, 0x43, 0x35, 0x37, 0x33, 0x39, 0x44, 0x32, 0x39, 0x45, 0x32, 0x38, 0x34, 0x46, 0x36, 0x38, 0x34, 0x33, 0x30, 0x45, 0x42, 0x31, 0x33, 0x45, 0x34, 0x46, 0x34, 0x39, 0x33, 0x38, 0x39, 0x30, 0x38, 0x34, 0x30, 0x30, 0x33, 0x31, 0x44, 0x33, 0x42, 0x44, 0x32, 0x37, 0x45, 0x1, 0x4, 0x7, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6d, 0x2e, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x2e, 0x6d, 0x69, 0x67, 0x75, 0x2e, 0x63, 0x6e, 0x2f, 0x76, 0x34, 0x2f, 0x2, 0x42, 0x79, 0x20, 0x30, 0x34, 0x66, 0x38, 0x31, 0x34, 0x36, 0x31, 0x61, 0x39, 0x38, 0x63, 0x37, 0x61, 0x66, 0x35, 0x35, 0x37, 0x66, 0x65, 0x61, 0x33, 0x63, 0x66, 0x32, 0x38, 0x63, 0x34, 0x65, 0x61, 0x31, 0x35, 0x7, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x7, 0x30, 0x31, 0x34, 0x30, 0x30, 0x30, 0x44, 0x6, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x38, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x3d, 0x5a, 0x54, 0x49, 0x77, 0x4f, 0x44, 0x6b, 0x79, 0x4d, 0x44, 0x51, 0x74, 0x4f, 0x54, 0x45, 0x31, 0x4e, 0x53, 0x30, 0x30, 0x4d, 0x44, 0x68, 0x6c, 0x4c, 0x54, 0x68, 0x68, 0x4d, 0x57, 0x45, 0x74, 0x4d, 0x6a, 0x51, 0x30, 0x4e, 0x32, 0x59, 0x32, 0x4d, 0x7a, 0x6b, 0x32, 0x4f, 0x54, 0x41, 0x7a, 0x1, 0x6, 0x7, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2, 0x71, 0x71, 0x4, 0x70, 0x6c, 0x61, 0x74, 0x2, 0x61, 0x72, 0x3, 0x6e, 0x65, 0x74, 0x4, 0x77, 0x69, 0x66, 0x69, 0x3, 0x76, 0x65, 0x72, 0x5, 0x33, 0x2e, 0x31, 0x2e, 0x32, 0x3, 0x75, 0x69, 0x64, 0x0, 0x5, 0x64, 0x65, 0x76, 0x49, 0x64, 0x1, 0x30, 0x0} + ztool.Val_GobDecode(data, &initdata) +} diff --git a/src/sources/source.go b/src/sources/source.go index 0e1398e..b16888a 100644 --- a/src/sources/source.go +++ b/src/sources/source.go @@ -2,10 +2,9 @@ package sources import ( "lx-source/src/caches" - "lx-source/src/env" ) -var Loger = env.Loger.NewGroup(`Sources`) // JieXiApis +// var Loger = env.Loger.NewGroup(`Sources`) // JieXiApis const ( Err_Verify = `Verify Failed` ) diff --git a/update.md b/update.md index 24b6ff6..45bcc08 100644 --- a/update.md +++ b/update.md @@ -1,5 +1,20 @@ ## Lx-Source/更新日志 +#### 2023-12-22 v1.0.2-b0.4 (beta) + ++ update 更新: + - 给CacheQuery加个sync.Pool,提高并发分配效率 + - 请求验证改为在初始化时载入,降低每次判断性能损耗 + ++ feature 功能: + - 临时链生成仍将推迟 ++ bugfix 修复: + - 临时解决预定义(*Loger).NewGroup()无法输出到FileLoger问题 ++ 注: + - 如果非调试使用建议关闭控制台日志输出 [Main].Print=false,可少量提升io性能 (不影响文件日志记录) + #### 2023-12-19 1.0.2-b0.3 (dev) + 增加dev分支,日常开发,稳定了再合main,防止临时补充更新情况 + 上次补充更新内容:将error.mp3换成远程连接