mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-19 06:38:55 +08:00
feat: add MQube (#3798)
This commit is contained in:
25
lib/routes/mqube/user.js
Normal file
25
lib/routes/mqube/user.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const user = ctx.params.user;
|
||||
|
||||
const url = `https://mqube.net/user/${user}`;
|
||||
|
||||
const response = await got.get(url);
|
||||
|
||||
const list = JSON.parse(response.data.match(/gon.item_list=(.*?);/)[1]) || [];
|
||||
|
||||
const username = list[0].user.name;
|
||||
|
||||
ctx.state.data = {
|
||||
title: `MQube - ${username}`,
|
||||
link: url,
|
||||
item: list.map((item) => ({
|
||||
title: item.title,
|
||||
author: item.user.name,
|
||||
description: `<audio src="https://s3.mqube.net/t/files/item/file/${item.code.toString().substring(0, 6)}/${item.code}/${item.file}" controls loop></audio><div><br>${item.description.replace(/\n/g, '<br>')}</dive>`,
|
||||
pubDate: new Date(item.created_at),
|
||||
link: `https://mqube.net/play/${item.code}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user