Skip to content

Commit

Permalink
fix: use OAuth 2.0 token endpoint to fix the "captcha_required" login…
Browse files Browse the repository at this point in the history
… error
  • Loading branch information
vizv committed May 27, 2024
1 parent d6f24b5 commit 0c17ea9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/pikpak/pikpak.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ func NewPikPak(account, password string) PikPak {

func (p *PikPak) Login() error {
m := make(map[string]string)
m["captcha_token"] = ""
m["client_id"] = clientID
m["client_secret"] = clientSecret
m["grant_type"] = "password"
m["username"] = p.Account
m["password"] = p.Password
bs, err := jsoniter.Marshal(&m)
if err != nil {
return err
}
req, err := http.NewRequest("POST", "https://user.mypikpak.com/v1/auth/signin?client_id="+clientID, bytes.NewBuffer(bs))
req, err := http.NewRequest("POST", "https://user.mypikpak.com/v1/auth/token", bytes.NewBuffer(bs))
if err != nil {
return err
}
Expand Down

0 comments on commit 0c17ea9

Please sign in to comment.