diff --git a/.gitignore b/.gitignore
index e274d3a3b3..21d18f03cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ yarn-error.log
tmp
newrelic_agent.log
*.swp
+*.iml
diff --git a/docs/README.md b/docs/README.md
index 5a4612bce6..04a9a75e34 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -686,6 +686,10 @@ GitHub 官方也提供了一些 RSS:
+### 虎牙直播
+
+
+
## 音视频
### bilibili
diff --git a/router.js b/router.js
index 61902d5454..3b4cebf4af 100644
--- a/router.js
+++ b/router.js
@@ -265,6 +265,9 @@ router.get('/douyu/room/:id', require('./routes/douyu/room'));
// 熊猫直播
router.get('/panda/room/:id', require('./routes/panda/room'));
+// 虎牙
+router.get('/huya/live/:id', require('./routes/huya/live'));
+
// v2ex
router.get('/v2ex/topics/:type', require('./routes/v2ex/topics'));
diff --git a/routes/bangumi/subject/ep.js b/routes/bangumi/subject/ep.js
index d0329a929e..0dfd4d19be 100644
--- a/routes/bangumi/subject/ep.js
+++ b/routes/bangumi/subject/ep.js
@@ -1,5 +1,4 @@
const axios = require('../../../utils/axios');
-const DateTime = require('luxon').DateTime;
module.exports = async (subjectID) => {
const url = `https://api.bgm.tv/subject/${subjectID}?responseGroup=large`;
@@ -19,7 +18,7 @@ module.exports = async (subjectID) => {
item: activeEps.reverse().map((e) => ({
title: `ep.${e.sort} ${e.name_cn}`,
description: `
${e.desc.replace(/\n+/g, '
')}
`,
- pubDate: DateTime.fromFormat(e.airdate, 'yyyy-L-dd'),
+ pubDate: new Date(e.airdate).toUTCString(),
guid: e.id,
link: e.url,
})),
diff --git a/routes/huya/live.js b/routes/huya/live.js
new file mode 100644
index 0000000000..332a62cf9d
--- /dev/null
+++ b/routes/huya/live.js
@@ -0,0 +1,31 @@
+const axios = require('../../utils/axios');
+
+module.exports = async (ctx) => {
+ const id = ctx.params.id;
+ const url = `https://search.cdn.huya.com/?m=Search&do=getSearchContent&q=${id}&typ=-5&rows=1`;
+ const response = await axios({
+ method: 'get',
+ url: url,
+ });
+
+ const data = response.data.response['1'].docs[0];
+
+ let items = [];
+ if (data.gameLiveOn) {
+ items = [
+ {
+ title: `${data.live_intro}`,
+ pubDate: new Date(data.rec_live_time).toUTCString(),
+ guid: data.uid,
+ link: url,
+ image: data.game_avatarUrl180,
+ },
+ ];
+ }
+
+ ctx.state.data = {
+ title: `${data.game_nick}的虎牙直播`,
+ link: url,
+ item: items,
+ };
+};