Skip to content

Commit 0ddf1a6

Browse files
committed
fix: xueqiu/user, try skip xueqiu new waf firewall
1 parent 20b67e1 commit 0ddf1a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/routes/xueqiu/user.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ async function handler(ctx) {
6363
});
6464
await mainPage.waitForFunction(() => document.readyState === 'complete');
6565

66-
const apiUrl = `${rootUrl}/v4/statuses/user_timeline.json?user_id=${id}&type=${type}`;
66+
const pageUrl = new URL(mainPage.url());
67+
const md5Key = [...pageUrl.searchParams.keys()].find((key) => key.startsWith('md5__'));
68+
69+
let apiUrl = `${rootUrl}/v4/statuses/user_timeline.json?user_id=${id}&type=${type}`;
70+
if (md5Key) {
71+
apiUrl += `&${md5Key}=${pageUrl.searchParams.get(md5Key)}`;
72+
}
73+
6774
const response = await mainPage.evaluate(async (url) => {
6875
const response = await fetch(url);
6976
return response.json();

0 commit comments

Comments
 (0)