feat(route): add アニメ新番組 (#10559)
* add アニメ新番組 * Delete and modify character symbols * Using art-template * Modify url hash * Define art and path * Change back to post method * Modify the post method * feat(route): add アニメ新番組 * fix: typo
This commit is contained in:
parent
ac59559646
commit
a072942c28
|
|
@ -652,3 +652,9 @@ Sources
|
|||
### 最新汉化
|
||||
|
||||
<Route author="junfengP" example="/zdfx" path="/zdfx"/>
|
||||
|
||||
## アニメ新番組
|
||||
|
||||
### 當季新番
|
||||
|
||||
<Route author="devinmugen" example="/bangumi/online" path="/bangumi/online"/>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
module.exports = {
|
||||
'/online': ['devinmugen'],
|
||||
'/': ['nczitzk'],
|
||||
'/:tags?': ['nczitzk'],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
const got = require('@/utils/got');
|
||||
const { art } = require('@/utils/render');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = 'https://bangumi.online/api/home';
|
||||
|
||||
const response = await got.post(url);
|
||||
|
||||
const list = response.data.data.list;
|
||||
|
||||
const items = list.map((item) => ({
|
||||
title: `${item.title_zh} - 第 ${item.volume} 集`,
|
||||
description: art(path.join(__dirname, 'templates/image.art'), {
|
||||
src: `https:${item.cover}`,
|
||||
alt: `${item.title_zh} - 第 ${item.volume} 集`,
|
||||
}),
|
||||
link: `https://bangumi.online/watch/${item.vid}`,
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'アニメ新番組',
|
||||
link: 'https://bangumi.online',
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = {
|
||||
'萌番组 Bangumi Moe': {
|
||||
_name: 'bangumi.moe',
|
||||
'bangumi.moe': {
|
||||
_name: '萌番組',
|
||||
'.': [
|
||||
{
|
||||
title: '最新',
|
||||
|
|
@ -16,4 +16,15 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'bangumi.online': {
|
||||
_name: 'アニメ新番組',
|
||||
'.': [
|
||||
{
|
||||
title: '當季新番',
|
||||
docs: 'https://docs.rsshub.app/anime.html#アニメ-xin-fan-zu-dang-ji-xin-fan',
|
||||
source: ['/'],
|
||||
target: '/bangumi/online',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/online', require('./online'));
|
||||
router.get(/([\w-/]+)?/, require('./index'));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<img src="{{ src }}" alt="{{ alt }}">
|
||||
Loading…
Reference in New Issue