diff --git a/docs/picture.md b/docs/picture.md index fd0c44e991..03e8d86096 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -56,6 +56,12 @@ pageClass: routes +## Hentai Cosplay + +### 最新图片 + + + ## Konachan Anime Wallpapers ::: tip 提示 @@ -95,6 +101,12 @@ pageClass: routes +## Porn Image XXX + +### 最新图片 + + + ## Tits Guru ### Home diff --git a/lib/router.js b/lib/router.js index 3438b70d4c..f235218e1b 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2814,6 +2814,10 @@ router.get('/gov/caict/bps', require('./routes/gov/caict/bps')); router.get('/gov/caict/qwsj', require('./routes/gov/caict/qwsj')); router.get('/gov/caict/caictgd', require('./routes/gov/caict/caictgd')); +// hentai-cosplays +router.get('/hentai-cosplays/:type?/:name?', require('./routes/hentai-cosplays/hentai-cosplays')); +router.get('/porn-images-xxx/:type?/:name?', require('./routes/hentai-cosplays/porn-images-xxx')); + // dcinside router.get('/dcinside/board/:id', require('./routes/dcinside/board')); diff --git a/lib/routes/hentai-cosplays/hentai-cosplays.js b/lib/routes/hentai-cosplays/hentai-cosplays.js new file mode 100644 index 0000000000..4bd37f3284 --- /dev/null +++ b/lib/routes/hentai-cosplays/hentai-cosplays.js @@ -0,0 +1,11 @@ +const { processFeed } = require('./utils'); + +module.exports = async (ctx) => { + const url = ctx.params.type ? `https://ja.hentai-cosplays.com/search/${ctx.params.type}/${encodeURIComponent(ctx.params.name)}/` : 'https://ja.hentai-cosplays.com/search/'; + const items = await processFeed(url); + ctx.state.data = { + title: `${ctx.params.name || '新着コスプレ一覧'} - エロコスプレ`, + link: url, + item: items, + }; +}; diff --git a/lib/routes/hentai-cosplays/porn-images-xxx.js b/lib/routes/hentai-cosplays/porn-images-xxx.js new file mode 100644 index 0000000000..a2fc3880e9 --- /dev/null +++ b/lib/routes/hentai-cosplays/porn-images-xxx.js @@ -0,0 +1,11 @@ +const { processFeed } = require('./utils'); + +module.exports = async (ctx) => { + const url = ctx.params.type ? `https://ja.porn-images-xxx.com/search/${ctx.params.type}/${encodeURIComponent(ctx.params.name)}/` : 'https://ja.porn-images-xxx.com/search/'; + const items = await processFeed(url); + ctx.state.data = { + title: `${ctx.params.name || '新着画像一覧'} - エロ画像`, + link: url, + item: items, + }; +}; diff --git a/lib/routes/hentai-cosplays/utils.js b/lib/routes/hentai-cosplays/utils.js new file mode 100644 index 0000000000..e64e206c64 --- /dev/null +++ b/lib/routes/hentai-cosplays/utils.js @@ -0,0 +1,26 @@ +const cheerio = require('cheerio'); +const got = require('hooman'); + +exports.processFeed = async function processFeed(link) { + const response = await got.get(link); + const $ = cheerio.load(response.body); + const list = $('ul#image-list li'); + + return ( + list && + list + .map((index, item) => { + item = $(item); + return { + title: item.find('.image-list-item-title').text(), + link: item.find('.image-list-item-title > a').attr('href'), + description: item + .find('.image-list-item-image') + .html() + .replace(/\/p=\d+x\d+/, ''), + pubDate: new Date(item.find('.image-list-item-regist-date').text()), + }; + }) + .get() + ); +};