feat: javbus routes: `director` `label` `studio` (#5271)

Co-authored-by: zrenca <42361841+zrenca@users.noreply.github.com>
This commit is contained in:
sabuaka18 2020-07-28 10:59:30 -04:00 committed by GitHub
parent a7f8056db7
commit eddba23099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 139 additions and 173 deletions

View File

@ -908,26 +908,6 @@
'ithome.com': {
_name: 'IT 之家',
'.': [
{
title: '24 小时阅读榜',
docs: 'https://docs.rsshub.app/new-media.html#it-zhi-jia',
source: ['', '/*'],
target: '/ithome/ranking/24h',
},
{
title: '7 天最热',
docs: 'https://docs.rsshub.app/new-media.html#it-zhi-jia',
source: ['', '/*'],
target: '/ithome/ranking/7days',
},
{
title: '月榜',
docs: 'https://docs.rsshub.app/new-media.html#it-zhi-jia',
source: ['', '/*'],
target: '/ithome/ranking/monthly',
},
],
it: [
{
title: 'IT 资讯',
@ -1849,6 +1829,24 @@
source: '/uncensored/series/:seriesid',
target: '/javbus/uncensored/series/:seriesid',
},
{
title: 'director',
docs: 'https://docs.rsshub.app/multimedia.html#javbus',
source: '/director/:directorid',
target: '/javbus/director/:directorid',
},
{
title: 'label',
docs: 'https://docs.rsshub.app/multimedia.html#javbus',
source: '/label/:labelid',
target: '/javbus/label/:labelid',
},
{
title: 'studio',
docs: 'https://docs.rsshub.app/multimedia.html#javbus',
source: '/studio/:studioid',
target: '/javbus/studio/:studioid',
},
],
},
'javbus.one': {

View File

@ -28,7 +28,7 @@ pageClass: routes
### New Dropzone Actions
<RouteEn author="HenryQW" example="/aptonic/action" path="/aptonic/action/:untested?" :paramsDesc="['Set any value to include untested actions.']"/>
<RouteEn author="HenryQW" example="/aptonic/action" path="/aptonic/action"/>
## Chocolatey

View File

@ -162,11 +162,11 @@ pageClass: routes
### 热榜
<Route author="immmortal luyuhuang" example="/ithome/ranking/24h" path="/ithome/ranking/:type" :paramsDesc="['类别']" radar="1">
<Route author="immmortal" example="/ithome/ranking/1" path="/ithome/ranking/:type" :paramsDesc="['类别']">
| 24h | 7days | monthly |
| ------------- | -------- | ------- |
| 24 小时阅读榜 | 7 天热 | 月榜 |
| 1 | 2 | 3 | 4 |
| ------------- | ---- | -------- | ---- |
| 24 小时阅读榜 | 周榜 | 7 天热 | 月榜 |
</Route>

View File

@ -46,7 +46,7 @@ pageClass: routes
### 新的 Dropzone 动作
<Route author="HenryQW" example="/aptonic/action" path="/aptonic/action/:untested?" :paramsDesc="['填写任意值,将会同时包括非官方的 Dropzone 动作']"/>
<Route author="HenryQW" example="/aptonic/action" path="/aptonic/action"/>
## Bugly SDK

View File

@ -757,12 +757,6 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
<Route author="jackyu1996" example="/ccnu/career" path="/ccnu/career" />
## 吉林大学
### 校内通知
<Route author="276562578" example="/jlu/oa" path="/jlu" />
## 江南大学
### 教务处通知

View File

@ -1091,6 +1091,9 @@ router.get('/javbus/western/home', require('./routes/javbus/western/home'));
router.get('/javbus/western/genre/:gid', require('./routes/javbus/western/genre'));
router.get('/javbus/western/star/:sid', require('./routes/javbus/western/star'));
router.get('/javbus/western/series/:seriesid', require('./routes/javbus/western/series'));
router.get('/javbus/director/:directorid', require('./routes/javbus/director'));
router.get('/javbus/label/:labelid', require('./routes/javbus/label'));
router.get('/javbus/studio/:studioid', require('./routes/javbus/studio'));
// 中山大学
router.get('/sysu/sdcs', require('./routes/universities/sysu/sdcs'));
@ -1768,7 +1771,7 @@ router.get('/tprtc/news', require('./routes/tprtc/news'));
router.get('/archdaily', require('./routes/archdaily/home'));
// aptonic Dropzone actions
router.get('/aptonic/action/:untested?', require('./routes/aptonic/action'));
router.get('/aptonic/action', require('./routes/aptonic/action'));
// 印记中文周刊
router.get('/docschina/jsweekly', require('./routes/docschina/jsweekly'));
@ -2245,7 +2248,7 @@ router.get('/pianyuan/:media?', require('./routes/pianyuan/app'));
// ITHome
router.get('/ithome/:caty', require('./routes/ithome/index'));
router.get('/ithome/ranking/:type', require('./routes/ithome/ranking'));
router.get('/ithome/ranking/:type?', require('./routes/ithome/ranking'));
// 巴哈姆特
router.get('/bahamut/creation/:author/:category?', require('./routes/bahamut/creation'));
@ -2953,7 +2956,4 @@ router.get('/ngbj/cat/:cat', require('./routes/niaogebiji/cat'));
// 东方我乐多丛志
router.get('/touhougarakuta/:language/:type', require('./routes/touhougarakuta'));
// 吉林大学校内通知
router.get('/jlu/oa', require('./routes/universities/jlu/oa'));
module.exports = router;

View File

@ -10,7 +10,7 @@ module.exports = async (ctx) => {
const list = data.map((item) => ({
title: item.headline,
link: `http://www.12379.cn/html/new2018/alarmcontent.shtml?file=${item.identifier}.html`,
link: `http://www.12379.cn/html/new2018/alarmcontent.shtml?file=${item.identifier}.html}`,
description: item.description,
pubDate: new Date(item.sendTime).toUTCString(),
}));

View File

@ -11,18 +11,33 @@ module.exports = async (ctx) => {
Referer: 'http://www.acfun.cn',
},
});
const bangumiData = JSON.parse(bangumiPage.data.match(/window.bangumiData = (.*?);\n/)[1]);
const bangumiList = JSON.parse(bangumiPage.data.match(/window.bangumiList = (.*?);\n/)[1]);
const albumInfo = JSON.parse(bangumiPage.data.match(/window.bangumiData = (.*?);\n/)[1]) || {};
const api = `http://www.acfun.cn/album/abm/bangumis/video?albumId=${id}&num=1&size=${albumInfo.itemCount || 9999}`;
const response = await got({
method: 'get',
url: api,
headers: {
Referer: 'http://www.acfun.cn',
},
});
const data = response.data.data;
ctx.state.data = {
title: bangumiData.bangumiTitle,
title: albumInfo.bangumiTitle,
link: url,
description: bangumiData.bangumiIntro,
item: bangumiList.items.map((item) => ({
title: `${item.episodeName} - ${item.title}`,
description: `<img src="${item.image.split('?')[0]}">`,
link: `http://www.acfun.cn/bangumi/aa${id}_36188_${item.itemId}`,
pubDate: new Date(item.updateTime).toUTCString(),
})),
description: albumInfo.bangumiIntro,
item: data.content
.map((item) => {
const video = item.videos[0] || {};
return {
title: `${video.episodeName}-${video.newTitle}`,
description: `<img src="${video.image}">`,
link: `http://www.acfun.cn/bangumi/ab${id}_${video.groupId}_${video.id}`,
pubDate: new Date(video.onlineTime).toUTCString(),
};
})
.reverse(),
};
};

View File

@ -1,6 +1,5 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const date = require('@/utils/date');
module.exports = async (ctx) => {
const baseUrl = 'http://www.anitama.cn';
@ -43,7 +42,7 @@ module.exports = async (ctx) => {
}
});
const single = {
pubDate: date($('.time').text()),
pubDate: $('.time').text(),
author: $('.author').text(),
link: link,
title: $('h1').text() + '-' + $('h2').text(),

View File

@ -3,36 +3,28 @@ const url = require('url');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const untested = ctx.params.untested || false;
const link = `https://aptonic.com/actions/`;
const getItems = async (link) => {
const res = await got.get(link);
const $ = cheerio.load(res.body);
const res = await got.get(link);
const $ = cheerio.load(res.body);
return $('table.actions >> tr')
ctx.state.data = {
title: 'Dropzone Actions',
link,
item: $('table.actions >> tr')
.get()
.map((item) => {
item = $(item);
return {
title: item.find('h2').text(),
description: `<img src="${url.resolve(link, item.find('img').attr('src'))}"/><br/>${$(item.find('td')[1]).children().remove().end().text()}`,
description: `
<img src="${url.resolve(link, item.find('img').attr('src'))}"/>
<br/>
${$(item.find('td')[1]).children().remove().end().text()}
`,
pubDate: new Date().toUTCString(),
link: url.resolve(link, item.find('td.icon a').attr('href')),
};
});
};
const link = `https://aptonic.com/actions/`;
const items = await getItems(link);
if (untested) {
items.push(...(await getItems('https://aptonic.com/actions/untested')));
}
ctx.state.data = {
title: 'Dropzone Actions',
link,
item: items,
}),
};
};

View File

@ -9,7 +9,7 @@ module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: `https://api.bilibili.com/x/space/bangumi/follow/list?type=${type}&follow_status=0&pn=1&ps=15&vmid=${uid}`,
url: `https://api.bilibili.com/x/space/bangumi/follow/list?type=${type}&follow_status=0&pn=1&ps=50&vmid=${uid}`,
headers: {
Referer: `https://space.bilibili.com/${uid}/${type_name}`,
},

View File

@ -3,7 +3,7 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const baseUrl = 'http://www.bjp.org.cn';
const indexUrl = baseUrl + '/mryt/index.shtml';
const indexUrl = baseUrl + '/col/col89/index.html';
const res = await got.get(indexUrl);
@ -28,10 +28,12 @@ module.exports = async (ctx) => {
const content = $($('body > table')[1]);
const image = `<img src="${baseUrl}${content.find('img').attr('src')}">`;
const item = {
title: $(e).attr('title'),
pubDate: new Date(data.data.match(/\d{4}-\d{2}-\d{2}/)[0]).toUTCString(),
description: content.find('table').last().html(),
pubDate: new Date($('meta[name=pubDate]').attr('content')).toUTCString(),
description: image + content.find('table').last().html(),
link,
guid: link,
};

View File

@ -21,10 +21,9 @@ module.exports = async (ctx) => {
const out = $('.repo-list li')
.slice(0, 10)
.map(function () {
const a = $(this).find('.f4.text-normal > a');
const single = {
title: a.text(),
link: host.concat(a.attr('href')),
title: $(this).find('div h3 a').text(),
link: host.concat($(this).find('div h3 a').attr('href')),
description: $(this).find('div p').text().trim(),
};
return single;

View File

@ -3,7 +3,7 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const response = await got({
method: 'POST',
url: 'https://search.htv-services.com/',
url: 'https://search.hanimetv.club/',
headers: {
Referer: 'https://hanime.tv/',
'Content-Type': 'application/json;charset=utf-8',
@ -29,7 +29,7 @@ module.exports = async (ctx) => {
item: list.map((item) => {
const videoUrl = 'https://hanime.tv/hentai-videos/' + item.slug;
// 视频预览图,可通过视频页面的预览图片获取
const videoImage = item.poster_url;
const videoImage = 'https://i1.wp.com/cdn.tw-hoa-licensing.com/images/storyboards/' + item.slug + '-720p-v1x.jpg';
const videoCover = item.cover_url;
const videoDescription = item.description;
const videoTags = item.tags;
@ -42,10 +42,7 @@ module.exports = async (ctx) => {
title: videoEnglishName,
description:
'Name: '.bold() +
videoEnglishName +
' (' +
videoJapanseName +
')' +
'<br>' +
'Brand: '.bold() +
videoBrand +

View File

@ -3,7 +3,7 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const link = 'https://www.ikea.com/gb/en/news/product-news-gallery/';
const count = (await got.get('https://sik.search.blue.cdtapps.com/gb/en/product-list-page?category=products&f-toggles2=new_product')).data.productListPage.productCount;
const count = (await got.get('https://sik.search.blue.cdtapps.com/gb/en/product-list-page?category=products&toggles2=new_product')).data.productListPage.productCount;
const products = (await got.get(`http://sik.search.blue.cdtapps.com/gb/en/product-list-page/more-products?category=products&start=1&end=${count}`)).data.moreProducts.productWindow;

View File

@ -1,38 +1,28 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const iconv = require('iconv-lite');
module.exports = async (ctx) => {
const option = ctx.params.type;
const option = ctx.params.type || '1';
const link = `https://www.ithome.com/`;
const response = await got({
method: 'get',
url: 'https://www.ithome.com/block/rank.html',
encoding: 'binary',
});
const content = iconv.decode(Buffer.from(response.data, 'binary'), 'gb2312');
const $ = cheerio.load(content);
const response = await got.get(link);
const $ = cheerio.load(response.data);
const config = {
'24h': '24 小时最热',
'7days': '7 天最热',
monthly: '月榜',
};
const type2id = {
'24h': 'd-1',
'7days': 'd-2',
monthly: 'd-3',
1: '24小时阅读榜',
2: '周榜',
3: '7天热评',
4: '月榜',
};
const title = config[option];
const id = type2id[option];
if (!id) {
throw Error('Bad type. See <a href="https://docs.rsshub.app/new-media.html#it-zhi-jia">https://docs.rsshub.app/new-media.html#it-zhi-jia</a>');
let elem = $('.lst.lst-2.hot-list').find('.bx').first();
for (let i = 0; i < Number(option) - 1; ++i) {
elem = elem.next();
}
const list = $(`#${id} > li`)
const list = elem
.find('li')
.map(function () {
const info = {
title: $(this).find('a').text(),
@ -51,7 +41,8 @@ module.exports = async (ctx) => {
url: item.link,
});
const content = cheerio.load(res.data);
const paragraph = content('#paragraph');
const post = content('div#con div.content');
const paragraph = post.find('div#paragraph');
paragraph.find('img[data-original]').each((_, ele) => {
ele = $(ele);
ele.attr('src', ele.attr('data-original'));
@ -59,7 +50,7 @@ module.exports = async (ctx) => {
ele.removeAttr('data-original');
});
item.description = paragraph.html();
item.pubDate = new Date(content('#pubtime_baidu').text() + ' GMT+8').toUTCString();
item.pubDate = new Date(post.find('span#pubtime_baidu').text() + ' GMT+8').toUTCString();
return item;
})
)
@ -67,7 +58,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `IT之家-${title}`,
link: 'https://www.ithome.com',
link: link,
item: items,
};
};

View File

@ -0,0 +1,7 @@
const { getPage } = require('./util');
module.exports = async (ctx) => {
const { directorid } = ctx.params;
ctx.state.data = await getPage(`https://www.javbus.com/director/${directorid}`, ctx);
};

View File

@ -0,0 +1,7 @@
const { getPage } = require('./util');
module.exports = async (ctx) => {
const { labelid } = ctx.params;
ctx.state.data = await getPage(`https://www.javbus.com/label/${labelid}`, ctx);
};

View File

@ -0,0 +1,7 @@
const { getPage } = require('./util');
module.exports = async (ctx) => {
const { studioid } = ctx.params;
ctx.state.data = await getPage(`https://www.javbus.com/studio/${studioid}`, ctx);
};

View File

@ -7,24 +7,19 @@ module.exports = async (ctx) => {
const response = await got.get(url);
const $ = cheerio.load(response.data);
const list = $('article').get();
const list = $('.item').toArray();
ctx.state.data = {
title: 'Trending on Pocket',
description: 'Top Articles and Videos about Trending on Pocket',
link: url,
item: list.map((item) => {
item = $(item);
const middle_link = new URL(item.find('a').first().attr('href'));
const media = item
.find('.media')
.attr('style')
.match(/url\('(.*?)'\);/)[1];
const pic_html = media ? `<img src="${media}">` : '';
return {
title: item.find('.title').text(),
author: item.find('.details > span').first().text(),
description: `<p>${item.find('.excerpt').text()}</p>` + pic_html,
link: middle_link.searchParams.get('url') || middle_link.href,
author: item.find('.domain > a').text(),
description: `<p>${item.find('.excerpt').text()}</p><img src="${item.find('.item_image').attr('data-thumburl')}" />`,
link: item.find('.item_link').attr('data-saveurl'),
};
}),
};

View File

@ -19,7 +19,7 @@ module.exports = async (ctx) => {
} else {
const source = ctx.params.source.toUpperCase();
const target = ctx.params.target.toUpperCase();
const api = `https://api.transferwise.com/v1/rates?source=${source}&target=${target}&from=${dayBefore}&to=${dayjs().format('YYYY-MM-DDTHH:mm:ssZ')}&group=day`;
const api = `https://api.transferwise.com/v1/rates?source=${source}&target=${target}&from=${dayBefore}&to=${yesterday}&group=day`;
const response = await got({
method: 'get',
@ -32,17 +32,14 @@ module.exports = async (ctx) => {
});
const data = response.data;
const yRate = data[1];
const byRate = data[2];
const trend = yRate.rate > byRate.rate;
const diff = (yRate.rate - byRate.rate) / yRate.rate;
const trend = data[0].rate > data[1].rate;
const diff = (data[0].rate - data[1].rate) / data[1].rate;
const percent = (Math.abs(diff) * 100).toFixed(4);
const title = `${source}/${target} ${trend ? '📈' : '📉'} @${yRate.rate} ${diff > 0 ? '' : '-'}${percent}%`;
const title = `${source}/${target} ${trend ? '📈' : '📉'} @${data[0].rate} ${diff > 0 ? '' : '-'}${percent}%`;
const description = `<h3>${source} to ${target}</h3><table><tbody><tr><th align="left" style="border: 1px solid black;">Date</th><th align="left" style="border: 1px solid black;">Rate</th></tr><tr><td style="border: 1px solid black;">${yesterday}</td><td style="border: 1px solid black;">${yRate.rate}</td></tr><tr><td style="border: 1px solid black;">${dayBefore}</td><td style="border: 1px solid black;">${byRate.rate}</td></tr></tbody></table>`;
const description = `<h3>${source} to ${target}</h3><table><tbody><tr><th align="left" style="border: 1px solid black;">Date</th><th align="left" style="border: 1px solid black;">Rate</th></tr><tr><td style="border: 1px solid black;">${yesterday}</td><td style="border: 1px solid black;">${data[0].rate}</td></tr><tr><td style="border: 1px solid black;">${dayBefore}</td><td style="border: 1px solid black;">${data[1].rate}</td></tr></tbody></table>`;
const single = {
title,

View File

@ -1,31 +0,0 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://oa.jlu.edu.cn/defaultroot/PortalInformation!jldxList.action',
});
const data = response.data;
const $ = cheerio.load(data); // 使用 cheerio 加载返回的 HTML
const list = $('div[class="li rel"]');
ctx.state.data = {
title: 'jlu oa',
link: 'https://oa.jlu.edu.cn/defaultroot/PortalInformation!jldxList.action',
item:
list &&
list
.map((index, item) => {
item = $(item);
return {
title: item.find('a.font14').text(),
description: item.find('a.column').text(),
link: item.find('a.font14').attr('href'),
};
})
.get(),
};
};

View File

@ -18,7 +18,7 @@ module.exports = async (ctx) => {
const list = main.notesDetail;
const resultItem = list.map((item) => ({
title: `${item.title}`,
link: `https://www.xiaohongshu.com/discovery/item/${item.id}`,
link: `${item.link}`,
description: `<img src ="${item.cover.url}"><br>${item.title}`,
}));

View File

@ -53,9 +53,6 @@ module.exports = (html, timeZone = -serverOffset) => {
} else if (/(\d+)月(\d+)日 (\d+):(\d+)/.exec(html)) {
math = /(\d+)月(\d+)日 (\d+):(\d+)/.exec(html);
date = new Date(date.getFullYear(), parseInt(math[1]) - 1, math[2], math[3], math[4]);
} else if (/(\d+)月(\d+)日 (\d+)时(\d+)分/.exec(html)) {
math = /(\d+)月(\d+)日 (\d+)时(\d+)分/.exec(html);
date = new Date(date.getFullYear(), parseInt(math[1]) - 1, math[2], math[3], math[4]);
} else if (/(\d+)月(\d+)日/.exec(html)) {
math = /(\d+)月(\d+)日/.exec(html);
date = new Date(date.getFullYear(), parseInt(math[1]) - 1, math[2]);

View File

@ -47,7 +47,7 @@
"eslint-plugin-prettier": "3.1.4",
"jest": "26.1.0",
"mockdate": "3.0.2",
"nock": "13.0.3",
"nock": "13.0.2",
"nodemon": "2.0.4",
"pinyin": "2.9.1",
"prettier": "2.0.5",
@ -80,7 +80,7 @@
"etag": "1.8.1",
"fanfou-sdk": "4.1.0",
"git-rev-sync": "2.0.0",
"googleapis": "57.0.0",
"googleapis": "56.0.0",
"got": "11.5.1",
"he": "1.2.0",
"hooman": "1.2.5",

View File

@ -5789,10 +5789,10 @@ googleapis-common@^4.4.0:
url-template "^2.0.8"
uuid "^8.0.0"
googleapis@57.0.0:
version "57.0.0"
resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-57.0.0.tgz#d19184ac4b2056e3e7d5f4c78baf7cbc1cf08460"
integrity sha512-QTeh4/i1xsueUVRzVZ3zYIfckPnmSpVeBIkWGh1BJtXUrUapaVMIp+wuJ3Z10anHwvy+n24ypBtuuRX0oR7dPQ==
googleapis@56.0.0:
version "56.0.0"
resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-56.0.0.tgz#28f55e1e6ba72e523895f0afe6bc8529b9c3bcef"
integrity sha512-qf8Xp7QV7h81nWzspRCMIEnFsG6aBrsomkl0H/578G8/8lIZ/tt+6yDexVTPsR6XDo/jhSb4rtN9462AmLhQxA==
dependencies:
google-auth-library "^6.0.0"
googleapis-common "^4.4.0"
@ -8531,10 +8531,10 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"
nock@13.0.3:
version "13.0.3"
resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.3.tgz#9f81f04499af6a87f9c419a023920b623d715110"
integrity sha512-hDscKS5chEfyEiF8J1syz8mkkH6Wetp04ECAAPNdL5k6e6WmRgx9FZZNnCrjePNdykgiiPXORBcXbNmMzFOP5w==
nock@13.0.2:
version "13.0.2"
resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.2.tgz#3e50f88348edbb90cce1bbbf0a3ea6a068993983"
integrity sha512-Wm8H22iT3UKPDf138tmgJ0NRfCLd9f2LByki9T2mGHnB66pEqvJh3gV/up1ZufZF24n7/pDYyLGybdqOzF3JIw==
dependencies:
debug "^4.1.0"
json-stringify-safe "^5.0.1"