diff --git a/lib/v2/picuki/profile.js b/lib/v2/picuki/profile.js index a11787661..269f9cbc3 100644 --- a/lib/v2/picuki/profile.js +++ b/lib/v2/picuki/profile.js @@ -48,8 +48,20 @@ module.exports = async (ctx) => { const $ = cheerio.load(data); // Instagram 允许最多 10 条图片/视频任意混合于一条 post,picuki 在所有情况下都会将它(们)置于 .single-photo 内 let html = ''; - $('.single-photo img,video').each((_, item) => { - html += $(item).toString(); // 可能是视频,也可能是图片,格式都比较友好,这里直接添加 + $('.single-photo img').each((_, item) => { + html += $(item).toString(); + }); + $('.single-photo video').each((_, item) => { + item = $(item); + let videoSrc = item.attr('src'); + if (videoSrc === undefined) { + videoSrc = item.children().attr('src'); + } + const videoPoster = item.attr('poster'); + html += art(path.join(__dirname, 'templates/video.art'), { + videoSrc, + videoPoster, + }); }); return html; } diff --git a/lib/v2/picuki/templates/video.art b/lib/v2/picuki/templates/video.art new file mode 100644 index 000000000..67e673cab --- /dev/null +++ b/lib/v2/picuki/templates/video.art @@ -0,0 +1,3 @@ +