fix(route): sehuatang 抓取原帖失败问题 (#15993)

* 1. 修复sehuatang 403

* 修复sehuatang主页 403

* 过滤不必要的请求

* 修复XSIJISHE需要登录

* 修复XSIJISHE rank需要登录

* This does not require cookie.url

* 修复可能导致的【抓取原帖失败】问题

* Close the page right after getting page content.
This commit is contained in:
hywell 2024-06-26 14:42:06 +08:00 committed by GitHub
parent 4be07dcf34
commit 85fb1e8c17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -112,7 +112,7 @@ async function handler(ctx) {
waitUntil: 'domcontentloaded',
});
const response = await page.content();
await page.close();
const $ = load(response);
const postMessage = $("td[id^='postmessage']").slice(0, 1);
const images = $(postMessage).find('img');
@ -151,7 +151,6 @@ async function handler(ctx) {
info.enclosure_url = enclosureUrl;
info.enclosure_type = isMag ? 'application/x-bittorrent' : 'application/octet-stream';
}
return info;
})
)