Skip to content

Commit

Permalink
feat(route): missav (#13997)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Dec 8, 2023
1 parent 75c718a commit 06e3892
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/v2/missav/maintainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'/new': ['TonyRL'],
};
36 changes: 36 additions & 0 deletions lib/v2/missav/new.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { art } = require('@/utils/render');
const { join } = require('path');

module.exports = async (ctx) => {
const baseUrl = 'https://missav.com';
const { data: response } = await got(`${baseUrl}/dm397/new`);
const $ = cheerio.load(response);

const items = $('.grid .group')
.toArray()
.map((item) => {
item = $(item);
const title = item.find('.text-secondary');
const poster = new URL(item.find('img').data('src'));
poster.searchParams.set('class', 'normal');
const video = item.find('video').data('src');
return {
title: title.text().trim(),
link: title.attr('href'),
description: art(join(__dirname, 'templates/preview.art'), {
poster: poster.href,
video,
type: video.split('.').pop(),
}),
};
});

ctx.state.data = {
title: $('head title').text(),
description: $('head meta[name="description"]').attr('content'),
link: baseUrl,
item: items,
};
};
13 changes: 13 additions & 0 deletions lib/v2/missav/radar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
'missav.com': {
_name: 'MissAV.com',
'.': [
{
title: '最近更新',
docs: 'https://docs.rsshub.app/multimedia#missav-com',
source: ['/dm397/new', '/new', '/'],
target: '/missav/new',
},
],
},
};
3 changes: 3 additions & 0 deletions lib/v2/missav/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = (router) => {
router.get('/new', require('./new'));
};
3 changes: 3 additions & 0 deletions lib/v2/missav/templates/preview.art
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<video controls preload="none" poster="{{ poster }}">
<source src="{{ video }}" type="{{ type }}">
</video>
6 changes: 6 additions & 0 deletions website/docs/routes/multimedia.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,12 @@ See [Directory](https://www.javlibrary.com/en/star_list.php) to view all stars.

</Route>

## MissAV.com {#missav.com}

### 最近更新 {#missav.com-zui-jin-geng-xin}

<Route author="TonyRL" example="/missav/new" path="/missav/new" radar="1" />

## Mixcloud {#mixcloud}

### User {#mixcloud-user}
Expand Down

0 comments on commit 06e3892

Please sign in to comment.