From 06e3892106cda248bcab88a620ea16f67d94366a Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 8 Dec 2023 18:46:31 +0000 Subject: [PATCH] feat(route): missav (#13997) --- lib/v2/missav/maintainer.js | 3 +++ lib/v2/missav/new.js | 36 +++++++++++++++++++++++++++++ lib/v2/missav/radar.js | 13 +++++++++++ lib/v2/missav/router.js | 3 +++ lib/v2/missav/templates/preview.art | 3 +++ website/docs/routes/multimedia.mdx | 6 +++++ 6 files changed, 64 insertions(+) create mode 100644 lib/v2/missav/maintainer.js create mode 100644 lib/v2/missav/new.js create mode 100644 lib/v2/missav/radar.js create mode 100644 lib/v2/missav/router.js create mode 100644 lib/v2/missav/templates/preview.art diff --git a/lib/v2/missav/maintainer.js b/lib/v2/missav/maintainer.js new file mode 100644 index 000000000..ffb61fdc8 --- /dev/null +++ b/lib/v2/missav/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/new': ['TonyRL'], +}; diff --git a/lib/v2/missav/new.js b/lib/v2/missav/new.js new file mode 100644 index 000000000..281f12c0f --- /dev/null +++ b/lib/v2/missav/new.js @@ -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, + }; +}; diff --git a/lib/v2/missav/radar.js b/lib/v2/missav/radar.js new file mode 100644 index 000000000..471b84b03 --- /dev/null +++ b/lib/v2/missav/radar.js @@ -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', + }, + ], + }, +}; diff --git a/lib/v2/missav/router.js b/lib/v2/missav/router.js new file mode 100644 index 000000000..cbdbafac3 --- /dev/null +++ b/lib/v2/missav/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/new', require('./new')); +}; diff --git a/lib/v2/missav/templates/preview.art b/lib/v2/missav/templates/preview.art new file mode 100644 index 000000000..5f3f875a9 --- /dev/null +++ b/lib/v2/missav/templates/preview.art @@ -0,0 +1,3 @@ + diff --git a/website/docs/routes/multimedia.mdx b/website/docs/routes/multimedia.mdx index 5bcaed8b2..e5ed11b91 100644 --- a/website/docs/routes/multimedia.mdx +++ b/website/docs/routes/multimedia.mdx @@ -985,6 +985,12 @@ See [Directory](https://www.javlibrary.com/en/star_list.php) to view all stars. +## MissAV.com {#missav.com} + +### 最近更新 {#missav.com-zui-jin-geng-xin} + + + ## Mixcloud {#mixcloud} ### User {#mixcloud-user}