fix(route): 站酷发现有视频条目 (#8044)

This commit is contained in:
Ethan Shen
2021-08-20 14:02:52 +08:00
committed by GitHub
parent d82847f541
commit a9ca8844d4
+10 -8
View File
@@ -57,6 +57,7 @@ module.exports = async (ctx) => {
}
queries.limit = '20';
queries.page = '1';
} else {
switch (query) {
case 'home':
@@ -116,15 +117,16 @@ module.exports = async (ctx) => {
const videos = detailResponse.data.match(/source: '(https:\/\/video\.zcool\.cn\/.*)',/g);
let i = 0;
content('.video-content-box').each(function () {
if (i >= videos.length) {
return;
}
content(this).append(`<video src="${videos[i++].match(/source: '(https:\/\/video\.zcool\.cn\/.*)'/)[1]}" controls="controls">`);
});
if (videos) {
content('.video-content-box').each(function (i) {
if (i >= videos.length) {
return;
}
content(this).append(`<video src="${videos[i].match(/source: '(https:\/\/video\.zcool\.cn\/.*)'/)[1]}" controls="controls">`);
});
}
item.description = item.link.indexOf('article') < 0 ? content('.work-content-wrap').html() : content('.article-content-wraper').html();
item.description = item.link.includes('article') ? content('.work-content-wrap').html() : content('.article-content-wraper').html();
return item;
})