mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-25 10:14:31 +08:00
feat(route): add 中文播客榜 (#10550)
* feat(route): add 中文播客榜 * fix typo * update docs/multimedia.md
This commit is contained in:
@@ -1664,6 +1664,34 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
||||
| -- | ------ | ----- | ---- | -- | ------ |
|
||||
| 留空 | bluray | 1080p | 720p | 3d | webdl |
|
||||
|
||||
## 中文播客榜
|
||||
|
||||
::: tip 提示
|
||||
|
||||
可以通过指定 `limit` 参数确定榜单排名下限,默认为 250。
|
||||
|
||||
若只查看榜单前 50,可在订阅 URL 后加入 `?limit=50`。
|
||||
|
||||
即,以 [热门节目](https://xyzrank.com/#/) 为例,路由为[`/xyzrank?limit=50`](https://rsshub.app/xyzrank?limit=50)。
|
||||
|
||||
:::
|
||||
|
||||
### 热门节目
|
||||
|
||||
<Route author="nczitzk" example="/xyzrank" path="/xyzrank"/>
|
||||
|
||||
### 热门播客
|
||||
|
||||
<Route author="nczitzk" example="/xyzrank/hot-podcasts" path="/xyzrank/hot-podcasts"/>
|
||||
|
||||
### 新锐节目
|
||||
|
||||
<Route author="nczitzk" example="/xyzrank/hot-episodes-new" path="/xyzrank/hot-episodes-new"/>
|
||||
|
||||
### 新锐播客
|
||||
|
||||
<Route author="nczitzk" example="/xyzrank/new-podcasts" path="/xyzrank/new-podcasts"/>
|
||||
|
||||
## 注视影视
|
||||
|
||||
### 更新通知
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const { art } = require('@/utils/render');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const category = ctx.params.category ?? '';
|
||||
|
||||
const rootUrl = 'https://xyzrank.com';
|
||||
const currentUrl = `${rootUrl}/#/${category}`;
|
||||
|
||||
let response = await got({
|
||||
method: 'get',
|
||||
url: rootUrl,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
response = await got({
|
||||
method: 'get',
|
||||
url: response.data.match(/<script type="module" crossorigin src="(.*?)"><\/script>/)[1],
|
||||
});
|
||||
|
||||
const matches = response.data.match(/pI="(.*?)",gI="(.*?)",mI="(.*?)",_I="(.*?)";var/);
|
||||
|
||||
const categories = {
|
||||
'': {
|
||||
url: matches[3],
|
||||
title: '热门节目',
|
||||
id: 'hot-episodes',
|
||||
type: 'episodes',
|
||||
},
|
||||
'hot-podcasts': {
|
||||
url: matches[1],
|
||||
title: '热门播客',
|
||||
id: 'full',
|
||||
type: 'podcasts',
|
||||
},
|
||||
'hot-episodes-new': {
|
||||
url: matches[4],
|
||||
title: '新锐节目',
|
||||
id: 'hot-episodes-new',
|
||||
type: 'episodes',
|
||||
},
|
||||
'new-podcasts': {
|
||||
url: matches[2],
|
||||
title: '新锐播客',
|
||||
id: 'new-podcasts',
|
||||
type: 'podcasts',
|
||||
},
|
||||
};
|
||||
|
||||
response = await got({
|
||||
method: 'get',
|
||||
url: categories[category].url,
|
||||
});
|
||||
|
||||
const type = categories[category].type;
|
||||
|
||||
const items = response.data.data[type].slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 250).map((item, index) => ({
|
||||
title: `#${index + 1} ${item.title ?? item.name}`,
|
||||
category: [item.primaryGenreName],
|
||||
author: item.authorsText,
|
||||
link: `${item.link ?? item.links[0].url}${item.trackCount ? `#${item.trackCount}` : ''}`,
|
||||
pubDate: parseDate(item.postTime ?? item.lastReleaseDate),
|
||||
description: art(path.join(__dirname, 'templates/description.art'), {
|
||||
logo: item.logoURL,
|
||||
items:
|
||||
type === 'podcasts'
|
||||
? {
|
||||
'#': index + 1,
|
||||
播客电台: item.name,
|
||||
主持: item.authorsText,
|
||||
分类: item.primaryGenreName,
|
||||
更新频率: `${(item.avgUpdateFreq / 24).toFixed(1)}天`,
|
||||
最近更新: `${item.lastReleaseDateDayCount.toFixed(1)}天前`,
|
||||
总集数: item.trackCount,
|
||||
平均时长: `${item.avgDuration}′`,
|
||||
平均播放量: item.avgPlayCount,
|
||||
平均评论量: item.avgCommentCount,
|
||||
千播互动量: (item.avgInteractIndicator * 1000).toFixed(0),
|
||||
平均打开率: `${(item.avgOpenRate * 100).toFixed(1)}%`,
|
||||
小宇宙: item.links[0].url,
|
||||
'Apple Podcasts': item.links[1].url,
|
||||
官方网站: item.links[2].url,
|
||||
'RSS 订阅': item.links[3].url,
|
||||
}
|
||||
: {
|
||||
'#': index + 1,
|
||||
节目标题: item.title,
|
||||
播客电台: item.podcastName,
|
||||
播放量: item.playCount,
|
||||
评论量: item.commentCount,
|
||||
互动率: `${((item.commentCount / item.playCount) * 100).toFixed(1)}%`,
|
||||
打开率: `${(item.openRate * 100).toFixed(1)}%`,
|
||||
时长: `${item.duration}′`,
|
||||
发布时间: item.postTime,
|
||||
分类: item.primaryGenreName,
|
||||
链接: item.link,
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${$('title').text()} - ${categories[category].title}`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
description: $('meta[property="og:description"]').attr('content'),
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
'/': ['nczitzk'],
|
||||
'/hot-episodes-new': ['nczitzk'],
|
||||
'/hot-podcasts': ['nczitzk'],
|
||||
'/new-podcasts': ['nczitzk'],
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
module.exports = {
|
||||
'xyzrank.com': {
|
||||
_name: '中文播客榜',
|
||||
'.': [
|
||||
{
|
||||
title: '热门节目',
|
||||
docs: 'https://docs.rsshub.app/multimedia.html#zhong-wen-bo-ke-bang-re-men-jie-mu',
|
||||
source: ['/#/', '/'],
|
||||
target: '/xyzrank',
|
||||
},
|
||||
{
|
||||
title: '热门播客',
|
||||
docs: 'https://docs.rsshub.app/multimedia.html#zhong-wen-bo-ke-bang-re-men-bo-ke',
|
||||
source: ['/#/hot-podcasts', '/'],
|
||||
target: '/xyzrank/hot-podcasts',
|
||||
},
|
||||
{
|
||||
title: '新锐节目',
|
||||
docs: 'https://docs.rsshub.app/multimedia.html#zhong-wen-bo-ke-bang-xin-rui-jie-mu',
|
||||
source: ['/#/hot-episodes-new', '/'],
|
||||
target: '/xyzrank/hot-episodes-new',
|
||||
},
|
||||
{
|
||||
title: '新锐播客',
|
||||
docs: 'https://docs.rsshub.app/multimedia.html#zhong-wen-bo-ke-bang-xin-rui-bo-ke',
|
||||
source: ['/#/new-podcasts', '/'],
|
||||
target: '/xyzrank/new-podcasts',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/:category?', require('./index'));
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
{{ if logo }}
|
||||
<img src="{{ logo }}">
|
||||
{{ /if }}
|
||||
<table>
|
||||
{{ each items item index }}
|
||||
{{ if item }}
|
||||
<tr>
|
||||
<td><b>{{ index }}</b></td>
|
||||
<td>{{ item }}</td>
|
||||
</tr>
|
||||
{{ /if }}
|
||||
{{ /each }}
|
||||
Reference in New Issue
Block a user