parent
b8984e5eba
commit
7ad43e7aec
|
|
@ -15,6 +15,14 @@ const ProcessFeed = async (list, cache) => {
|
|||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const __INITIAL_STATE__ = Function(
|
||||
'let window={};' +
|
||||
$('*')
|
||||
.html()
|
||||
.match(/window\.__INITIAL_STATE__.*};/gm)[0] +
|
||||
'return window.__INITIAL_STATE__'
|
||||
)();
|
||||
|
||||
$('.article__content')
|
||||
.find('.lazyImg')
|
||||
.each((i, e) => {
|
||||
|
|
@ -34,9 +42,8 @@ const ProcessFeed = async (list, cache) => {
|
|||
|
||||
let description = '';
|
||||
|
||||
const videoMatch = response.data.match(/"hd_link":"(.*)"/);
|
||||
if (videoMatch !== null) {
|
||||
description += `<video height="100%" controls="controls" src="${videoMatch[1].replace(/\\u002F/g, '/')}"></video>`;
|
||||
if ('video_info' in __INITIAL_STATE__.articleDetail.articleDetail) {
|
||||
description += `<video height="100%" cover="${__INITIAL_STATE__.articleDetail.articleDetail.video_info.cover}" controls src="${__INITIAL_STATE__.articleDetail.articleDetail.video_info.hd_link}"></video>`;
|
||||
}
|
||||
if ($('.top-img').html() !== null) {
|
||||
description += $('.top-img').html();
|
||||
|
|
|
|||
Loading…
Reference in New Issue