From 1218f197fd123a6efc5eb807a0c0ff80b9cb205d Mon Sep 17 00:00:00 2001 From: Troy Liu Date: Tue, 12 Jan 2021 00:16:08 +0800 Subject: [PATCH 1/2] fix: use story path to show all pics --- lib/routes/hentai-cosplays/utils.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/routes/hentai-cosplays/utils.js b/lib/routes/hentai-cosplays/utils.js index 85be00b28..bbe000d79 100644 --- a/lib/routes/hentai-cosplays/utils.js +++ b/lib/routes/hentai-cosplays/utils.js @@ -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 ``; + }) + .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); From c89ff78f28d184a81097dfdfe8629f5d435ce971 Mon Sep 17 00:00:00 2001 From: NeverBehave Date: Tue, 12 Jan 2021 16:55:37 -0500 Subject: [PATCH 2/2] dep: lock headless chrome version (#6685) * fix typo in workflow * fix: lock headless chrome for now to avoid detection close #6680 --- docker-compose.yml | 3 ++- scripts/ansible/rsshub.yaml | 2 +- scripts/workflow/test-route/identify.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 238c7e35a..08fa2adeb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,8 @@ services: - browserless browserless: - image: browserless/chrome + # See issue 6680 + image: browserless/chrome:1.43-chrome-stable restart: always redis: diff --git a/scripts/ansible/rsshub.yaml b/scripts/ansible/rsshub.yaml index 33671a51c..0affa63bd 100644 --- a/scripts/ansible/rsshub.yaml +++ b/scripts/ansible/rsshub.yaml @@ -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: diff --git a/scripts/workflow/test-route/identify.js b/scripts/workflow/test-route/identify.js index 7fcf08fe4..1348642f6 100644 --- a/scripts/workflow/test-route/identify.js +++ b/scripts/workflow/test-route/identify.js @@ -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) => {