Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
更新编译脚本
Browse files Browse the repository at this point in the history
更新API版本
  • Loading branch information
XiaoMengXinX committed Nov 5, 2021
1 parent b98c2e6 commit 3dc4498
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ if [[ "$3" == "-o" ]]; then
export OUTPUT_ARG="-o $4"
fi

export CGO_ENABLED=0

LDFlags="\
-s -w
-X 'main.version=${VERSION}' \
-X 'main.commitSHA=${COMMIT_SHA}' \
-X 'main.buildTime=${BUILD_TIME}' \
"

CGO_ENABLED=0 go build "${OUTPUT_ARG}" -trimpath -ldflags "${LDFlags}"
go build ${OUTPUT_ARG} -trimpath -ldflags "${LDFlags}"
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/XiaoMengXinX/Music163Api-Go v0.1.14 h1:aBr92X9RWv7JSGADnoTt2V6dNp3iXd5RAGp/ptkzkiI=
github.com/XiaoMengXinX/Music163Api-Go v0.1.14/go.mod h1:4lcWLPwXMsTiwcyM6JBEAHkU7NUvYJOMPtfiUj9X0Jw=
github.com/XiaoMengXinX/Music163Api-Go v0.1.16 h1:M+OjZPbFZK3fv5qKddCCywhZWlOQUSJAWlXfzxonfrQ=
github.com/XiaoMengXinX/Music163Api-Go v0.1.16/go.mod h1:4lcWLPwXMsTiwcyM6JBEAHkU7NUvYJOMPtfiUj9X0Jw=
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/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
Expand Down
2 changes: 1 addition & 1 deletion tools/quickLogin/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/XiaoMengXinX/Fuck163MusicTasks/tools/quickLogin
go 1.16

require (
github.com/XiaoMengXinX/Music163Api-Go v0.1.9
github.com/XiaoMengXinX/Music163Api-Go v0.1.16
github.com/sirupsen/logrus v1.8.1
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
)
4 changes: 2 additions & 2 deletions tools/quickLogin/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/XiaoMengXinX/Music163Api-Go v0.1.9 h1:6sp0YIVqNYOmuig+ErtLvPMkwqPPc5ILEZ1lz+aV0xM=
github.com/XiaoMengXinX/Music163Api-Go v0.1.9/go.mod h1:OOYCjlzn6o8+9avrp5fiOIRQotqIdC2X8NqM05s8fHI=
github.com/XiaoMengXinX/Music163Api-Go v0.1.16 h1:M+OjZPbFZK3fv5qKddCCywhZWlOQUSJAWlXfzxonfrQ=
github.com/XiaoMengXinX/Music163Api-Go v0.1.16/go.mod h1:4lcWLPwXMsTiwcyM6JBEAHkU7NUvYJOMPtfiUj9X0Jw=
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/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
Expand Down
21 changes: 13 additions & 8 deletions tools/quickLogin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ func init() {
}

var (
isDEBUG = flag.Bool("d", false, "DEBUG mode")
)
var (
rmPre = regexp.MustCompile(`(.*)MUSIC_U=`)
rmSuf = regexp.MustCompile(`;(.*)`)
isDEBUG = flag.Bool("d", false, "DEBUG mode")
cookieParser = regexp.MustCompile(`MUSIC_U=(.*?);`)
)

func main() {
Expand All @@ -74,9 +71,17 @@ func main() {
}
if loginData.Code == 803 {
fmt.Println(loginData.Message)
MUSIC_U := rmSuf.ReplaceAllString(rmPre.ReplaceAllString(header, ""), "")
if MUSIC_U != "" {
fmt.Printf("[MUSIC_U] %s\n", MUSIC_U)
cookies := header.Values("Set-Cookie")
var musicU string
for _, cookie := range cookies {
str := cookieParser.FindString(cookie)
if str != "" {
musicU = strings.Trim(strings.Trim(str, "MUSIC_U="), ";")
break
}
}
if musicU != "" {
fmt.Printf("[MUSIC_U] %s\n", musicU)
} else {
log.Errorln("解析 MUSIC_U 失败,请重新登陆")
}
Expand Down

0 comments on commit 3dc4498

Please sign in to comment.