fix: bilibili输出author标签为视频作者, juejin时区转化问题 (#2879)

This commit is contained in:
zhshch2002 2019-08-19 14:19:29 +08:00 committed by DIYgod
parent 5501113f82
commit e72c5b76b1
6 changed files with 10 additions and 3 deletions

View File

@ -39,10 +39,11 @@ module.exports = async (ctx) => {
let item = hotlist[i];
item = {
title: `${item.title} - ${item.author}`,
title: `${item.title}`,
description: `${item.description}<img referrerpolicy="no-referrer" src="https:${item.pic}"><br/>Tags:${item.tag}`,
pubDate: new Date(item.pubdate).toUTCString(),
link: `https://www.bilibili.com/video/av${item.id}`,
author: item.author,
};
items.push(item);
}

View File

@ -24,10 +24,11 @@ module.exports = async (ctx) => {
item:
list &&
list.map((item) => ({
title: `${item.title} - ${item.owner.name}`,
title: `${item.title}`,
description: `${item.desc}<img referrerpolicy="no-referrer" src="${item.pic}">`,
pubDate: new Date(item.pubdate * 1000).toUTCString(),
link: `https://www.bilibili.com/video/av${item.aid}`,
author: item.owner.name,
})),
};
};

View File

@ -35,6 +35,7 @@ module.exports = async (ctx) => {
title: item.title,
description: `作者:${item.author}<br>播放量:${item.play}<br>时长:${item.duration}<br>综合得分:${item.pts}<br>弹幕:${item.video_review}<br><img referrerpolicy="no-referrer" src="${item.pic}">`,
link: `https://www.bilibili.com/video/av${item.aid}`,
author: item.author,
})),
};
};

View File

@ -37,6 +37,7 @@ module.exports = async (ctx) => {
description: `${item.desc}<br><img referrerpolicy="no-referrer" src="${item.pic}">`,
pubDate: new Date(item.pubdate * 1000).toUTCString(),
link: `https://www.bilibili.com/video/av${item.aid}`,
author: userName,
})),
};
};

View File

@ -26,6 +26,7 @@ module.exports = async (ctx) => {
description: `${item.description}<br><img referrerpolicy="no-referrer" src="https:${item.pic}">`,
pubDate: new Date(item.created * 1000).toUTCString(),
link: `https://www.bilibili.com/video/av${item.aid}`,
author: name,
})),
};
};

View File

@ -30,11 +30,13 @@ async function load(link) {
const ProcessFeed = async (list, caches) =>
await Promise.all(
list.map(async (item) => {
const pubdate = new Date();
pubdate.setTime(Date.parse(item.createdAt) - 8 * 60 * 60 * 1000);
// 列表上提取到的信息
const single = {
title: item.title,
description: `${(item.content || item.summaryInfo || '无描述').replace(/[\x00-\x08\x0b-\x0c\x0e-\x1f\x7f]/g, '')}`,
pubDate: new Date(item.createdAt).toUTCString(),
pubDate: pubdate.toUTCString(),
author: item.user.username,
link: item.originalUrl,
guid: item.originalUrl,