mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: 增加猫眼电影 (#2234)
This commit is contained in:
@@ -202,6 +202,16 @@ pageClass: routes
|
||||
|
||||
<Route author="Songkeys" example="/gaoqing/latest" path="/gaoqing/latest"/>
|
||||
|
||||
## 猫眼电影
|
||||
|
||||
### 正在热映
|
||||
|
||||
<Route author="HenryQW" example="/maoyan/hot" path="/maoyan/hot" />
|
||||
|
||||
### 即将上映
|
||||
|
||||
<Route author="HenryQW" example="/maoyan/upcoming" path="/maoyan/upcoming" />
|
||||
|
||||
## 柠檬 私房歌 (ningmeng.name)
|
||||
|
||||
### 私房歌
|
||||
|
||||
@@ -1351,4 +1351,8 @@ router.get('/algocasts', require('./routes/algocasts/all'));
|
||||
// aqicn
|
||||
router.get('/aqicn/:city', require('./routes/aqicn/index'));
|
||||
|
||||
// 猫眼电影
|
||||
router.get('/maoyan/hot', require('./routes/maoyan/hot'));
|
||||
router.get('/maoyan/upcoming', require('./routes/maoyan/upcoming'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
const axios = require('@/utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'https://m.maoyan.com/ajax/movieOnInfoList',
|
||||
});
|
||||
const data = response.data.movieList;
|
||||
const items = await Promise.all(
|
||||
data.map(async (item) => {
|
||||
const rating = item.sc > 0 ? `评分:${item.sc}` : '';
|
||||
|
||||
return {
|
||||
title: `${item.nm} ${rating}`,
|
||||
description: `<img src="${item.img.replace('w.h', '1000.1000')}" referrerpolicy="no-referrer"> <br> ${rating} <br> 演员:${item.star} <br> 上映信息:${item.showInfo}`,
|
||||
link: `https://maoyan.com/films/${item.id}`,
|
||||
pubDate: new Date(item.rt).toUTCString(),
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `猫眼电影 - 正在热映`,
|
||||
link: `https://maoyan.com/films`,
|
||||
description: `猫眼电影 - 正在热映`,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
const axios = require('@/utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'https://m.maoyan.com/ajax/comingList?token=',
|
||||
});
|
||||
const data = response.data.coming;
|
||||
const items = await Promise.all(
|
||||
data.map(async (item) => ({
|
||||
title: `${item.nm} ${item.comingTitle}`,
|
||||
description: `<img src="${item.img.replace('w.h', '1000.1000')}" referrerpolicy="no-referrer"> <br> 演员:${item.star} <br> 上映信息:${item.showInfo || item.comingTitle}`,
|
||||
link: `https://maoyan.com/films/${item.id}`,
|
||||
pubDate: new Date(item.rt).toUTCString(),
|
||||
}))
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `猫眼电影 - 正在热映`,
|
||||
link: `https://maoyan.com/films?showType=2`,
|
||||
description: `猫眼电影 - 正在热映`,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user