mirror of
https://github.com/ZxwyWebSite/lx-source.git
synced 2025-05-23 21:37:42 +08:00
2024-04-30 v1.0.3.0430
This commit is contained in:
parent
1ddc08d3b4
commit
e402c10381
36
go.mod
36
go.mod
@ -1,41 +1,45 @@
|
||||
module lx-source
|
||||
|
||||
go 1.21.4
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/ZxwyWebSite/ztool v0.0.1
|
||||
github.com/gin-contrib/gzip v0.0.6
|
||||
github.com/gin-contrib/gzip v1.0.0
|
||||
github.com/gin-gonic/gin v1.9.1
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/bytedance/sonic v1.10.2 // indirect
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
|
||||
github.com/chenzhuoyu/iasm v0.9.1 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
|
||||
github.com/bytedance/sonic v1.11.5 // indirect
|
||||
github.com/bytedance/sonic/loader v0.1.1 // indirect
|
||||
github.com/cloudwego/base64x v0.1.3 // indirect
|
||||
github.com/cloudwego/iasm v0.2.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
|
||||
github.com/gin-contrib/cors v1.7.1
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/go-ini/ini v1.67.0 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.14.0 // indirect
|
||||
github.com/go-playground/validator/v10 v10.19.0 // indirect
|
||||
github.com/goccy/go-json v0.10.2 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
|
||||
github.com/leodido/go-urn v1.2.4 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // 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/reflect2 v1.0.2 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.1 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
||||
github.com/ugorji/go/codec v1.2.12 // indirect
|
||||
golang.org/x/arch v0.7.0 // indirect
|
||||
golang.org/x/crypto v0.9.0 // indirect
|
||||
golang.org/x/net v0.10.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
golang.org/x/crypto v0.22.0 // indirect
|
||||
golang.org/x/net v0.24.0 // indirect
|
||||
golang.org/x/sys v0.19.0 // indirect
|
||||
golang.org/x/text v0.14.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.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
|
115
go.sum
115
go.sum
@ -1,68 +1,55 @@
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
|
||||
github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE=
|
||||
github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA=
|
||||
github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
|
||||
github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0=
|
||||
github.com/chenzhuoyu/iasm v0.9.1/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
|
||||
github.com/bytedance/sonic v1.11.5 h1:G00FYjjqll5iQ1PYXynbg/hyzqBqavH8Mo9/oTopd9k=
|
||||
github.com/bytedance/sonic v1.11.5/go.mod h1:X2PC2giUdj/Cv2lliWFLk6c/DUQok5rViJSemeB0wDw=
|
||||
github.com/bytedance/sonic/loader v0.1.0/go.mod h1:UmRT+IRTGKz/DAkzcEGzyVqQFJ7H9BqwBO3pm9H/+HY=
|
||||
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
|
||||
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
||||
github.com/cloudwego/base64x v0.1.3 h1:b5J/l8xolB7dyDTTmhJP2oTs5LdrjyrUFuNxdfq5hAg=
|
||||
github.com/cloudwego/base64x v0.1.3/go.mod h1:1+1K5BUHIQzyapgpF7LwvOGAEDicKtt1umPV+aN8pi8=
|
||||
github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
|
||||
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
|
||||
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
|
||||
github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4=
|
||||
github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk=
|
||||
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
|
||||
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
|
||||
github.com/gin-contrib/cors v1.7.1 h1:s9SIppU/rk8enVvkzwiC2VK3UZ/0NNGsWfUKvV55rqs=
|
||||
github.com/gin-contrib/cors v1.7.1/go.mod h1:n/Zj7B4xyrgk/cX1WCX2dkzFfaNm/xJb6oIUk7WTtps=
|
||||
github.com/gin-contrib/gzip v1.0.0 h1:UKN586Po/92IDX6ie5CWLgMI81obiIp5nSP85T3wlTk=
|
||||
github.com/gin-contrib/gzip v1.0.0/go.mod h1:CtG7tQrPB3vIBo6Gat9FVUsis+1emjvQqd66ME5TdnE=
|
||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
||||
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
|
||||
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
|
||||
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
|
||||
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
|
||||
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
||||
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
|
||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
|
||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos=
|
||||
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
|
||||
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
|
||||
github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||
github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4=
|
||||
github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
|
||||
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
|
||||
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
|
||||
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
|
||||
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
|
||||
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
|
||||
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
@ -71,72 +58,52 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
|
||||
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
|
||||
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pelletier/go-toml/v2 v2.2.1 h1:9TA9+T8+8CUCO2+WYnDLCgrYi9+omqKXyjDtosvtEhg=
|
||||
github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
||||
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
|
||||
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||
github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
|
||||
github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
|
||||
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
|
||||
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
|
||||
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
||||
golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc=
|
||||
golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
|
||||
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
|
||||
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
|
||||
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
|
||||
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
|
||||
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.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
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/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.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||
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/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
|
||||
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
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.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/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
||||
|
2
main.go
2
main.go
@ -46,8 +46,8 @@ func init() {
|
||||
// }
|
||||
fp.Info(`设置默认文件权限为 %o (%v)`, *perm, ztool.Fbj_DefPerm).Free()
|
||||
}
|
||||
parseEtag(etag)
|
||||
env.Cfg.MustInit(confPath)
|
||||
parseEtag(etag)
|
||||
// fmt.Printf("%+v\n", env.Config)
|
||||
env.Loger.NewGroup(`ServHello`).Info(`欢迎使用 LX-SOURCE 洛雪音乐自定义源`).Free()
|
||||
if !env.Config.Main.Debug {
|
||||
|
59
menu.go
59
menu.go
@ -2,6 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"lx-source/src/env"
|
||||
wm "lx-source/src/sources/custom/wy/modules"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
qrcode "github.com/skip2/go-qrcode"
|
||||
)
|
||||
|
||||
func parseEtag(etag *string) {
|
||||
@ -15,12 +20,66 @@ func parseEtag(etag *string) {
|
||||
case `menu`:
|
||||
loger.Fatal(`暂不支持交互菜单,敬请期待...`)
|
||||
// menuMian()
|
||||
case `wyqr`:
|
||||
wyQrLogin()
|
||||
default:
|
||||
loger.Fatal(`未知参数:%q`, *etag)
|
||||
}
|
||||
loger.Free()
|
||||
}
|
||||
|
||||
// 网易云扫码登录
|
||||
func wyQrLogin() {
|
||||
loger := env.Loger.NewGroup(`WyQrLogin`)
|
||||
defer loger.Free()
|
||||
loger.Info(`执行模块: 网易云扫码登录`)
|
||||
res, err := wm.LoginQrKey()
|
||||
if err != nil {
|
||||
loger.Fatal(`无法创建请求: %s`, err)
|
||||
}
|
||||
key := res.Body[`unikey`].(string)
|
||||
loger.Info(`创建请求成功: %v`, key)
|
||||
|
||||
link := wm.LoginQrCreate(key)
|
||||
qr, err := qrcode.New(link, qrcode.Low)
|
||||
if err != nil {
|
||||
loger.Fatal(`无法生成二维码: %s`, err)
|
||||
}
|
||||
loger.Info("\n请使用网易云音乐手机APP扫描以下二维码授权登录:\n%v", qr.ToSmallString(false))
|
||||
|
||||
for {
|
||||
time.Sleep(time.Second * 5)
|
||||
res, err = wm.LoginQrCheck(key)
|
||||
if err != nil {
|
||||
loger.Error(`检测状态失败: %s`, err)
|
||||
continue
|
||||
}
|
||||
msg := res.Body[`message`].(string)
|
||||
switch msg {
|
||||
case `等待扫码`:
|
||||
loger.Info(msg)
|
||||
case `授权中`:
|
||||
loger.Info(`扫码成功: %q, 请在手机上确认登录`, res.Body[`nickname`])
|
||||
case `授权登陆成功`:
|
||||
loger.Info(`授权成功`)
|
||||
env.Config.Custom.Wy_Enable = true
|
||||
env.Config.Custom.Wy_Mode = `163api`
|
||||
env.Config.Custom.Wy_Api_Cookie = strings.Join(res.Cookie, `; `)
|
||||
env.Config.Custom.Wy_Refresh_Enable = true
|
||||
if err := env.Cfg.Save(``); err != nil {
|
||||
loger.Error(`配置保存失败: %s`, err)
|
||||
} else {
|
||||
loger.Info(`配置保存成功`)
|
||||
}
|
||||
return
|
||||
case `二维码不存在或已过期`:
|
||||
loger.Fatal(`授权请求超时,请重试!`)
|
||||
default:
|
||||
loger.Fatal(`未知状态: %v`, msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// func menuMian() {
|
||||
// app := menu.NewApp(`Lx-Source`)
|
||||
// app.Data = menu.Data{
|
||||
|
8
src/env/env.go
vendored
8
src/env/env.go
vendored
@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
Version = `1.0.3-rc2`
|
||||
Version = `1.0.3.0430`
|
||||
)
|
||||
|
||||
var (
|
||||
@ -31,6 +31,7 @@ type (
|
||||
Debug bool `comment:"调试模式"`
|
||||
Listen []string `comment:"监听地址 (多端口以','分隔)"`
|
||||
Gzip bool `comment:"开启GZip (对已压缩的内容使用会产生反效果)"`
|
||||
Cors bool `comment:"添加跨域响应头 (兼容前端请求)"`
|
||||
LogPath string `comment:"文件日志路径,不填禁用"`
|
||||
Print bool `comment:"控制台输出 (影响io性能,后台使用建议关闭)"`
|
||||
SysLev bool `comment:"(实验性) 设置进程高优先级"`
|
||||
@ -140,11 +141,15 @@ type (
|
||||
Kg_Lite_Enable bool `comment:"是否启用概念版自动签到,仅在appid=3116时运行"`
|
||||
Kg_Lite_MixId string `comment:"mix_songmid的获取方式, 默认auto, 可以改成一个数字手动"`
|
||||
Kg_Lite_Interval int64 `comment:"调用时间,自动刷新"`
|
||||
// kg refresh_login
|
||||
Kg_Refresh_Enable bool `comment:"是否启动刷新登录"`
|
||||
Kg_Refresh_Interval int64 `comment:""`
|
||||
|
||||
// tx
|
||||
Tx_Enable bool `comment:"是否启用小秋源"`
|
||||
Tx_Ukey string `comment:"Cookie中/客户端的请求体中的(comm.authst)"`
|
||||
Tx_Uuin string `comment:"key对应的QQ号"`
|
||||
Tx_CDNUrl string `comment:"指定音频CDN地址"`
|
||||
// tx refresh_login
|
||||
Tx_Refresh_Enable bool `comment:"是否启动刷新登录"`
|
||||
Tx_Refresh_Interval int64 `comment:"刷新间隔 (由程序维护,非必要无需修改)"`
|
||||
@ -254,6 +259,7 @@ var (
|
||||
Kg_Lite_MixId: `auto`,
|
||||
|
||||
Tx_Enable: false,
|
||||
Tx_CDNUrl: `https://isure6.stream.qqmusic.qq.com/`,
|
||||
Tx_Refresh_Enable: false,
|
||||
Tx_Refresh_Interval: 86000,
|
||||
},
|
||||
|
@ -88,7 +88,13 @@ func InitHandler(h gin.HandlerFunc) (out []gin.HandlerFunc) {
|
||||
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 {
|
||||
var auth string
|
||||
if key, ok := c.GetQuery(`key`); ok {
|
||||
auth = key
|
||||
} else {
|
||||
auth = c.Request.Header.Get(`X-LxM-Auth`)
|
||||
}
|
||||
if auth != env.Config.Auth.ApiKey_Value {
|
||||
loger.Debug(`验证失败: %q`, auth)
|
||||
return &resp.Resp{Code: 3, Msg: `验证Key失败, 请联系网站管理员`}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ func musicHandler(c *gin.Context) {
|
||||
return out
|
||||
}
|
||||
// 查询内存缓存
|
||||
atomic.AddInt64(&accnum, 1)
|
||||
cquery := strings.Join([]string{pm, ps, pid, pq}, `/`)
|
||||
loger.Debug(`MemoGet: %v`, cquery)
|
||||
if cdata, ok := env.Cache.Get(cquery); ok {
|
||||
|
@ -107,5 +107,6 @@ func loadPublic(r *gin.Engine) {
|
||||
r.StaticFileFS(`/lx-custom-source.js`, `lx-custom-source.js`, httpFS)
|
||||
}
|
||||
r.StaticFileFS(`/favicon.ico`, `lx-icon.ico`, httpFS)
|
||||
r.StaticFileFS(`/status`, `status.html`, httpFS)
|
||||
r.StaticFS(`/public`, httpFS)
|
||||
}
|
||||
|
126
src/server/public/status.html
Normal file
126
src/server/public/status.html
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<title>LX Source API</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>LX Source API</h1>
|
||||
当你看到这个页面时,服务已经成功跑起来了~
|
||||
<h2>示例:</h2>
|
||||
<script>
|
||||
const api = './';
|
||||
function l(s, id, q) {
|
||||
let url = `${api}link/${s}/${id[Math.floor(Math.random() * id.length)]}/${q}`;
|
||||
const key = localStorage.getItem('apipass'); if (key) url += `?key=${key}`;
|
||||
fetch(url)
|
||||
.then((response) => response.json())
|
||||
.then((res) => {
|
||||
if (res.code != 0 || res.data == '') throw res.msg;
|
||||
window.open(res.data);
|
||||
})
|
||||
.catch((err) => {
|
||||
alert(err);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<ul>
|
||||
<li>0. <a href="./lx-custom-source.js?raw">获取源脚本</a></li>
|
||||
<li>1. <a onclick="l('wy',['473120817','434022356','2112290949','27646205'],'320k')">WY小芸源</a></li>
|
||||
<li>2. <a onclick="l('mg',['6005970X6D1','63278105706','60054702010'],'320k')">MG小蜜源</a></li>
|
||||
<li>3. <a onclick="l('kw',['236891','26428340','133360','112051'],'320k')">KW小蜗源</a></li>
|
||||
<li>4. <a onclick="l('kg',['A90B30D3F51C56841D3FE51D5C5B09A8'],'128k')">KG小枸源</a></li>
|
||||
<li>5. <a onclick="l('tx',['002Le9vl2JlYDK','0013Xlvm0ZKNnA'],'128k')">TX小秋源</a></li>
|
||||
</ul>
|
||||
<h2>状态:</h2>
|
||||
<ul>
|
||||
<li>
|
||||
已持续运行
|
||||
<strong id="lxs_run_d">20</strong> 天
|
||||
<strong id="lxs_run_h">21</strong> 时
|
||||
<strong id="lxs_run_m">10</strong> 分
|
||||
<strong id="lxs_run_s">08</strong> 秒
|
||||
</li>
|
||||
<li>
|
||||
调用:
|
||||
<strong id="lxs_sum_acc">0</strong>
|
||||
/解析:
|
||||
<strong id="lxs_sum_req">0</strong>
|
||||
/成功:
|
||||
<strong id="lxs_sum_sec">0</strong>
|
||||
</li>
|
||||
<li>
|
||||
版本号:
|
||||
<strong id="lxs_ver">dev</strong>
|
||||
</li>
|
||||
<li><strong id="lxs_err"></strong></li>
|
||||
</ul>
|
||||
<script>
|
||||
fetch(api)
|
||||
.then((response) => response.json())
|
||||
.then((res) => {
|
||||
document.getElementById("lxs_sum_acc").innerText = res.summary.Accessn;
|
||||
document.getElementById("lxs_sum_req").innerText = res.summary.Request;
|
||||
document.getElementById("lxs_sum_sec").innerText = res.summary.Success;
|
||||
const startTime = new Date(res.summary.StartAt * 1000);
|
||||
const updateTimer = () => {
|
||||
const elapsed = new Date() - startTime;
|
||||
document.getElementById("lxs_run_d").innerText = String(Math.floor(elapsed / 864e5)).padStart(2, "0");
|
||||
document.getElementById("lxs_run_h").innerText = String(Math.floor((elapsed % 864e5) / 36e5)).padStart(2, "0");
|
||||
document.getElementById("lxs_run_m").innerText = String(Math.floor((elapsed % 36e5) / 6e4)).padStart(2, "0");
|
||||
document.getElementById("lxs_run_s").innerText = String(Math.floor((elapsed % 6e4) / 1000)).padStart(2, "0");
|
||||
};
|
||||
updateTimer(), setInterval(updateTimer, 1e3);
|
||||
document.getElementById("lxs_ver").innerText = res.version;
|
||||
if (res.auth.apikey && !localStorage.getItem("apipass")) {
|
||||
const key = prompt("请填写API密钥"); if (key) localStorage.setItem("apipass", key);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
document.getElementById("lxs_err").innerText = err;
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #ffffff;
|
||||
text-align: center;
|
||||
margin-top: 30px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
* {
|
||||
color: rgb(100, 100, 100);
|
||||
}
|
||||
|
||||
a {
|
||||
color: #42b983;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
ul,
|
||||
li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin-left: -40px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -7,11 +7,13 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-contrib/gzip"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var (
|
||||
accnum int64
|
||||
reqnum int64
|
||||
secnum int64
|
||||
)
|
||||
@ -24,6 +26,10 @@ func InitRouter() *gin.Engine {
|
||||
if env.Config.Main.Gzip {
|
||||
r.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedPaths([]string{"/file/"})))
|
||||
}
|
||||
// Cors跨域
|
||||
if env.Config.Main.Cors {
|
||||
r.Use(cors.Default())
|
||||
}
|
||||
startime := time.Now().Unix()
|
||||
// 源信息
|
||||
r.GET(`/`, func(c *gin.Context) {
|
||||
@ -48,9 +54,14 @@ func InitRouter() *gin.Engine {
|
||||
// 数据统计
|
||||
`summary`: gin.H{
|
||||
`StartAt`: startime, // 启动时间
|
||||
`Accessn`: accnum, // 访问次数
|
||||
`Request`: reqnum, // 解析次数
|
||||
`Success`: secnum, // 成功次数
|
||||
},
|
||||
// 验证方式
|
||||
`auth`: gin.H{
|
||||
`apikey`: env.Config.Auth.ApiKey_Enable,
|
||||
},
|
||||
})
|
||||
})
|
||||
// 静态文件
|
||||
|
@ -1,6 +1,8 @@
|
||||
package kg
|
||||
|
||||
import (
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"errors"
|
||||
"lx-source/src/env"
|
||||
"math/rand"
|
||||
@ -10,6 +12,8 @@ import (
|
||||
|
||||
"github.com/ZxwyWebSite/ztool"
|
||||
"github.com/ZxwyWebSite/ztool/logs"
|
||||
"github.com/ZxwyWebSite/ztool/x/bytesconv"
|
||||
"github.com/ZxwyWebSite/ztool/x/json"
|
||||
"github.com/ZxwyWebSite/ztool/zcypt"
|
||||
)
|
||||
|
||||
@ -148,11 +152,14 @@ func do_account_signin(loger *logs.Logger, now int64) (err error) {
|
||||
return err
|
||||
}
|
||||
loger.Debug(`Resp: %+v`, out)
|
||||
if out.Status != 1 {
|
||||
if out.ErrorCode == 130012 {
|
||||
if out.Status != 1 || out.ErrorCode != 0 {
|
||||
switch out.ErrorCode {
|
||||
case 130012:
|
||||
loger.Info(`今日已签到过,明天再来吧`)
|
||||
} else {
|
||||
return errors.New(out.ErrorMsg)
|
||||
case 51002:
|
||||
panic(`登录过期啦!请重新获取账号Token`)
|
||||
default:
|
||||
return errors.New(strconv.Itoa(out.ErrorCode) + `: ` + out.ErrorMsg)
|
||||
}
|
||||
} else {
|
||||
loger.Info(`Lite签到成功`)
|
||||
@ -163,12 +170,96 @@ func do_account_signin(loger *logs.Logger, now int64) (err error) {
|
||||
return env.Cfg.Save(``)
|
||||
}
|
||||
|
||||
// 刷新Token
|
||||
func login_by_token(loger *logs.Logger, now int64) (err error) {
|
||||
// 前置到期检测
|
||||
if now < env.Config.Custom.Kg_Refresh_Interval {
|
||||
loger.Debug(`Key未过期,跳过...`)
|
||||
return
|
||||
}
|
||||
// 获取加密参数
|
||||
var aeskey []byte
|
||||
switch env.Config.Custom.Kg_Client_AppId {
|
||||
case `1005`:
|
||||
aeskey = []byte(`90b8382a1bb4ccdcf063102053fd75b8`)
|
||||
case `3116`:
|
||||
aeskey = []byte(`c24f74ca2820225badc01946dba4fdf7`)
|
||||
default:
|
||||
panic(`当前应用AppId暂不支持此功能`)
|
||||
}
|
||||
// 生成请求数据
|
||||
tnow := time.Now()
|
||||
pbyte, _ := json.Marshal(map[string]any{
|
||||
`clienttime`: tnow.Unix(),
|
||||
`token`: env.Config.Custom.Kg_token,
|
||||
})
|
||||
block, _ := aes.NewCipher(aeskey)
|
||||
encrypter := cipher.NewCBCEncrypter(block, aeskey[block.BlockSize():])
|
||||
padata := zcypt.PKCS7Padding(pbyte, block.BlockSize())
|
||||
encrypted := make([]byte, len(padata))
|
||||
encrypter.CryptBlocks(encrypted, padata)
|
||||
encstr := zcypt.HexToString(encrypted)
|
||||
bodys, _ := json.Marshal(map[string]any{
|
||||
`t1`: 0,
|
||||
`t2`: 0,
|
||||
`p3`: encstr,
|
||||
`userid`: env.Config.Custom.Kg_userId,
|
||||
`clienttime_ms`: tnow.UnixMilli(),
|
||||
})
|
||||
params := map[string]string{
|
||||
`dfid`: `-`,
|
||||
`mid`: `20211008`,
|
||||
`clientver`: env.Config.Custom.Kg_Client_Version,
|
||||
`clienttime`: strconv.FormatInt(tnow.Unix(), 10),
|
||||
`appid`: env.Config.Custom.Kg_Client_AppId,
|
||||
}
|
||||
headers := map[string]string{
|
||||
`User-Agent`: `Android711-1070-10860-14-0-LOGIN-wifi`,
|
||||
`KG-THash`: `7af653c`,
|
||||
`KG-Rec`: `1`,
|
||||
`KG-RC`: `1`,
|
||||
}
|
||||
// 请求对应接口
|
||||
var res loginInfo
|
||||
err = signRequest(
|
||||
http.MethodPost,
|
||||
`http://login.user.kugou.com/v4/login_by_token`,
|
||||
bytesconv.BytesToString(bodys),
|
||||
params, headers, &res,
|
||||
)
|
||||
if err != nil {
|
||||
return errors.New(`接口请求失败: ` + err.Error())
|
||||
}
|
||||
loger.Info(`获取数据成功`)
|
||||
loger.Debug(`Resp: %+v`, res)
|
||||
if res.ErrorCode != 0 {
|
||||
return errors.New(`刷新登录失败: ` + strconv.Itoa(res.ErrorCode))
|
||||
}
|
||||
env.Config.Custom.Kg_token = res.Data.Token
|
||||
env.Config.Custom.Kg_userId = strconv.Itoa(res.Data.Userid)
|
||||
next := time.Date(tnow.Year(), tnow.Month(), tnow.Day()+25, 0, 0, 0, 0, tnow.Location())
|
||||
env.Config.Custom.Kg_Refresh_Interval = next.Unix()
|
||||
loger.Info(`刷新登录成功`)
|
||||
return env.Cfg.Save(``)
|
||||
}
|
||||
|
||||
func init() {
|
||||
env.Inits.Add(func() {
|
||||
if env.Config.Custom.Kg_Lite_Enable {
|
||||
if env.Config.Custom.Kg_Client_AppId == `3116` && env.Config.Custom.Kg_token != `` {
|
||||
env.Tasker.Add(`kg_refresh`, do_account_signin, 86000, true)
|
||||
if env.Config.Custom.Kg_token != `` {
|
||||
if env.Config.Custom.Kg_Lite_Enable && env.Config.Custom.Kg_Client_AppId == `3116` {
|
||||
env.Tasker.Add(`kg_litsign`, do_account_signin, 86000, true)
|
||||
}
|
||||
if env.Config.Custom.Kg_Refresh_Enable {
|
||||
env.Tasker.Add(`kg_refresh`, login_by_token, 86000, true)
|
||||
}
|
||||
}
|
||||
/*if env.Config.Custom.Kg_Lite_Enable {
|
||||
if env.Config.Custom.Kg_Client_AppId == `3116` && env.Config.Custom.Kg_token != `` {
|
||||
env.Tasker.Add(`kg_litsign`, do_account_signin, 86000, true)
|
||||
}
|
||||
}
|
||||
if env.Config.Custom.Kg_Refresh_Enable && env.Config.Custom.Kg_token != `` {
|
||||
env.Tasker.Add(`kg_refresh`, login_by_token, 86000, true)
|
||||
}*/
|
||||
})
|
||||
}
|
||||
|
@ -454,3 +454,50 @@ type refreshInfo struct {
|
||||
ErrorMsg string `json:"error_msg"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type loginInfo struct {
|
||||
Data struct {
|
||||
// ArttoyAvatar string `json:"arttoy_avatar"`
|
||||
// BcCode string `json:"bc_code"`
|
||||
// Birthday string `json:"birthday"`
|
||||
// BirthdayMmdd string `json:"birthday_mmdd"`
|
||||
// Exp int `json:"exp"`
|
||||
// IsVip int `json:"is_vip"`
|
||||
// MBeginTime string `json:"m_begin_time"`
|
||||
// MEndTime string `json:"m_end_time"`
|
||||
// MIsOld int `json:"m_is_old"`
|
||||
// MType int `json:"m_type"`
|
||||
// Mobile int `json:"mobile"`
|
||||
// Nickname string `json:"nickname"`
|
||||
// Pic string `json:"pic"`
|
||||
// Qq int `json:"qq"`
|
||||
// RegTime string `json:"reg_time"`
|
||||
// RoamBeginTime string `json:"roam_begin_time"`
|
||||
// RoamEndTime string `json:"roam_end_time"`
|
||||
// RoamList struct {
|
||||
// } `json:"roam_list"`
|
||||
// RoamType int `json:"roam_type"`
|
||||
// Score int `json:"score"`
|
||||
// Servertime string `json:"servertime"`
|
||||
// Sex int `json:"sex"`
|
||||
// SuVipBeginTime string `json:"su_vip_begin_time"`
|
||||
// SuVipClearday string `json:"su_vip_clearday"`
|
||||
// SuVipEndTime string `json:"su_vip_end_time"`
|
||||
// SuVipYEndtime string `json:"su_vip_y_endtime"`
|
||||
// T1 string `json:"t1"`
|
||||
Token string `json:"token"`
|
||||
// TotpServerTimestamp int `json:"totp_server_timestamp"`
|
||||
// UserType int `json:"user_type"`
|
||||
// UserYType int `json:"user_y_type"`
|
||||
Userid int `json:"userid"`
|
||||
// Username string `json:"username"`
|
||||
// VipBeginTime string `json:"vip_begin_time"`
|
||||
// VipEndTime string `json:"vip_end_time"`
|
||||
// VipToken string `json:"vip_token"`
|
||||
// VipType int `json:"vip_type"`
|
||||
// Wechat int `json:"wechat"`
|
||||
// YType int `json:"y_type"`
|
||||
} `json:"data"`
|
||||
ErrorCode int `json:"error_code"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
@ -140,7 +140,9 @@ func kwdes(songMid, quality string) (ourl, msg string) {
|
||||
realQuality := strconv.Itoa(resp.Data.Bitrate)
|
||||
if realQuality != infoFile.H[:len(infoFile.H)-1] {
|
||||
msg = sources.E_QNotMatch
|
||||
return
|
||||
if !env.Config.Source.ForceFallback {
|
||||
return
|
||||
}
|
||||
}
|
||||
ourl = utils.DelQuery(resp.Data.URL) //resp.Data.URL[:strings.Index(resp.Data.URL, `?`)]
|
||||
return
|
||||
@ -166,7 +168,9 @@ func kwdes(songMid, quality string) (ourl, msg string) {
|
||||
realQuality := infoData[`bitrate`]
|
||||
if realQuality != infoFile.H[:len(infoFile.H)-1] {
|
||||
msg = sources.E_QNotMatch
|
||||
return
|
||||
if !env.Config.Source.ForceFallback {
|
||||
return
|
||||
}
|
||||
}
|
||||
ourl = utils.DelQuery(infoData[`url`]) //infoData[`url`][:strings.Index(infoData[`url`], `?`)]
|
||||
return
|
||||
|
@ -123,6 +123,6 @@ Loop:
|
||||
return
|
||||
}
|
||||
}
|
||||
ourl = `https://ws.stream.qqmusic.qq.com/` + infoData.Purl
|
||||
ourl = env.Config.Custom.Tx_CDNUrl + infoData.Purl
|
||||
return
|
||||
}
|
||||
|
@ -81,4 +81,16 @@ type (
|
||||
Success bool `json:"success"`
|
||||
Error bool `json:"error"`
|
||||
}
|
||||
// 扫码登录请求
|
||||
QrKey struct {
|
||||
Code int `json:"code"`
|
||||
UniKey string `json:"unikey"`
|
||||
}
|
||||
// 扫码登录结果
|
||||
QrCheck struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
AvatarUrl string `json:"avatarUrl"`
|
||||
NickName string `json:"nickname"`
|
||||
}
|
||||
)
|
||||
|
19
src/sources/custom/wy/modules/login_qr_check.go
Normal file
19
src/sources/custom/wy/modules/login_qr_check.go
Normal file
@ -0,0 +1,19 @@
|
||||
package wy
|
||||
|
||||
import "net/http"
|
||||
|
||||
// 二维码检测扫码状态接口
|
||||
func LoginQrCheck(key string) (*ReqAnswer, error) {
|
||||
res, err := createRequest(
|
||||
http.MethodPost,
|
||||
`https://music.163.com/weapi/login/qrcode/client/login`,
|
||||
map[string]any{
|
||||
`key`: key,
|
||||
`type`: 1,
|
||||
},
|
||||
reqOptions{
|
||||
Crypto: `weapi`,
|
||||
},
|
||||
)
|
||||
return res, err
|
||||
}
|
6
src/sources/custom/wy/modules/login_qr_create.go
Normal file
6
src/sources/custom/wy/modules/login_qr_create.go
Normal file
@ -0,0 +1,6 @@
|
||||
package wy
|
||||
|
||||
// 二维码生成接口
|
||||
func LoginQrCreate(key string) string {
|
||||
return `https://music.163.com/login?codekey=` + key
|
||||
}
|
19
src/sources/custom/wy/modules/login_qr_key.go
Normal file
19
src/sources/custom/wy/modules/login_qr_key.go
Normal file
@ -0,0 +1,19 @@
|
||||
package wy
|
||||
|
||||
import "net/http"
|
||||
|
||||
// 二维码 key 生成接口
|
||||
func LoginQrKey() (*ReqAnswer, error) {
|
||||
res, err := createRequest(
|
||||
http.MethodPost,
|
||||
`https://music.163.com/weapi/login/qrcode/unikey`,
|
||||
map[string]any{
|
||||
`type`: 1,
|
||||
},
|
||||
reqOptions{
|
||||
Crypto: `weapi`,
|
||||
Cookie: nil,
|
||||
},
|
||||
)
|
||||
return res, err
|
||||
}
|
19
update.md
19
update.md
@ -3,6 +3,25 @@
|
||||
<!-- #### \# 2024-02-14 v1.0.3-rel (release)
|
||||
+ **停止更新:感谢这三个月的陪伴,现因无力维护,停止后续更新,发布最后版本,大家有缘再见** -->
|
||||
|
||||
#### \# 2024-04-30 v1.0.3.0430 (beta)
|
||||
+ Tx源支持自定义CDN链接地址
|
||||
+ Wy源支持扫码登录(beta), 启动参数 `-e wyqr`
|
||||
+ 支持在解析时通过?key=传入验证Key
|
||||
|
||||
#### \# 2024-04-20 v1.0.3-rc3 (dev)
|
||||
+ 新增状态页面,访问 `/status` 查看
|
||||
+ Go1.20兼容版见 go120 分支
|
||||
<!-- + 基于MKOnlinePlayer开始制作WebUI -->
|
||||
|
||||
#### \# 2024-04-06 v1.0.3-rc3 (dev)
|
||||
+ Kg源新增刷新登录功能(之前尝试写了,一直没找到lite版的aeskey,感谢Python版提供关键参数)
|
||||
|
||||
#### \# 2024-03-22 v1.0.3-rc3 (dev)
|
||||
+ Kg源Lite签到模块新增错误码"登录已过期",目前Token有效期为一个月,暂未发现自动刷新方式
|
||||
+ 重制构建脚本,Action编译测试
|
||||
+ 降级构建go1.20版本以支持更早的系统(beta)
|
||||
<!-- + 脱离zTool依赖,允许直接构建 -->
|
||||
|
||||
#### \# 2024-03-16 v1.0.3-rc2 (dev)
|
||||
+ Mg源新增接口,无需登录账号(二次查询,速度较慢)
|
||||
+ 清理部分结构体未使用字段
|
||||
|
Loading…
x
Reference in New Issue
Block a user