feat(route): missav (#13997)

This commit is contained in:
Tony
2023-12-09 02:46:31 +08:00
committed by GitHub
parent 75c718a071
commit 06e3892106
6 changed files with 64 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
'/new': ['TonyRL'],
};
+36
View File
@@ -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
View File
@@ -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
View File
@@ -0,0 +1,3 @@
module.exports = (router) => {
router.get('/new', require('./new'));
};
+3
View File
@@ -0,0 +1,3 @@
<video controls preload="none" poster="{{ poster }}">
<source src="{{ video }}" type="{{ type }}">
</video>
+6
View File
@@ -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}