feat(route): Retrieve avatars from kemono pages and use them as feed images. (#13827)
This commit is contained in:
parent
d355eb416c
commit
8364aa2006
|
|
@ -23,7 +23,8 @@ module.exports = async (ctx) => {
|
|||
});
|
||||
|
||||
let items = [],
|
||||
title = '';
|
||||
title = '',
|
||||
image = undefined;
|
||||
|
||||
if (source === 'discord') {
|
||||
title = `Posts of ${id} from Discord | Kemono`;
|
||||
|
|
@ -56,6 +57,7 @@ module.exports = async (ctx) => {
|
|||
const $ = cheerio.load(response.data);
|
||||
|
||||
title = $('title').text();
|
||||
image = $('.user-header__avatar img[src]').attr('src');
|
||||
|
||||
items = await Promise.all(
|
||||
$('.card-list__items')
|
||||
|
|
@ -98,6 +100,7 @@ module.exports = async (ctx) => {
|
|||
|
||||
ctx.state.data = {
|
||||
title,
|
||||
image,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue