From fcd51ea86216dfd1f8277241a97e008ffbd76fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E7=91=BE?= Date: Sat, 14 Sep 2024 21:21:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=8D=A2=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=BA=E5=AE=98=E6=96=B9=E7=B2=BE=E5=8D=8E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/index.ts | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/core/index.ts b/src/core/index.ts index 46966bf..772fba1 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1122,23 +1122,33 @@ export class AdapterICQQ implements KarinAdapter { return list } - async GetEssenceMessageList (group_id: string, page: number, page_size: number): Promise> { + async GetEssenceMessageList (group_id: string, page: number = 0, page_size: number = 20): Promise> { + if (page_size > 50) page_size = 50 + const list: Array = [] - /** 扒出来一个奇怪的接口。。。 */ - const url = `https://qun.qq.com/essence/indexPc?gc=${group_id}` + const random = Math.floor(Math.random() * 10000) + const url = `https://qun.qq.com/cgi-bin/group_digest/digest_list?random=${random}&X-CROSS-ORIGIN=fetch&group_code=${group_id}&page_start=${page}&page_limit=${page_size}&bkn=${this.super.bkn}` const headers = { - 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) QQ/9.6.5.28778 Chrome/43.0.2357.134 Safari/537.36 QBCore/3.43.1298.400 QQBrowser/9.0.2524.400', Host: 'qun.qq.com', + 'User-Agent': 'QQ/8.9.28.635 CFNetwork/1312 Darwin/21.0.0', + Connection: 'keep-alive', + Accept: 'application/json, text/plain, */*', + 'Accept-Encoding': 'gzip, deflate, br', + 'Accept-Language': 'zh-CN', Cookie: this.super.cookies['qun.qq.com'], + 'Sec-Fetch-Dest': 'empty', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Site': 'cross-site', + 'sec-ch-ua': '"Not/A)Brand";v="8", "Chromium";v="126"', + 'sec-ch-ua-mobile': '?0', + 'sec-ch-ua-platform': '"Windows"', } const result = await axios.get(url, { headers }) - const text = result.data.match(/