fix: BOOKWALKERTW、二柄APP图片显示错误 (#5999)

Co-authored-by: codefactor-io <support@codefactor.io>
Co-authored-by: Henry Wang <hi@henry.wang>
This commit is contained in:
wushijishan 2020-10-26 01:44:14 +08:00 committed by GitHub
parent 5ae2913e30
commit b5ca6d032b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,7 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
bookid = item.find('a').attr('href').substring(38, 43);
bookid = item.find('a').attr('href').split('/')[4];
return {
title: item.find('.bookname').text(),
description: `${item.find('.booknamesub').text()}&nbsp;|&nbsp;${item.find('.bprice').text()}<br><img src="https://image.bookwalker.com.tw/upload/product/${bookid}/zoom_big_${bookid}.jpg">`,

View File

@ -17,6 +17,8 @@ module.exports = async (ctx) => {
let description = item.content;
if (item.video_img !== null) {
description += `<br><img src="${item.video_img}">`;
} else if (item.acontent.indexOf('104129') !== -1) {
description += `<br><img src="${item.article.humb.split('?')[0]}">`;
} else {
const imgs = item.acontent.split(',');
for (let i = 0; i < imgs.length; i++) {