Merge pull request #6684 from troyliu0105/porn-images-xxx
fix: use story path to show all pics
This commit is contained in:
commit
2d849bf1fc
|
|
@ -20,7 +20,7 @@ exports.processFeed = async function processFeed(ctx, link) {
|
|||
list.map(async (info) => {
|
||||
const title = info.title.trim();
|
||||
const date = info.date;
|
||||
const itemUrl = host + info.link;
|
||||
const itemUrl = host + 'story' + info.link.replace('/image', '');
|
||||
|
||||
const cache = await ctx.cache.get(itemUrl);
|
||||
if (cache) {
|
||||
|
|
@ -29,15 +29,21 @@ exports.processFeed = async function processFeed(ctx, link) {
|
|||
|
||||
const response = await got.get(itemUrl);
|
||||
const $ = cheerio.load(response.data);
|
||||
const images = $('.icon-overlay > a > img');
|
||||
const desc = cheerio.html(images);
|
||||
const images = $('amp-img')
|
||||
.map(function (index, element) {
|
||||
element = $(element);
|
||||
const img_src = element.attr('src');
|
||||
return `<img src=${img_src} referrerpolicy="no-referrer" alt="">`;
|
||||
})
|
||||
.get()
|
||||
.join(' ');
|
||||
const item = {
|
||||
title: title,
|
||||
link: itemUrl,
|
||||
description: desc,
|
||||
description: images,
|
||||
pubDate: new Date(date).toUTCString(),
|
||||
};
|
||||
if (desc) {
|
||||
if (images) {
|
||||
ctx.cache.set(itemUrl, JSON.stringify(item));
|
||||
}
|
||||
return Promise.resolve(item);
|
||||
|
|
|
|||
Loading…
Reference in New Issue