forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,9 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇 | |
* 用户(团队) | ||
* 关键词 | ||
* 斗鱼 | ||
* 房间开播 | ||
* 直播间开播 | ||
* 熊猫直播 | ||
* 直播间开播下播 | ||
|
||
## 参与我们 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const axios = require('../../utils/axios'); | ||
const config = require('../../config'); | ||
|
||
module.exports = async (ctx) => { | ||
const id = ctx.params.id; | ||
|
||
const response = await axios({ | ||
method: 'get', | ||
url: `http://www.panda.tv/api_room?roomid=${id}`, | ||
headers: { | ||
'User-Agent': config.ua, | ||
Referer: `https://www.panda.tv/${id}`, | ||
}, | ||
}); | ||
|
||
const data = response.data.data; | ||
|
||
ctx.state.data = { | ||
title: `${data.hostinfo.name}的熊猫直播间`, | ||
link: `https://www.panda.tv/${id}`, | ||
item: [ | ||
{ | ||
title: `开播: ${data.roominfo.name}`, | ||
description: `<img referrerpolicy="no-referrer" src="${data.roominfo.pictures.img}">`, | ||
pubDate: new Date(parseInt(data.roominfo.start_time) * 1000).toUTCString(), | ||
guid: data.roominfo.start_time, | ||
link: `https://www.panda.tv/${id}`, | ||
}, | ||
{ | ||
title: `下播: ${data.roominfo.name}`, | ||
description: `<img referrerpolicy="no-referrer" src="${data.roominfo.pictures.img}">`, | ||
pubDate: new Date(parseInt(data.roominfo.end_time) * 1000).toUTCString(), | ||
guid: data.roominfo.end_time, | ||
link: `https://www.panda.tv/${id}`, | ||
}, | ||
], | ||
}; | ||
}; |