mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-15 18:30:53 +08:00
增加电影天堂的RSS (#807)
This commit is contained in:
@@ -1700,3 +1700,11 @@ IATA 国际航空运输协会机场代码, 参见[维基百科 国际航空运
|
|||||||
> 高清电影,百度网盘跟迅雷下载
|
> 高清电影,百度网盘跟迅雷下载
|
||||||
|
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
|
### 电影天堂
|
||||||
|
|
||||||
|
<route name="电影天堂" author="imgss" example="/dytt/index" path="/dytt/index">
|
||||||
|
|
||||||
|
> 电影天堂新电影订阅
|
||||||
|
|
||||||
|
</route>
|
||||||
|
|||||||
@@ -584,4 +584,7 @@ router.get('/thepaper/featured', require('./routes/thepaper/featured'));
|
|||||||
// 电影首发站
|
// 电影首发站
|
||||||
router.get('/dysfz/index', require('./routes/dysfz/index'));
|
router.get('/dysfz/index', require('./routes/dysfz/index'));
|
||||||
|
|
||||||
|
// 电影天堂
|
||||||
|
router.get('/dytt/index', require('./routes/dytt/index'));
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
34
routes/dytt/index.js
Normal file
34
routes/dytt/index.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
const axios = require('../../utils/axios');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
const iconv = require('iconv-lite');
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const response = await axios.get('http://www.dytt8.net', {
|
||||||
|
responseType: 'arraybuffer',
|
||||||
|
});
|
||||||
|
response.data = iconv.decode(response.data, 'gb2312');
|
||||||
|
|
||||||
|
const $ = cheerio.load(response.data);
|
||||||
|
const list = $('.co_content8 table tr').get();
|
||||||
|
const data = {
|
||||||
|
title: '电影天堂',
|
||||||
|
link: 'http://www.dytt8.net',
|
||||||
|
description: '电影天堂RSS',
|
||||||
|
item: list
|
||||||
|
.map((item) => {
|
||||||
|
const link = $(item).find('a:nth-of-type(2)');
|
||||||
|
return {
|
||||||
|
title: link.text(),
|
||||||
|
description: link.text(),
|
||||||
|
pubDate: new Date(
|
||||||
|
$(item)
|
||||||
|
.find('font')
|
||||||
|
.text()
|
||||||
|
).toUTCString(),
|
||||||
|
link: 'http://www.dytt8.net' + link.attr('href'),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.slice(1),
|
||||||
|
};
|
||||||
|
|
||||||
|
ctx.state.data = data;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user