mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +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/textproto"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
@ -21,51 +20,6 @@ import (
|
|||||||
"github.com/Mrs4s/MiraiGo/utils"
|
"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 -------- */
|
/* -------- GroupHonorInfo -------- */
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
@ -57,11 +57,14 @@ func (s *Session) UploadBDH(input BdhInput) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const chunkSize = 256 * 1024
|
const chunkSize = 256 * 1024
|
||||||
var rspExt []byte
|
var rspExt, chunk []byte
|
||||||
offset := 0
|
offset := 0
|
||||||
chunk := make([]byte, chunkSize)
|
if input.Size > chunkSize {
|
||||||
|
chunk = make([]byte, chunkSize)
|
||||||
|
} else {
|
||||||
|
chunk = make([]byte, input.Size)
|
||||||
|
}
|
||||||
for {
|
for {
|
||||||
chunk = chunk[:chunkSize]
|
|
||||||
rl, err := io.ReadFull(input.Body, chunk)
|
rl, err := io.ReadFull(input.Body, chunk)
|
||||||
if errors.Is(err, io.EOF) {
|
if errors.Is(err, io.EOF) {
|
||||||
break
|
break
|
||||||
@ -121,7 +124,7 @@ func (s *Session) UploadBDHMultiThread(input BdhInput, threadCount int) ([]byte,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
const blockSize int64 = 1024 * 512
|
const blockSize int64 = 256 * 1024
|
||||||
var (
|
var (
|
||||||
rspExt []byte
|
rspExt []byte
|
||||||
completedThread uint32
|
completedThread uint32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user