fix(route): javbus redirection (#13513)

This commit is contained in:
Tony 2023-10-12 20:19:09 +00:00 committed by GitHub
parent d296f8db92
commit 953d2fef33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -26,9 +26,14 @@ module.exports = async (ctx) => {
const currentUrl = `${isWestern ? westernUrl : rootUrl}${ctx.path.replace(/^\/western/, '').replace(/\/home/, '')}`;
const headers = {
'accept-language': 'zh-CN',
};
const response = await got({
method: 'get',
url: currentUrl,
headers,
});
const $ = cheerio.load(response.data);
@ -52,6 +57,7 @@ module.exports = async (ctx) => {
const detailResponse = await got({
method: 'get',
url: item.link,
headers,
});
const content = cheerio.load(detailResponse.data);

View File

@ -567,6 +567,12 @@ If you subscribe to [火曜ワイド「境界トラブル解決ラジオ!] (ht
## JavBus {#javbus}
:::warning
Requests from non-Asia areas will be redirected to login page.
:::
:::tip Language
You can change the language of each route to the languages listed below.