feat(route): bilibili 综合热门 (#10343)
* feat(route): bilibili 综合热门 * fix: update maintainers * refactor: sort router
This commit is contained in:
parent
d5af636a4c
commit
4f44368056
|
|
@ -290,6 +290,10 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
|||
|
||||
<Route author="DIYgod" example="/bilibili/mall/ip/0_3000294" path="/bilibili/mall/ip/:id" :paramsDesc="['作品 id, 可在作品列表页 URL 中找到']"/>
|
||||
|
||||
### 综合热门
|
||||
|
||||
<Route author="ziminliu" example="/bilibili/popular/all" path="/bilibili/popular/all" />
|
||||
|
||||
### 排行榜
|
||||
|
||||
<Route author="DIYgod" example="/bilibili/ranking/0/3/1" path="/bilibili/ranking/:tid/:days?/:arc_type?/:disableEmbed?" :paramsDesc="['排行榜分区 id, 默认 0', '时间跨度, 可为 1 3 7 30', '投稿时间, 可为 0(全部投稿) 1(近期投稿) , 默认 1', '默认为开启内嵌视频, 任意值为关闭']">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
module.exports = {
|
||||
'/app/:id?': ['nczitzk'],
|
||||
'/audio/:id': ['LogicJake'],
|
||||
'/blackboard': ['Qixingchen'],
|
||||
'/bangumi/:seasonid': ['DIYgod'],
|
||||
'/bangumi/media/:mediaid': ['DIYgod'],
|
||||
'/fav/:uid/:fid/:disableEmbed?': ['Qixingchen'],
|
||||
'/followings/article/:uid': ['woshiluo'],
|
||||
'/followings/dynamic/:uid/:disableEmbed?': ['TigerCubDen'],
|
||||
'/followings/video/:uid/:disableEmbed?': ['LogicJake'],
|
||||
'/link/news/:product': ['Qixingchen'],
|
||||
'/live/area/:areaID/:order': ['Qixingchen'],
|
||||
'/live/room/:roomID': ['Qixingchen'],
|
||||
'/live/search/:key/:order': ['Qixingchen'],
|
||||
'/mall/new/:category?': ['DIYgod'],
|
||||
'/mall/ip/:id': ['DIYgod'],
|
||||
'/manga/update/:comicid': ['hoilc'],
|
||||
'/manga/followings/:uid/:limits?': ['yindaheng98'],
|
||||
'/online/:disableEmbed?': ['TigerCubDen'],
|
||||
'/partion/:tid/:disableEmbed?': ['DIYgod'],
|
||||
'/partion/ranking/:tid/:days?/:disableEmbed?': ['lengthmin'],
|
||||
'/popular/all': ['ziminliu'],
|
||||
'/ranking/:rid?/:day?/:arc_type?/:disableEmbed?': ['DIYgod'],
|
||||
'/readlist/:listid': ['hoilc'],
|
||||
'/topic/:topic': ['Qixingchen'],
|
||||
'/user/article/:uid': ['lengthmin'],
|
||||
'/user/bangumi/:uid/:type?': ['wdssmq'],
|
||||
'/user/channel/:uid/:cid/:disableEmbed?': ['HenryQW'],
|
||||
'/user/coin/:uid/:disableEmbed?': ['DIYgod'],
|
||||
'/user/dynamic/:uid/:disableEmbed?': ['DIYgod', 'zytomorrow'],
|
||||
'/user/fav/:uid/:disableEmbed?': ['DIYgod'],
|
||||
'/user/followers/:uid': ['Qixingchen'],
|
||||
'/user/followings/:uid': ['Qixingchen'],
|
||||
'/user/video/:uid/:disableEmbed?': ['DIYgod'],
|
||||
'/video/danmaku/:bvid/:pid?': ['Qixingchen'],
|
||||
'/video/page/:bvid/:disableEmbed?': ['sxzz'],
|
||||
'/video/reply/:bvid': ['Qixingchen'],
|
||||
'/vsearch/:kw/:order?/:disableEmbed?/:tid?': ['Symty'],
|
||||
'/weekly/:disableEmbed?': ['ttttmr'],
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
const got = require('@/utils/got');
|
||||
const utils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const disableEmbed = ctx.params.disableEmbed;
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `https://api.bilibili.com/x/web-interface/popular`,
|
||||
headers: {
|
||||
Referer: 'https://www.bilibili.com/',
|
||||
},
|
||||
});
|
||||
const list = response.data.data.list;
|
||||
|
||||
ctx.state.data = {
|
||||
title: `bilibili 综合热门`,
|
||||
link: 'https://www.bilibili.com',
|
||||
description: `bilibili 综合热门`,
|
||||
item:
|
||||
list &&
|
||||
list.map((item) => ({
|
||||
title: item.title,
|
||||
description: `${item.desc}${!disableEmbed ? `<br><br>${utils.iframe(item.aid)}` : ''}<br><img src="${item.pic}">`,
|
||||
pubDate: new Date(item.pubdate * 1000).toUTCString(),
|
||||
link: item.pubdate > utils.bvidTime && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.aid}`,
|
||||
author: item.owner.name,
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
|
@ -19,6 +19,7 @@ module.exports = (router) => {
|
|||
router.get('/online/:disableEmbed?', require('./online'));
|
||||
router.get('/partion/:tid/:disableEmbed?', require('./partion'));
|
||||
router.get('/partion/ranking/:tid/:days?/:disableEmbed?', require('./partion-ranking'));
|
||||
router.get('/popular/all', require('./popular'));
|
||||
router.get('/ranking/:rid?/:day?/:arc_type?/:disableEmbed?', require('./ranking'));
|
||||
router.get('/readlist/:listid', require('./readlist'));
|
||||
router.get('/topic/:topic', require('./topic'));
|
||||
|
|
@ -35,5 +36,5 @@ module.exports = (router) => {
|
|||
router.get('/video/page/:bvid/:disableEmbed?', require('./page'));
|
||||
router.get('/video/reply/:bvid', require('./reply'));
|
||||
router.get('/vsearch/:kw/:order?/:disableEmbed?/:tid?', require('./vsearch'));
|
||||
router.get('/weekly', require('./weekly_recommend'));
|
||||
router.get('/weekly/:disableEmbed?', require('./weekly_recommend'));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue