parent
0016a2e020
commit
dab7da03a8
|
|
@ -15,7 +15,7 @@ module.exports = async (category, ctx) => {
|
|||
const data = response.data;
|
||||
const list = data.rollData;
|
||||
const resultItem = await Promise.all(
|
||||
list.map(async ({ title, url, dateTime }) => {
|
||||
list.map(async ({ title, url, dateTime, image }) => {
|
||||
const item = {
|
||||
title,
|
||||
link: url,
|
||||
|
|
@ -41,6 +41,11 @@ module.exports = async (category, ctx) => {
|
|||
// 图片
|
||||
api = `http://api.cntv.cn/Article/contentinfo?id=${id}&serviceId=sjnews&t=json`;
|
||||
type = 'PHO';
|
||||
} else if (id.startsWith('VIDE')) {
|
||||
// 视频
|
||||
const vid = path.parse(image).name.split('-')[0];
|
||||
api = `http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid=${vid}`;
|
||||
type = 'VIDE';
|
||||
} else {
|
||||
// 未识别
|
||||
description = unknownTip;
|
||||
|
|
@ -71,6 +76,10 @@ module.exports = async (category, ctx) => {
|
|||
}, '');
|
||||
break;
|
||||
|
||||
case 'VIDE':
|
||||
description = `<video src="${data.hls_url}" controls="controls" poster="${image}" style="width: 100%"></video>`;
|
||||
break;
|
||||
|
||||
default:
|
||||
description = unknownTip;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue