Files
RSSHub/lib/v2/qq/kg/reply.js
T
c110ad0502 feat(rotue): 全民K歌 (#7768)
* add route&doc 全民K歌

* add route&doc 全民K歌

* add route&doc 全民K歌

* fix: update reply guid

* fix:  修复 guid 和 缓存 key 不唯一的问题

* feat: migrate to v2

Co-authored-by: zhangxiang012<zhangxiang012@users.noreply.github.com>

Co-authored-by: zhangxiang <zhangxiang@ffrj.net>
Co-authored-by: zhangxiang012 <zhangxiang012@users.noreply.github.com>
2022-07-01 23:10:50 +08:00

22 lines
733 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const cache = require('./cache');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const playId = ctx.params.playId;
const url = `https://node.kg.qq.com/play?s=${playId}`;
const play_item = await cache.getPlayInfo(ctx, playId, '');
ctx.state.data = {
title: `${play_item.name} - ${play_item.author} 的评论`,
link: url,
image: play_item.itunes_item_image,
allowEmpty: true,
item: play_item.comments.map((item) => ({
title: `${item.nick}:${item.content}`,
pubDate: parseDate(item.ctime * 1000),
link: url,
guid: `ksong:${play_item.ksong_mid}:${item.comment_id}`,
})),
};
};