Skip to content

Commit

Permalink
fix(route): javbus redirection (#13513)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Oct 12, 2023
1 parent d296f8d commit 953d2fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/v2/javbus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -52,6 +57,7 @@ module.exports = async (ctx) => {
const detailResponse = await got({
method: 'get',
url: item.link,
headers,
});

const content = cheerio.load(detailResponse.data);
Expand Down
6 changes: 6 additions & 0 deletions website/docs/routes/multimedia.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 953d2fe

Please sign in to comment.