mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
client: delete GetVipInfo
This api is broken.
This commit is contained in:
parent
8fa49fedb9
commit
bc4e9f3c95
@ -11,7 +11,6 @@ import (
|
||||
"net/textproto"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@ -21,51 +20,6 @@ import (
|
||||
"github.com/Mrs4s/MiraiGo/utils"
|
||||
)
|
||||
|
||||
/* -------- VipInfo -------- */
|
||||
|
||||
type VipInfo struct {
|
||||
Uin int64
|
||||
Name string
|
||||
Level int
|
||||
LevelSpeed float64
|
||||
VipLevel string
|
||||
VipGrowthSpeed int
|
||||
VipGrowthTotal int
|
||||
}
|
||||
|
||||
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(`<span class="ui-nowrap">`))+24:]
|
||||
t := b[:bytes.Index(b, []byte(`</span>`))]
|
||||
ret.Name = string(t)
|
||||
b = b[bytes.Index(b, []byte(`<small>LV</small>`))+17:]
|
||||
t = b[:bytes.Index(b, []byte(`</p>`))]
|
||||
ret.Level, _ = strconv.Atoi(string(t))
|
||||
b = b[bytes.Index(b, []byte(`<div class="pk-line pk-line-guest">`))+35:]
|
||||
b = b[bytes.Index(b, []byte(`<p>`))+3:]
|
||||
t = b[:bytes.Index(b, []byte(`<small>倍`))]
|
||||
ret.LevelSpeed, _ = strconv.ParseFloat(string(t), 64)
|
||||
b = b[bytes.Index(b, []byte(`<div class="pk-line pk-line-guest">`))+35:]
|
||||
b = b[bytes.Index(b, []byte(`<p>`))+3:]
|
||||
st := string(b[:bytes.Index(b, []byte(`</p>`))])
|
||||
st = strings.Replace(st, "<small>", "", 1)
|
||||
st = strings.Replace(st, "</small>", "", 1)
|
||||
ret.VipLevel = st
|
||||
b = b[bytes.Index(b, []byte(`<div class="pk-line pk-line-guest">`))+35:]
|
||||
b = b[bytes.Index(b, []byte(`<p>`))+3:]
|
||||
t = b[:bytes.Index(b, []byte(`</p>`))]
|
||||
ret.VipGrowthSpeed, _ = strconv.Atoi(string(t))
|
||||
b = b[bytes.Index(b, []byte(`<div class="pk-line pk-line-guest">`))+35:]
|
||||
b = b[bytes.Index(b, []byte(`<p>`))+3:]
|
||||
t = b[:bytes.Index(b, []byte(`</p>`))]
|
||||
ret.VipGrowthTotal, _ = strconv.Atoi(string(t))
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
/* -------- GroupHonorInfo -------- */
|
||||
|
||||
type (
|
||||
|
@ -57,11 +57,14 @@ func (s *Session) UploadBDH(input BdhInput) ([]byte, error) {
|
||||
}
|
||||
|
||||
const chunkSize = 256 * 1024
|
||||
var rspExt []byte
|
||||
var rspExt, chunk []byte
|
||||
offset := 0
|
||||
chunk := make([]byte, chunkSize)
|
||||
if input.Size > chunkSize {
|
||||
chunk = make([]byte, chunkSize)
|
||||
} else {
|
||||
chunk = make([]byte, input.Size)
|
||||
}
|
||||
for {
|
||||
chunk = chunk[:chunkSize]
|
||||
rl, err := io.ReadFull(input.Body, chunk)
|
||||
if errors.Is(err, io.EOF) {
|
||||
break
|
||||
@ -121,7 +124,7 @@ func (s *Session) UploadBDHMultiThread(input BdhInput, threadCount int) ([]byte,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
const blockSize int64 = 1024 * 512
|
||||
const blockSize int64 = 256 * 1024
|
||||
var (
|
||||
rspExt []byte
|
||||
completedThread uint32
|
||||
|
Loading…
x
Reference in New Issue
Block a user