>}
+ */
+module.exports = async function getUserIllustFollows(token) {
+ return await got({
+ method: 'get',
+ url: 'https://app-api.pixiv.net/v2/illust/follow',
+ headers: {
+ ...maskHeader,
+ Authorization: 'Bearer ' + token,
+ },
+ params: {
+ restrict: 'public',
+ },
+ });
+};
diff --git a/lib/routes/pixiv/illustfollow.js b/lib/routes/pixiv/illustfollow.js
new file mode 100644
index 0000000000..527dc14ae3
--- /dev/null
+++ b/lib/routes/pixiv/illustfollow.js
@@ -0,0 +1,35 @@
+const getToken = require('./token');
+const getIllustFollows = require('./api/getIllustFollows');
+const config = require('@/config');
+module.exports = async (ctx) => {
+ if (!config.pixiv || !config.pixiv.username || !config.pixiv.password) {
+ throw 'pixiv RSS is disabled due to the lack of relevant config';
+ }
+ if (!getToken()) {
+ throw 'pixiv not login';
+ }
+ const response = await getIllustFollows(getToken());
+ const illusts = response.data.illusts;
+ ctx.state.data = {
+ title: `Pixiv关注的新作品`,
+ link: 'https://www.pixiv.net/bookmark_new_illust.php',
+ description: `Pixiv关注的画师们的最新作品`,
+ item: illusts.map((illust) => {
+ const images = [];
+ if (illust.page_count === 1) {
+ images.push(`
`);
+ } else {
+ for (let i = 0; i < illust.page_count; i++) {
+ images.push(`
`);
+ }
+ }
+ return {
+ title: illust.title,
+ author: illust.user.name,
+ pubDate: new Date(illust.create_date).toUTCString(),
+ description: `画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}
${images.join('')}`,
+ link: `https://www.pixiv.net/member_illust.php?mode=medium&illust_id=${illust.id}`,
+ };
+ }),
+ };
+};