Skip to content

Commit

Permalink
feat(route): pixiv user activity caption (#13489)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Oct 10, 2023
1 parent 0bc7dbf commit 9333ac4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/v2/pixiv/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ module.exports = async (ctx) => {
title: illust.title,
author: username,
pubDate: parseDate(illust.create_date),
description: `<p>画师:${username} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p>${images.join('')}`,
description: `${illust.caption}<br><p>画师:${username} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p>${images.join('')}`,
link: `https://www.pixiv.net/artworks/${illust.id}`,
category: illust.tags.map((t) => t.name),
};
}),
};
Expand Down
4 changes: 2 additions & 2 deletions lib/v2/pixiv/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module.exports = {
getImgs(illust) {
const images = [];
if (illust.meta_pages?.length) {
for (let i = 0; i < illust.meta_pages.length; i++) {
const original = illust.meta_pages[i].image_urls.original.replace('https://i.pximg.net', config.pixiv.imgProxy);
for (const page of illust.meta_pages) {
const original = page.image_urls.original.replace('https://i.pximg.net', config.pixiv.imgProxy);
images.push(`<p><img src="${original}"/></p>`);
}
} else if (illust.meta_single_page.original_image_url) {
Expand Down

0 comments on commit 9333ac4

Please sign in to comment.