mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 12:21:31 +08:00
@@ -302,6 +302,17 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
||||
|
||||
<Route author="hoilc" example="/bilibili/manga/update/26009" path="/bilibili/manga/update/:comicid" :paramsDesc="['漫画 id, 可在 URL 中找到, 支持带有`mc`前缀']"/>
|
||||
|
||||
### 用户追漫更新
|
||||
|
||||
<Route author="yindaheng98" example="/bilibili/manga/followings/26009" path="/manga/followings/:uid/:limits?" :paramsDesc="['用户 id', '抓取最近更新前多少本漫画,默认为10']" selfhost="1">
|
||||
::: warning 注意
|
||||
|
||||
用户追漫需要 b 站登录后的 Cookie 值,所以只能自建,详情见部署页面的配置模块。
|
||||
|
||||
:::
|
||||
</Route>
|
||||
|
||||
|
||||
## Dev.to
|
||||
|
||||
### 最高职位
|
||||
|
||||
@@ -86,6 +86,7 @@ router.get('/bilibili/followings/article/:uid', require('./routes/bilibili/follo
|
||||
router.get('/bilibili/readlist/:listid', require('./routes/bilibili/readlist'));
|
||||
router.get('/bilibili/weekly', require('./routes/bilibili/weekly_recommend'));
|
||||
router.get('/bilibili/manga/update/:comicid', require('./routes/bilibili/manga_update'));
|
||||
router.get('/bilibili/manga/followings/:uid/:limits?', require('./routes/bilibili/manga_followings'));
|
||||
router.get('/bilibili/app/:id?', require('./routes/bilibili/app'));
|
||||
|
||||
// bangumi
|
||||
|
||||
39
lib/routes/bilibili/manga_followings.js
Normal file
39
lib/routes/bilibili/manga_followings.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const got = require('@/utils/got');
|
||||
const cache = require('./cache');
|
||||
const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const uid = String(ctx.params.uid);
|
||||
const name = await cache.getUsernameFromUID(ctx, uid);
|
||||
|
||||
const cookie = config.bilibili.cookies[uid];
|
||||
if (cookie === undefined) {
|
||||
throw Error('缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值');
|
||||
}
|
||||
const page_size = ctx.params.limits || 10;
|
||||
const link = 'https://manga.bilibili.com/account-center';
|
||||
const response = await got({
|
||||
method: 'POST',
|
||||
url: `https://manga.bilibili.com/twirp/bookshelf.v1.Bookshelf/ListFavorite?device=pc&platform=web`,
|
||||
json: { page_num: 1, page_size: page_size, order: 2, wait_free: 0 },
|
||||
headers: {
|
||||
Referer: link,
|
||||
Cookie: cookie,
|
||||
},
|
||||
});
|
||||
if (response.data.code === -6) {
|
||||
throw Error('对应 uid 的 Bilibili 用户的 Cookie 已过期');
|
||||
}
|
||||
const comics = response.data.data;
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${name} 的追漫更新 - 哔哩哔哩漫画`,
|
||||
link: link,
|
||||
item: comics.map((item) => ({
|
||||
title: `${item.title} ${item.latest_ep_short_title}`,
|
||||
description: `<img src='${item.vcover}'>`,
|
||||
pubDate: new Date(item.last_ep_publish_time + ' +0800'),
|
||||
link: `https://manga.bilibili.com/detail/mc${item.comic_id}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user