Skip to content

Commit

Permalink
route: BT之家1LOU
Browse files Browse the repository at this point in the history
  • Loading branch information
falling committed Jan 10, 2024
1 parent ee19f9e commit 60e4a1a
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 7 deletions.
53 changes: 53 additions & 0 deletions lib/v2/1lou/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');

module.exports = async (ctx) => {
const path = ctx.params.path ?? '';
const rootUrl = `https://www.1lou.me`;
const currentUrl = `${rootUrl}/${path}.htm`;
const response = await got({
method: 'get',
url: currentUrl,
});
const $ = cheerio.load(response.data);

let items = $('li.media.thread.tap:not(.hidden-sm)')
.toArray()
.map((item) => {
const title = $(item).find('.subject.break-all').children('a').first();
const author = $(item).find('.username.text-grey.mr-1').text();
const pubDate = $(item).find('.date.text-grey').text();
return {
title: title.text(),
link: `${rootUrl}/${title.attr('href')}`,
author,
pubDate: timezone(parseDate(pubDate), +8),
};
});
items = await Promise.all(
items.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const detailResponse = await got({
method: 'get',
url: item.link,
});
const content = cheerio.load(detailResponse.data);
const torrents = content('.attachlist').find('a');
item.description = content('.message.break-all').html();
if (torrents.length > 0) {
item.enclosure_type = 'application/x-bittorrent';
item.enclosure_url = `${rootUrl}/${torrents.first().attr('href')}`;
}

return item;
})
)
);
ctx.state.data = {
title: '1Lou',
link: currentUrl,
item: items,
};
};
3 changes: 3 additions & 0 deletions lib/v2/1lou/maintainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'/:path?': ['falling'],
};
13 changes: 13 additions & 0 deletions lib/v2/1lou/radar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
'1lou.me': {
_name: 'BT之家 1LOU站',
'.': [
{
title: '搜索',
docs: 'https://docs.rsshub.app/routes/multimedia#bt-zhi-ji-1Lou',
source: ['/:path'],
target: '/1lou/:path',
},
],
},
};
3 changes: 3 additions & 0 deletions lib/v2/1lou/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/:path?', require('./index'));
};
20 changes: 13 additions & 7 deletions website/docs/routes/multimedia.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1587,14 +1587,20 @@ Refer to [https://developers.themoviedb.org/3/getting-started/languages](https:/
| mv | tv |
</Route>

## 综艺秀 {#zong-yi-xiu}
## BT之家 1LOU站 {#bt-zhi-ji-1Lou}

### 综艺 {#zong-yi-xiu-zong-yi}
### 搜索 {#bt-zhi-ji-1Lou-sou-suo}

<Route author="pharaoh2012 nczitzk" example="/zyshow/chongchongchong" path="/zyshow/:region?/:id" paramsDesc={['地区,见下表,默认为空,即台湾', '综艺 id,综艺详情对应页 URL 中找到']} radar="1" anticrawler="1">
地区
<Route author="falling" example="/1lou/search-_E5_8B_BF_E8_A8_80_E6_8E_A8_E7_90_86" path="/1lou/:path" paramsDesc={['路径信息在URL里找到,主页为 index']}>
:::tip
将1lou.me/后,.htm 前的内容作为参数传入到path即可

www.1lou.me/search-繁花.htm --> /1lou/search-繁花

www.1lou.me/forum-1.htm --> /1lou/forum-1

www.1lou.me/ --> /1lou/index
:::

| 台湾 | 韩国 | 大陆 |
| ---- | ---- | ---- |
| | kr | dl |
</Route>

0 comments on commit 60e4a1a

Please sign in to comment.