fix(route): gamer ani (#14621)

This commit is contained in:
Tony 2024-03-02 04:28:57 +08:00 committed by GitHub
parent 62b5a84159
commit 90d0b33feb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 103 additions and 71 deletions

View File

@ -433,8 +433,8 @@ router.get('/miniflux/subscription/:parameters?', lazyloadRouteHandler('./routes
router.get('/miniflux/:feeds/:parameters?', lazyloadRouteHandler('./routes/miniflux/get-entries'));
// 動畫瘋
router.get('/anigamer/new_anime', lazyloadRouteHandler('./routes/anigamer/new-anime'));
router.get('/anigamer/anime/:sn', lazyloadRouteHandler('./routes/anigamer/anime'));
// router.get('/anigamer/new_anime', lazyloadRouteHandler('./routes/anigamer/new-anime'));
// router.get('/anigamer/anime/:sn', lazyloadRouteHandler('./routes/anigamer/anime'));
// 中国药科大学
router.get('/cpu/home', lazyloadRouteHandler('./routes/universities/cpu/home'));

View File

@ -1,14 +0,0 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const { anime } = await got.get(`https://api.gamer.com.tw/mobile_app/anime/v1/video.php?sn=0&anime_sn=${ctx.params.sn}`).then((r) => r.data);
ctx.state.data = {
title: anime.title,
link: `https://ani.gamer.com.tw/animeRef.php?sn=${anime.anime_sn}`,
description: `<img src="${anime.cover}"> ` + anime.content.trim(),
item: anime.volumes[0].map((item) => ({
title: `${anime.title}${item.volume}`,
link: `https://ani.gamer.com.tw/animeVideo.php?sn=${item.video_sn}`,
})),
};
};

View File

@ -1,22 +0,0 @@
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
const timezone = require('@/utils/timezone');
module.exports = async (ctx) => {
const rootUrl = 'https://ani.gamer.com.tw';
const response = await got.get('https://api.gamer.com.tw/mobile_app/anime/v3/index.php');
const newAnime = response.data.data.newAnime;
ctx.state.data = {
title: '動畫瘋最後更新',
link: `${rootUrl}/`,
item: newAnime.date.map((item) => {
const date = `${item.upTime} ${item.upTimeHours}`;
return {
title: `${item.title} ${item.volume}`,
description: `<img src="${item.cover}">`,
link: `${rootUrl}/animeVideo.php?sn=${item.videoSn}`,
pubDate: timezone(parseDate(date, 'MM/DD HH:mm'), +8),
};
}),
};
};

View File

@ -0,0 +1,33 @@
import got from '@/utils/got';
module.exports = async (ctx) => {
const { sn } = ctx.req.param();
const { data: response } = await got('https://api.gamer.com.tw/mobile_app/anime/v3/video.php', {
searchParams: {
sn,
},
});
if (response.error) {
throw new Error(response.error.message);
}
const anime = response.data.anime;
const title = anime.title.replaceAll(/\[\d+?]$/g, '').trim();
const items = anime.volumes[0]
.map((item) => ({
title: `${title}${item.volume}`,
description: `<img src="${item.cover}">`,
link: `https://ani.gamer.com.tw/animeVideo.php?sn=${item.video_sn}`,
}))
.toReversed();
ctx.set('data', {
title,
link: `https://ani.gamer.com.tw/animeRef.php?sn=${anime.anime_sn}`,
description: anime.content?.trim(),
item: items,
});
};

View File

@ -0,0 +1,21 @@
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
module.exports = async (ctx) => {
const rootUrl = 'https://ani.gamer.com.tw';
const { data: response } = await got('https://api.gamer.com.tw/mobile_app/anime/v3/index.php');
const items = response.data.newAnime.date.map((item) => ({
title: `${item.title} ${item.volume}`,
description: `<img src="${item.cover}">`,
link: `${rootUrl}/animeVideo.php?sn=${item.videoSn}`,
pubDate: timezone(parseDate(`${item.upTime} ${item.upTimeHours}`, 'MM/DD HH:mm'), +8),
}));
ctx.set('data', {
title: '動畫瘋最後更新',
link: rootUrl,
item: items,
});
};

View File

@ -1,4 +1,6 @@
module.exports = {
'/anime/:sn': ['maple3142'],
'/gnn/:category?': ['Arracc'],
'/hot/:bsn': ['nczitzk', 'TonyRL'],
'/new_anime': ['maple3142'],
};

View File

@ -4,15 +4,29 @@ module.exports = {
acg: [
{
title: 'GNN 新聞',
docs: 'https://docs.rsshub.app/routes/bbs#ba-ha-mu-te-dian-wan-zi-xun-zhan',
docs: 'https://docs.rsshub.app/routes/anime#ba-ha-mu-te-dian-wan-zi-xun-zhan',
source: ['/news.php'],
target: (params, url) => `/gamer/gnn/${new URL(url).searchParams.get('p')}`,
},
],
ani: [
{
title: '動畫瘋 - 最後更新',
docs: 'https://docs.rsshub.app/routes/anime#ba-ha-mu-te-dian-wan-zi-xun-zhan',
source: ['/'],
target: '/gamer/new_anime',
},
{
title: '動畫瘋 - 動畫',
docs: 'https://docs.rsshub.app/routes/anime#ba-ha-mu-te-dian-wan-zi-xun-zhan',
source: ['/animeVideo.php'],
target: (_params, url) => `/gamer/anime/${new URL(url).searchParams.get('sn')}`,
},
],
forum: [
{
title: '熱門推薦',
docs: 'https://docs.rsshub.app/routes/bbs#ba-ha-mu-te-dian-wan-zi-xun-zhan',
docs: 'https://docs.rsshub.app/routes/anime#ba-ha-mu-te-dian-wan-zi-xun-zhan',
source: ['/A.php', '/B.php'],
target: (params, url) => `/gamer/hot/${new URL(url).searchParams.get('bsn')}`,
},
@ -20,7 +34,7 @@ module.exports = {
gnn: [
{
title: 'GNN 新聞',
docs: 'https://docs.rsshub.app/routes/bbs#ba-ha-mu-te-dian-wan-zi-xun-zhan',
docs: 'https://docs.rsshub.app/routes/anime#ba-ha-mu-te-dian-wan-zi-xun-zhan',
source: ['/index.php'],
target: (params, url) => `/gamer/gnn/${new URL(url).searchParams.get('k')}`,
},

View File

@ -1,4 +1,6 @@
module.exports = function (router) {
router.get('/ani/anime/:sn', './ani/anime');
router.get('/ani/new_anime', './ani/new-anime');
router.get('/gnn/:category?', './gnn-index');
router.get('/hot/:bsn', './hot');
};

View File

@ -556,6 +556,32 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv
<Route author="xueli-sherryli" example="/oreno3d/origins/3/latest/1" path="/oreno3d/origins/:originid/:sort/:pagelimit?" paramsDesc={['Origin id, can be found in URL' , 'Sort method, see the table above', 'The maximum number of pages to be crawled, the default is 1']} radar="1" />
## 巴哈姆特電玩資訊站 {#ba-ha-mu-te-dian-wan-zi-xun-zhan}
### GNN 新聞 {#ba-ha-mu-te-dian-wan-zi-xun-zhan-gnn-xin-wen}
<Route author="Arracc" example="/gamer/gnn/1" path="/gamer/gnn/:category?" paramsDesc={['版块']} notOperational="1">
| 首頁 | PC | TV 掌機 | 手機遊戲 | 動漫畫 | 主題報導 | 活動展覽 | 電競 |
| ---- | -- | ------- | -------- | ------ | -------- | -------- | ---- |
| 缺省 | 1 | 3 | 4 | 5 | 9 | 11 | 13 |
| Switch | PS5 | PS4 | XboxOne | XboxSX | PC 單機 | PC 線上 | iOS | Android | Web | 漫畫 | 動畫 |
| ------ | --- | --- | ------- | ------ | ------- | ------- | --- | ------- | --- | ----- | ----- |
| ns | ps5 | ps4 | xbone | xbsx | pc | olg | ios | android | web | comic | anime |
</Route>
### 熱門推薦 {#ba-ha-mu-te-dian-wan-zi-xun-zhan-re-men-tui-jian}
<Route author="nczitzk" example="/gamer/hot/47157" path="/gamer/hot/:bsn" paramsDesc={['板块 id在 URL 可以找到']} />
### 動畫瘋 - 最後更新 {#ba-ha-mu-te-dian-wan-zi-xun-zhan-dong-hua-feng-zui-hou-geng-xin}
<Route author="maple3142" example="/gamer/ani/new_anime" path="/gamer/ani/new_anime" />
### 動畫瘋 - 動畫 {#ba-ha-mu-te-dian-wan-zi-xun-zhan-dong-hua-feng-dong-hua}
<Route author="maple3142" example="/gamer/ani/anime/36868" path="/gamer/ani/anime/:sn" paramsDesc={['動畫 sn在 URL 可以找到']} radar="1" />
## 包子漫画 {#bao-zi-man-hua}
### 订阅漫画 {#bao-zi-man-hua-ding-yue-man-hua}
@ -578,16 +604,6 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv
| manhuaqingbao | qingxiaoshuoqingbao | manhuazhoubian | shengyouqingbao | yinyuezixun | youxizixun | meituxinshang | manzhanqingbao | dazahui |
</Route>
## 動畫瘋 {#dong-hua-feng}
### 最後更新 {#dong-hua-feng-zui-hou-geng-xin}
<Route author="maple3142" example="/anigamer/new_anime" path="/anigamer/new_anime" />
### 動畫 {#dong-hua-feng-dong-hua}
<Route author="maple3142" example="/anigamer/anime/90003" path="/anigamer/anime/:sn" paramsDesc={['動畫 sn']} notOperational="1" />
## 動漫狂 {#dong-man-kuang}
### 漫画更新 {#dong-man-kuang-man-hua-geng-xin}

View File

@ -374,12 +374,6 @@ If you opt to enable `fulltext` feature, consider adding `limit` parameter to yo
<Route author="TonyRL" example="/zuvio/student5/boards" path="/zuvio/student5/boards" />
## 巴哈姆特電玩資訊站 {#ba-ha-mu-te-dian-wan-zi-xun-zhan}
### 熱門推薦 {#ba-ha-mu-te-dian-wan-zi-xun-zhan-re-men-tui-jian}
<Route author="nczitzk" example="/gamer/hot/47157" path="/gamer/hot/:bsn" paramsDesc={['板块 id在 URL 可以找到']} />
## 百度贴吧 {#bai-du-tie-ba}
### 帖子列表 {#bai-du-tie-ba-tie-zi-lie-biao}

View File

@ -624,20 +624,6 @@ Due to the regional restrictions, an RSSHub deployment in China Mainland may not
The year, month and day provided under UTC time zone are the same as the official website, so please ignore the specific time!!!
</Route>
## 巴哈姆特 {#ba-ha-mu-te}
### GNN 新聞 {#ba-ha-mu-te-gnn-xin-wen}
<Route author="Arracc" example="/gamer/gnn/1" path="/gamer/gnn/:category?" paramsDesc={['版块']} notOperational="1">
| 首頁 | PC | TV 掌機 | 手機遊戲 | 動漫畫 | 主題報導 | 活動展覽 | 電競 |
| ---- | -- | ------- | -------- | ------ | -------- | -------- | ---- |
| 缺省 | 1 | 3 | 4 | 5 | 9 | 11 | 13 |
| Switch | PS5 | PS4 | XboxOne | XboxSX | PC 單機 | PC 線上 | iOS | Android | Web | 漫畫 | 動畫 |
| ------ | --- | --- | ------- | ------ | ------- | ------- | --- | ------- | --- | ----- | ----- |
| ns | ps5 | ps4 | xbone | xbsx | pc | olg | ios | android | web | comic | anime |
</Route>
## 触乐 {#chu-le}
### 栏目 {#chu-le-lan-mu}