1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-07 20:45:53 +08:00

fix skey refresh.

This commit is contained in:
Mrs4s 2020-10-15 10:54:26 +08:00
parent 7b392cacdb
commit 9b7f533603
2 changed files with 7 additions and 3 deletions

View File

@ -877,12 +877,16 @@ func (c *QQClient) SolveFriendRequest(req *NewFriendRequest, accept bool) {
_ = c.send(pkt)
}
func (c *QQClient) getCookies() string {
func (c *QQClient) getSKey() string {
if c.sigInfo.sKeyExpiredTime < time.Now().Unix() {
c.Debug("skey expired. refresh...")
_, _ = c.sendAndWait(c.buildRequestTgtgtNopicsigPacket())
}
return fmt.Sprintf("uin=o%d; skey=%s;", c.Uin, c.sigInfo.sKey)
return string(c.sigInfo.sKey)
}
func (c *QQClient) getCookies() string {
return fmt.Sprintf("uin=o%d; skey=%s;", c.Uin, c.getSKey())
}
func (c *QQClient) getCookiesWithDomain(domain string) string {

View File

@ -85,7 +85,7 @@ func (c *QQClient) uploadGroupPtt(ip, port int32, updKey, fileKey, data, md5 []b
func (c *QQClient) uploadGroupHeadPortrait(groupCode int64, img []byte) error {
url := fmt.Sprintf(
"http://htdata3.qq.com/cgi-bin/httpconn?htcmd=0x6ff0072&ver=5520&ukey=%v&range=0&uin=%v&seq=23&groupuin=%v&filetype=3&imagetype=5&userdata=0&subcmd=1&subver=101&clip=0_0_0_0&filesize=%v",
string(c.sigInfo.sKey),
c.getSKey(),
c.Uin,
groupCode,
len(img),