Merge branch 'master' of https://github.com/DIYgod/RSSHub into uestc_sice_notice
This commit is contained in:
commit
28dd0e89d5
|
|
@ -16,7 +16,8 @@ services:
|
|||
- browserless
|
||||
|
||||
browserless:
|
||||
image: browserless/chrome
|
||||
# See issue 6680
|
||||
image: browserless/chrome:1.43-chrome-stable
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
name: Create and start browserless container
|
||||
docker_container:
|
||||
name: browserless
|
||||
image: browserless/chrome
|
||||
image: browserless/chrome:1.43-chrome-stable
|
||||
state: started
|
||||
restart_policy: always
|
||||
published_ports:
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ Auto Route test failed, please check your PR body format and reopen pull request
|
|||
.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_nulber: number,
|
||||
pull_number: number,
|
||||
state: 'closed',
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue