From e72c5b76b185ac9df2f1da4fd4abe4c5d9a67160 Mon Sep 17 00:00:00 2001
From: zhshch2002 <29043215+zhshch2002@users.noreply.github.com>
Date: Mon, 19 Aug 2019 14:19:29 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20bilibili=E8=BE=93=E5=87=BAauthor?=
=?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=B8=BA=E8=A7=86=E9=A2=91=E4=BD=9C=E8=80=85?=
=?UTF-8?q?,=20juejin=E6=97=B6=E5=8C=BA=E8=BD=AC=E5=8C=96=E9=97=AE?=
=?UTF-8?q?=E9=A2=98=20(#2879)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/routes/bilibili/partion-ranking.js | 3 ++-
lib/routes/bilibili/partion.js | 3 ++-
lib/routes/bilibili/ranking.js | 1 +
lib/routes/bilibili/userChannel.js | 1 +
lib/routes/bilibili/video.js | 1 +
lib/routes/juejin/utils.js | 4 +++-
6 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/routes/bilibili/partion-ranking.js b/lib/routes/bilibili/partion-ranking.js
index 029479a38..2ccc99773 100644
--- a/lib/routes/bilibili/partion-ranking.js
+++ b/lib/routes/bilibili/partion-ranking.js
@@ -39,10 +39,11 @@ module.exports = async (ctx) => {
let item = hotlist[i];
item = {
- title: `${item.title} - ${item.author}`,
+ title: `${item.title}`,
description: `${item.description}
Tags:${item.tag}`,
pubDate: new Date(item.pubdate).toUTCString(),
link: `https://www.bilibili.com/video/av${item.id}`,
+ author: item.author,
};
items.push(item);
}
diff --git a/lib/routes/bilibili/partion.js b/lib/routes/bilibili/partion.js
index 3efc18956..e79c2eb99 100644
--- a/lib/routes/bilibili/partion.js
+++ b/lib/routes/bilibili/partion.js
@@ -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}
`,
pubDate: new Date(item.pubdate * 1000).toUTCString(),
link: `https://www.bilibili.com/video/av${item.aid}`,
+ author: item.owner.name,
})),
};
};
diff --git a/lib/routes/bilibili/ranking.js b/lib/routes/bilibili/ranking.js
index d68177209..85917b888 100644
--- a/lib/routes/bilibili/ranking.js
+++ b/lib/routes/bilibili/ranking.js
@@ -35,6 +35,7 @@ module.exports = async (ctx) => {
title: item.title,
description: `作者:${item.author}
播放量:${item.play}
时长:${item.duration}
综合得分:${item.pts}
弹幕:${item.video_review}
`,
link: `https://www.bilibili.com/video/av${item.aid}`,
+ author: item.author,
})),
};
};
diff --git a/lib/routes/bilibili/userChannel.js b/lib/routes/bilibili/userChannel.js
index 531866f9d..8a76679e1 100644
--- a/lib/routes/bilibili/userChannel.js
+++ b/lib/routes/bilibili/userChannel.js
@@ -37,6 +37,7 @@ module.exports = async (ctx) => {
description: `${item.desc}
`,
pubDate: new Date(item.pubdate * 1000).toUTCString(),
link: `https://www.bilibili.com/video/av${item.aid}`,
+ author: userName,
})),
};
};
diff --git a/lib/routes/bilibili/video.js b/lib/routes/bilibili/video.js
index 208b6498b..c1e7b4889 100644
--- a/lib/routes/bilibili/video.js
+++ b/lib/routes/bilibili/video.js
@@ -26,6 +26,7 @@ module.exports = async (ctx) => {
description: `${item.description}
`,
pubDate: new Date(item.created * 1000).toUTCString(),
link: `https://www.bilibili.com/video/av${item.aid}`,
+ author: name,
})),
};
};
diff --git a/lib/routes/juejin/utils.js b/lib/routes/juejin/utils.js
index ac8e85dcd..3435a275b 100644
--- a/lib/routes/juejin/utils.js
+++ b/lib/routes/juejin/utils.js
@@ -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,