mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-19 06:38:55 +08:00
✨ 腾讯视频播放列表 (#1107)
This commit is contained in:
@@ -802,6 +802,10 @@ GitHub 官方也提供了一些 RSS:
|
|||||||
|
|
||||||
<route name="动漫" author="ranpox" example="/iqiyi/dongman/a_19rrh1sifx" path="/iqiyi/dongman/:id" :paramsDesc="['动漫 id, 可在该动漫主页 URL 中找到(不包括`.html`)']"/>
|
<route name="动漫" author="ranpox" example="/iqiyi/dongman/a_19rrh1sifx" path="/iqiyi/dongman/:id" :paramsDesc="['动漫 id, 可在该动漫主页 URL 中找到(不包括`.html`)']"/>
|
||||||
|
|
||||||
|
### 腾讯视频
|
||||||
|
|
||||||
|
<route name="播放列表" author="Andiedie" example="/tencentvideo/playlist/jx7g4sm320sqm7i" path="/tencentvideo/playlist/:id" :paramsDesc="['播放列表 ID,可以在 URL 中找到']" />
|
||||||
|
|
||||||
### 喜马拉雅
|
### 喜马拉雅
|
||||||
|
|
||||||
<route name="专辑(支持泛用型播客订阅)" author="lengthmin jjeejj" example="/ximalaya/album/299146" path="/ximalaya/album/:id" :paramsDesc="['专辑 id, 可在对应专辑页面的 URL 中找到']">
|
<route name="专辑(支持泛用型播客订阅)" author="lengthmin jjeejj" example="/ximalaya/album/299146" path="/ximalaya/album/:id" :paramsDesc="['专辑 id, 可在对应专辑页面的 URL 中找到']">
|
||||||
|
|||||||
@@ -784,4 +784,7 @@ router.get('/xiachufang/popular/:timeframe?', require('./routes/xiachufang/popul
|
|||||||
// 经济观察报
|
// 经济观察报
|
||||||
router.get('/eeo/:category?', require('./routes/eeo/index'));
|
router.get('/eeo/:category?', require('./routes/eeo/index'));
|
||||||
|
|
||||||
|
// 腾讯视频
|
||||||
|
router.get('/tencentvideo/playlist/:id', require('./routes/tencent/video/playlist'));
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
26
routes/tencent/video/playlist.js
Normal file
26
routes/tencent/video/playlist.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
const axios = require('../../../utils/axios');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const id = ctx.params.id;
|
||||||
|
const link = `https://v.qq.com/detail/${id[0]}/${id}.html`;
|
||||||
|
const { data } = await axios.get(link);
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const episodeName = $('[itemprop=episodeNumber]')
|
||||||
|
.toArray()
|
||||||
|
.reverse()
|
||||||
|
.slice(0, 20);
|
||||||
|
const items = [];
|
||||||
|
for (const one of episodeName) {
|
||||||
|
const ele = $(one);
|
||||||
|
items.push({
|
||||||
|
title: ele.text(),
|
||||||
|
link: ele.parent().attr('href'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
ctx.state.data = {
|
||||||
|
title: $('title').text(),
|
||||||
|
link,
|
||||||
|
description: $('meta[name=description]').attr('content'),
|
||||||
|
item: items,
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user