mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
feat: 新增豆瓣一周口碑榜 (#3674)
This commit is contained in:
@@ -488,6 +488,10 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
||||
|
||||
<Route author="DIYgod" example="/douban/movie/ustop" path="/douban/movie/ustop"/>
|
||||
|
||||
### 一周口碑榜
|
||||
|
||||
<Route author="umm233" example="/douban/movie/weekly" path="/douban/movie/weekly"/>
|
||||
|
||||
### 豆瓣小组
|
||||
|
||||
<Route author="DIYgod" example="/douban/group/camera" path="/douban/group/:groupid" :paramsDesc="['豆瓣小组的 id']"/>
|
||||
|
||||
@@ -151,6 +151,7 @@ router.get('/douban/movie/playing/:score', require('./routes/douban/playing'));
|
||||
router.get('/douban/movie/playing/:score/:city', require('./routes/douban/playing'));
|
||||
router.get('/douban/movie/later', require('./routes/douban/later'));
|
||||
router.get('/douban/movie/ustop', require('./routes/douban/ustop'));
|
||||
router.get('/douban/movie/weekly', require('./routes/douban/weekly_best'));
|
||||
router.get('/douban/group/:groupid', require('./routes/douban/group'));
|
||||
router.get('/douban/explore', require('./routes/douban/explore'));
|
||||
router.get('/douban/music/latest/:area?', require('./routes/douban/latest_music'));
|
||||
|
||||
33
lib/routes/douban/weekly_best.js
Normal file
33
lib/routes/douban/weekly_best.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const link = 'https://m.douban.com/movie';
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://m.douban.com/rexxar/api/v2/subject_collection/movie_weekly_best/items?start=0&count=10',
|
||||
headers: {
|
||||
Referer: link,
|
||||
},
|
||||
});
|
||||
|
||||
const data = response.data.subject_collection_items;
|
||||
|
||||
ctx.state.data = {
|
||||
title: '豆瓣一周口碑电影榜',
|
||||
link: 'https://movie.douban.com/chart',
|
||||
description: '每周五更新',
|
||||
|
||||
item: data.map(({ title, info, cover, url, rating, year, release_date, null_rating_reason }) => {
|
||||
const release = `${year}.${release_date}`;
|
||||
const rate = rating ? `${rating.value.toFixed(1)}分` : null_rating_reason;
|
||||
|
||||
const description = `标题:${title} <br> 影片信息:${info} <br> 上映日期:${release} <br> 评分:${rate} <br> <img src="${cover.url}">`;
|
||||
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
link: url,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user