diff --git a/docs/multimedia.md b/docs/multimedia.md
index 67d194b71..0b140903c 100644
--- a/docs/multimedia.md
+++ b/docs/multimedia.md
@@ -1469,6 +1469,15 @@ JavDB 有多个备用域名,本路由默认使用永久域名
+### 播客
+
+
+
+获取的播放URL有效期只有1天,需要开启播客APP的自动下载功能。
+
+
+
+
## 秋爸日字
### 分类
diff --git a/lib/router.js b/lib/router.js
index 5de116898..b11275943 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -2747,7 +2747,7 @@ router.get('/qlwb/news', lazyloadRouteHandler('./routes/qlwb/news'));
router.get('/qlwb/city/:city', lazyloadRouteHandler('./routes/qlwb/city'));
// 蜻蜓FM
-router.get('/qingting/channel/:id', lazyloadRouteHandler('./routes/qingting/channel'));
+// router.get('/qingting/channel/:id', lazyloadRouteHandler('./routes/qingting/channel'));
// 金色财经
router.get('/jinse/lives', lazyloadRouteHandler('./routes/jinse/lives'));
diff --git a/lib/routes/qingting/channel.js b/lib/v2/qingting/channel.js
similarity index 76%
rename from lib/routes/qingting/channel.js
rename to lib/v2/qingting/channel.js
index fcb84f453..d7d48962b 100644
--- a/lib/routes/qingting/channel.js
+++ b/lib/v2/qingting/channel.js
@@ -1,22 +1,18 @@
const got = require('@/utils/got');
+const timezone = require('@/utils/timezone');
+const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const channelUrl = `https://i.qingting.fm/capi/v3/channel/${ctx.params.id}`;
- let response = await got({
- method: 'get',
- url: channelUrl,
- });
+ let response = await got(channelUrl);
const title = response.data.data.title;
const programUrl = `https://i.qingting.fm/capi/channel/${ctx.params.id}/programs/${response.data.data.v}?curpage=1&pagesize=10&order=asc`;
- response = await got({
- method: 'get',
- url: programUrl,
- });
+ response = await got(programUrl);
const items = response.data.data.programs.map((item) => ({
title: item.title,
link: `https://www.qingting.fm/channels/${ctx.params.id}/programs/${item.id}/`,
- pubDate: new Date(item.update_time).toUTCString(),
+ pubDate: timezone(parseDate(item.update_time), +8),
}));
ctx.state.data = {
@@ -25,7 +21,7 @@ module.exports = async (ctx) => {
item: await Promise.all(
items.map((item) =>
ctx.cache.tryGet(item.link, async () => {
- response = await got({ method: 'get', url: item.link });
+ response = await got(item.link);
const data = JSON.parse(response.data.match(/},"program":(.*?),"plist":/)[1]);
item.description = data.richtext;
return item;
diff --git a/lib/v2/qingting/maintainer.js b/lib/v2/qingting/maintainer.js
new file mode 100644
index 000000000..fc3c33053
--- /dev/null
+++ b/lib/v2/qingting/maintainer.js
@@ -0,0 +1,4 @@
+module.exports = {
+ '/channel/:id': ['nczitzk'],
+ '/podcast/:id': ['RookieZoe', 'huyyi'],
+};
diff --git a/lib/v2/qingting/podcast.js b/lib/v2/qingting/podcast.js
new file mode 100644
index 000000000..ff395d06f
--- /dev/null
+++ b/lib/v2/qingting/podcast.js
@@ -0,0 +1,77 @@
+const crypto = require('crypto');
+const got = require('@/utils/got');
+const timezone = require('@/utils/timezone');
+const { parseDate } = require('@/utils/parse-date');
+
+module.exports = async (ctx) => {
+ const channelUrl = `https://i.qingting.fm/capi/v3/channel/${ctx.params.id}`;
+ let response = await got({
+ method: 'get',
+ url: channelUrl,
+ headers: {
+ Referer: 'https://www.qingting.fm/',
+ },
+ });
+ const title = response.data.data.title;
+ const channel_img = response.data.data.thumbs['400_thumb'];
+ const authors = response.data.data.podcasters.map((author) => author.nick_name).join(',');
+ const desc = response.data.data.description;
+ const programUrl = `https://i.qingting.fm/capi/channel/${ctx.params.id}/programs/${response.data.data.v}?curpage=1&pagesize=10&order=asc`;
+ response = await got({
+ method: 'get',
+ url: programUrl,
+ headers: {
+ Referer: 'https://www.qingting.fm/',
+ },
+ });
+
+ const resultItems = await Promise.all(
+ response.data.data.programs.map((item) =>
+ ctx.cache.tryGet(`qingting:podcast:${ctx.params.id}:${item.id}`, async () => {
+ const link = `https://www.qingting.fm/channels/${ctx.params.id}/programs/${item.id}/`;
+
+ const path = `/audiostream/redirect/${ctx.params.id}/${item.id}?access_token=&device_id=MOBILESITE&qingting_id=&t=${new Date().getTime()}`;
+ const sign = crypto.createHmac('md5', 'fpMn12&38f_2e').update(path).digest('hex').toString();
+
+ const [detailRes, mediaRes] = await Promise.all([
+ got({
+ method: 'get',
+ url: link,
+ headers: {
+ Referer: 'https://www.qingting.fm/',
+ },
+ }),
+ got({
+ method: 'get',
+ url: `https://audio.qingting.fm${path}&sign=${sign}`,
+ headers: {
+ Referer: 'https://www.qingting.fm/',
+ },
+ }),
+ ]);
+
+ const detail = JSON.parse(detailRes.data.match(/},"program":(.*?),"plist":/)[1]);
+
+ return {
+ title: item.title,
+ link,
+ itunes_item_image: item.cover,
+ itunes_duration: item.duration,
+ pubDate: timezone(parseDate(item.update_time), +8),
+ description: detail.richtext,
+ enclosure_url: mediaRes.url,
+ enclosure_type: 'audio/x-m4a',
+ };
+ })
+ )
+ );
+
+ ctx.state.data = {
+ title: `${title} - 蜻蜓FM`,
+ description: desc,
+ itunes_author: authors,
+ image: channel_img,
+ link: `https://www.qingting.fm/channels/${ctx.params.id}`,
+ item: resultItems,
+ };
+};
diff --git a/lib/v2/qingting/radar.js b/lib/v2/qingting/radar.js
new file mode 100644
index 000000000..40da6f98d
--- /dev/null
+++ b/lib/v2/qingting/radar.js
@@ -0,0 +1,19 @@
+module.exports = {
+ 'qingting.fm': {
+ _name: '蜻蜓 FM',
+ '.': [
+ {
+ title: '专辑',
+ docs: 'https://docs.rsshub.app/multimedia.html#qing-ting-fm',
+ source: '/channels/:id',
+ target: '/qingting/channels/:id',
+ },
+ {
+ title: '播客',
+ docs: 'https://docs.rsshub.app/multimedia.html#qing-ting-fm',
+ source: '/channels/:id',
+ target: '/qingting/podcast/:id',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/qingting/router.js b/lib/v2/qingting/router.js
new file mode 100644
index 000000000..ace2d8874
--- /dev/null
+++ b/lib/v2/qingting/router.js
@@ -0,0 +1,4 @@
+module.exports = (router) => {
+ router.get('/channel/:id', require('./channel'));
+ router.get('/podcast/:id', require('./podcast'));
+};