mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 15:21:59 +08:00
feat: add MQube (#3798)
This commit is contained in:
@@ -978,6 +978,35 @@
|
||||
},
|
||||
],
|
||||
},
|
||||
'mqube.net': {
|
||||
_name: 'MQube',
|
||||
www: [
|
||||
{
|
||||
title: '全站最近更新',
|
||||
docs: 'https://docs.rsshub.app/multimedia.html#mqube',
|
||||
source: '/',
|
||||
target: '/mqube/latest',
|
||||
},
|
||||
{
|
||||
title: '全站每日排行',
|
||||
docs: 'https://docs.rsshub.app/multimedia.html#mqube',
|
||||
source: '/',
|
||||
target: '/mqube/top',
|
||||
},
|
||||
{
|
||||
title: '个人最近更新',
|
||||
docs: 'https://docs.rsshub.app/multimedia.html#mqube',
|
||||
source: '/user/:user',
|
||||
target: '/mqube/user/:user',
|
||||
},
|
||||
{
|
||||
title: '标签最近更新',
|
||||
docs: 'https://docs.rsshub.app/multimedia.html#mqube',
|
||||
source: '/search/tag/:tag',
|
||||
target: '/mqube/tag/:tag',
|
||||
},
|
||||
],
|
||||
},
|
||||
'nikkei.com': {
|
||||
_name: '日本経済新聞',
|
||||
www: [
|
||||
|
||||
@@ -145,6 +145,24 @@ pageClass: routes
|
||||
|
||||
</Route>
|
||||
|
||||
## MQube
|
||||
|
||||
### 全站最近更新
|
||||
|
||||
<Route author="hoilc" example="/mqube/latest" path="/mqube/latest" radar="1" />
|
||||
|
||||
### 全站每日排行
|
||||
|
||||
<Route author="hoilc" example="/mqube/top" path="/mqube/top" radar="1" />
|
||||
|
||||
### 个人最近更新
|
||||
|
||||
<Route author="hoilc" example="/mqube/user/mukamui_v_p" path="/mqube/user/:user" :paramsDesc="['用户 ID, 可以在个人资料页的 URL 中找到']" radar="1" />
|
||||
|
||||
### 标签最近更新
|
||||
|
||||
<Route author="hoilc" example="/mqube/tag/UTAU" path="/mqube/tag/:tag" :paramsDesc="['标签名称, 可参考`https://mqube.net/search/tag`']" radar="1" />
|
||||
|
||||
## Nyaa
|
||||
|
||||
### 搜索结果
|
||||
|
||||
@@ -2166,4 +2166,10 @@ router.get('/coronavirus/nhc', require('./routes/coronavirus/nhc'));
|
||||
// 日本経済新聞
|
||||
router.get('/nikkei/index', require('./routes/nikkei/index'));
|
||||
|
||||
// MQube
|
||||
router.get('/mqube/user/:user', require('./routes/mqube/user'));
|
||||
router.get('/mqube/tag/:tag', require('./routes/mqube/tag'));
|
||||
router.get('/mqube/latest', require('./routes/mqube/latest'));
|
||||
router.get('/mqube/top', require('./routes/mqube/top'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
21
lib/routes/mqube/latest.js
Normal file
21
lib/routes/mqube/latest.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = 'https://mqube.net/';
|
||||
|
||||
const response = await got.get(url);
|
||||
|
||||
const list = JSON.parse(response.data.match(/gon.item_list=(.*?);/)[1]) || [];
|
||||
|
||||
ctx.state.data = {
|
||||
title: `MQube 新着`,
|
||||
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}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
23
lib/routes/mqube/tag.js
Normal file
23
lib/routes/mqube/tag.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const tag = ctx.params.tag;
|
||||
|
||||
const url = `https://mqube.net/search/tag/${encodeURIComponent(tag)}`;
|
||||
|
||||
const response = await got.get(url);
|
||||
|
||||
const list = JSON.parse(response.data.match(/gon.item_list=(.*?);/)[1]) || [];
|
||||
|
||||
ctx.state.data = {
|
||||
title: `MQube - ${tag}`,
|
||||
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}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
21
lib/routes/mqube/top.js
Normal file
21
lib/routes/mqube/top.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = 'https://mqube.net/';
|
||||
|
||||
const response = await got.get(url);
|
||||
|
||||
const list = JSON.parse(response.data.match(/gon.right_riot_item_lists=(.*?);/)[1]) || [];
|
||||
|
||||
ctx.state.data = {
|
||||
title: `MQube デイリーランキング`,
|
||||
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}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
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