diff --git a/lib/routes/jandan/pic.js b/lib/routes/jandan/pic.js index 2165237ea..03ac06473 100644 --- a/lib/routes/jandan/pic.js +++ b/lib/routes/jandan/pic.js @@ -1,10 +1,6 @@ const axios = require('../../utils/axios'); const cheerio = require('cheerio'); -const base64_decode = (i) => Buffer.from(i, 'base64').toString('binary'); - -// jandan_decode is borrowed from jandan.net, which is used in function jandan_load_img. -const jandan_decode = (m) => base64_decode(m); const baseUrl = 'http://jandan.net/'; module.exports = async (ctx) => { @@ -35,21 +31,18 @@ module.exports = async (ctx) => { const imgList = []; $(item) - .find('.text .img-hash') + .find('.view_img_link') .each((_, item) => { - const imgUrl = $(item).html(); + const imgUrl = $(item).attr('href'); if (imgUrl !== undefined) { - imgList.push(jandan_decode(imgUrl).replace(/(\/\/\w+\.sinaimg\.cn\/)(\w+)(\/.+\.(gif|jpg|jpeg))/, '$1large$3')); + imgList.push(imgUrl); } }); if (imgList.length === 0) { return; } - $(item) - .find('.img-hash') - .remove(); const text = $(item) .find('.text p')