diff --git a/client/client.go b/client/client.go index 9a7bba36..054fff25 100644 --- a/client/client.go +++ b/client/client.go @@ -12,9 +12,11 @@ import ( "math" "math/rand" "net" + "strconv" "sync" "sync/atomic" "time" + "strings" "github.com/golang/protobuf/proto" @@ -177,6 +179,39 @@ func (c *QQClient) Login() (*LoginResponse, error) { return &l, nil } +func (c *QQClient) GetVipInfo(target int64) (*VipInfo, error) { + b, err := utils.HttpGetBytes(fmt.Sprintf("https://h5.vip.qq.com/p/mc/cardv2/other?platform=1&qq=%d&adtag=geren&aid=mvip.pingtai.mobileqq.androidziliaoka.fromqita",target),c.getCookiesWithDomain("h5.vip.qq.com")) + if err != nil { + return nil, err + } + ret := VipInfo{Uin: target}; + b = b[bytes.Index(b, []byte(``))+24:] + t := b[:bytes.Index(b,[]byte(``))] + ret.Name = string(t) + b = b[bytes.Index(b, []byte(`LV`))+17:] + t = b[:bytes.Index(b, []byte(`
`))] + ret.Level, _ = strconv.Atoi(string(t)) + b = b[bytes.Index(b, []byte(``))+3:]
+ t = b[:bytes.Index(b, []byte(`倍`))]
+ ret.LevelSpeed, _ = strconv.ParseFloat(string(t),64)
+ b = b[bytes.Index(b, []byte(` `))+3:]
+ st := string(b[:bytes.Index(b, []byte(` `))+3:]
+ t = b[:bytes.Index(b, []byte(` `))+3:]
+ t = b[:bytes.Index(b, []byte(`