Skip to content

Commit

Permalink
fix: determine media-user-token length
Browse files Browse the repository at this point in the history
  • Loading branch information
itouakirai committed Feb 11, 2025
1 parent 60942cd commit a39050c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func downloadTrack(trackNum int, trackTotal int, meta *structs.AutoGenerated, tr

//mv dl dev
if track.Type == "music-videos" {
if mediaUserToken == "" || len(mediaUserToken) <= 10 {
if len(mediaUserToken) <= 50 {
fmt.Println("meida-user-token is not set, skip MV dl")
counter.Success++
return
Expand Down Expand Up @@ -570,7 +570,7 @@ func downloadTrack(trackNum int, trackTotal int, meta *structs.AutoGenerated, tr

//get lrc
var lrc string = ""
if mediaUserToken != "" && len(mediaUserToken) > 10 {
if len(mediaUserToken) > 50 {
ttml, err := getSongLyrics(track.ID, storefront, token, mediaUserToken)
if err != nil {
fmt.Println("Failed to get lyrics")
Expand Down Expand Up @@ -611,7 +611,7 @@ func downloadTrack(trackNum int, trackTotal int, meta *structs.AutoGenerated, tr
return
}
if needDlAacLc {
if mediaUserToken == "" || len(mediaUserToken) <= 10 {
if len(mediaUserToken) <= 50 {
fmt.Println("Invalid media-user-token")
counter.Error++
return
Expand Down Expand Up @@ -1153,7 +1153,7 @@ func main() {
continue
}
counter.Total++
if Config.MediaUserToken == "" || len(Config.MediaUserToken) <= 10 {
if len(Config.MediaUserToken) <= 50 {
fmt.Println("meida-user-token is not set, skip MV dl")
counter.Success++
continue
Expand Down

0 comments on commit a39050c

Please sign in to comment.