rsshub 1.0.0-master.fbabfc2 → 1.0.0-master.fc015b9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/router.js +1 -1
- package/lib/v2/acg17/maintainer.js +3 -0
- package/lib/v2/acg17/post.js +20 -0
- package/lib/v2/acg17/radar.js +13 -0
- package/lib/v2/acg17/router.js +3 -0
- package/lib/v2/apple/exchange_repair.js +28 -21
- package/lib/v2/bdys/index.js +98 -0
- package/lib/v2/bdys/maintainer.js +3 -0
- package/lib/v2/bdys/radar.js +20 -0
- package/lib/v2/bdys/router.js +3 -0
- package/lib/v2/bdys/templates/desc.art +21 -0
- package/lib/v2/gov/beijing/bphc/index.js +1 -1
- package/lib/v2/jin10/index.js +58 -0
- package/lib/v2/jin10/maintainer.js +3 -0
- package/lib/v2/jin10/radar.js +13 -0
- package/lib/v2/jin10/router.js +3 -0
- package/lib/v2/jin10/templates/description.art +2 -0
- package/lib/v2/mclaren/index.js +83 -82
- package/lib/v2/mclaren/radar.js +18 -15
- package/lib/v2/piyao/jrpy.js +39 -0
- package/lib/v2/piyao/maintainer.js +3 -0
- package/lib/v2/piyao/radar.js +13 -0
- package/lib/v2/piyao/router.js +3 -0
- package/lib/v2/rodong/maintainer.js +3 -0
- package/lib/v2/rodong/news.js +45 -0
- package/lib/v2/rodong/radar.js +13 -0
- package/lib/v2/rodong/router.js +3 -0
- package/lib/v2/stcn/index.js +25 -32
- package/lib/v2/stcn/maintainer.js +0 -3
- package/lib/v2/stcn/radar.js +4 -22
- package/lib/v2/stcn/router.js +1 -1
- package/lib/v2/u9a9/index.js +66 -0
- package/lib/v2/u9a9/maintainer.js +4 -0
- package/lib/v2/u9a9/radar.js +19 -0
- package/lib/v2/u9a9/router.js +4 -0
- package/package.json +3 -3
- package/lib/routes/jinshi/index.js +0 -35
- package/lib/v2/mp4er/index.js +0 -83
- package/lib/v2/mp4er/maintainer.js +0 -3
- package/lib/v2/mp4er/radar.js +0 -13
- package/lib/v2/mp4er/router.js +0 -3
package/lib/router.js
CHANGED
|
@@ -1798,7 +1798,7 @@ router.get('/im2maker/:channel?', lazyloadRouteHandler('./routes/im2maker/index'
|
|
|
1798
1798
|
router.get('/cninfo/announcement/:column/:code/:orgId/:category?/:search?', lazyloadRouteHandler('./routes/cninfo/announcement'));
|
|
1799
1799
|
|
|
1800
1800
|
// 金十数据
|
|
1801
|
-
router.get('/jinshi/index', lazyloadRouteHandler('./routes/jinshi/index'));
|
|
1801
|
+
// router.get('/jinshi/index', lazyloadRouteHandler('./routes/jinshi/index'));
|
|
1802
1802
|
|
|
1803
1803
|
// 中华人民共和国农业农村部
|
|
1804
1804
|
router.get('/gov/moa/sjzxfb', lazyloadRouteHandler('./routes/gov/moa/sjzxfb'));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
|
|
4
|
+
const host = 'http://acg17.com';
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const response = await got(`${host}/wp-json/wp/v2/posts?per_page=30`);
|
|
8
|
+
const list = response.data;
|
|
9
|
+
ctx.state.data = {
|
|
10
|
+
title: `ACG17 - 全部文章`,
|
|
11
|
+
link: `${host}/blog`,
|
|
12
|
+
description: 'ACG17 - 全部文章',
|
|
13
|
+
item: list.map((item) => ({
|
|
14
|
+
title: item.title.rendered,
|
|
15
|
+
link: item.link,
|
|
16
|
+
pubDate: parseDate(item.date_gmt),
|
|
17
|
+
description: item.content.rendered,
|
|
18
|
+
})),
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1,39 +1,46 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
|
-
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
4
|
const host = 'https://support.apple.com/';
|
|
5
5
|
|
|
6
6
|
module.exports = async (ctx) => {
|
|
7
7
|
const country = ctx.params.country ?? '';
|
|
8
|
-
const link = new URL(`${country}/
|
|
8
|
+
const link = new URL(`${country}/service-programs`, host).href;
|
|
9
9
|
|
|
10
|
-
const response = await got
|
|
10
|
+
const response = await got(link);
|
|
11
11
|
const $ = cheerio.load(response.data);
|
|
12
|
-
const list = $('section.as-
|
|
12
|
+
const list = $('section.as-container-column')
|
|
13
|
+
.toArray()
|
|
14
|
+
.map((item) => {
|
|
15
|
+
item = $(item);
|
|
16
|
+
const a = item.find('.icon-chevronright').parent();
|
|
17
|
+
return {
|
|
18
|
+
title: a.text(),
|
|
19
|
+
link: new URL(a.attr('href'), host).href,
|
|
20
|
+
pubDate: parseDate(item.find('.note').text(), ['MMMM D, YYYY', 'D MMMM YYYY', 'YYYY 年 M 月 D 日']),
|
|
21
|
+
};
|
|
22
|
+
});
|
|
13
23
|
|
|
14
24
|
const out = await Promise.all(
|
|
15
|
-
list.map((item) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const itemUrl = new URL($a.attr('href'), host).href;
|
|
19
|
-
|
|
20
|
-
return ctx.cache.tryGet(itemUrl, async () => {
|
|
21
|
-
const response = await got.get(itemUrl);
|
|
25
|
+
list.map((item) =>
|
|
26
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
27
|
+
const response = await got(item.link);
|
|
22
28
|
const $$ = cheerio.load(response.data);
|
|
23
|
-
const description = $$('.main').html();
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
// delete input and dropdown elements
|
|
31
|
+
$$('div.as-sn-lookup-wrapper').remove();
|
|
32
|
+
$$('div.as-dropdown-wrapper').remove();
|
|
33
|
+
item.description = $$('.main').html();
|
|
34
|
+
|
|
35
|
+
item.author = 'Apple Inc.';
|
|
36
|
+
|
|
37
|
+
return item;
|
|
38
|
+
})
|
|
39
|
+
)
|
|
33
40
|
);
|
|
34
41
|
|
|
35
42
|
ctx.state.data = {
|
|
36
|
-
title: `Apple - ${$('.
|
|
43
|
+
title: `Apple - ${$('h1.as-center').text()}`,
|
|
37
44
|
link,
|
|
38
45
|
item: out,
|
|
39
46
|
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
const { art } = require('@/utils/render');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const asyncPool = require('tiny-async-pool');
|
|
8
|
+
const config = require('@/config').value;
|
|
9
|
+
|
|
10
|
+
// Visit https://www.bdys.me for the list of domains
|
|
11
|
+
const allowDomains = ['52bdys.com', 'bde4.icu', 'bdys01.com'];
|
|
12
|
+
|
|
13
|
+
module.exports = async (ctx) => {
|
|
14
|
+
const caty = ctx.params.caty || 'all';
|
|
15
|
+
const type = ctx.params.type || 'all';
|
|
16
|
+
const area = ctx.params.area || 'all';
|
|
17
|
+
const year = ctx.params.year || 'all';
|
|
18
|
+
const order = ctx.params.order || '0';
|
|
19
|
+
|
|
20
|
+
const site = ctx.query.domain || 'bdys01.com';
|
|
21
|
+
if (!config.feature.allow_user_supply_unsafe_domain && !allowDomains.includes(new URL(`https://${site}`).hostname)) {
|
|
22
|
+
ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const rootUrl = `https://www.${site}`;
|
|
26
|
+
const currentUrl = `${rootUrl}/s/${caty}?${type === 'all' ? '' : '&type=' + type}${area === 'all' ? '' : '&area=' + area}${year === 'all' ? '' : '&year=' + year}&order=${order}`;
|
|
27
|
+
const response = await got({
|
|
28
|
+
method: 'get',
|
|
29
|
+
url: currentUrl,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const $ = cheerio.load(response.data);
|
|
33
|
+
|
|
34
|
+
let jsessionid = '';
|
|
35
|
+
|
|
36
|
+
const list = $('.card-body .card a')
|
|
37
|
+
.slice(0, 15)
|
|
38
|
+
.toArray()
|
|
39
|
+
.map((item) => {
|
|
40
|
+
item = $(item);
|
|
41
|
+
const link = item.attr('href').split(';jsessionid=');
|
|
42
|
+
jsessionid = link[1];
|
|
43
|
+
const next = item.next();
|
|
44
|
+
return {
|
|
45
|
+
title: next.find('h3').text(),
|
|
46
|
+
link: `${rootUrl}${link[0]}`,
|
|
47
|
+
pubDate: parseDate(next.find('.text-muted').text()),
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const headers = {
|
|
52
|
+
cookie: `JSESSIONID=${jsessionid}`,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const items = [];
|
|
56
|
+
|
|
57
|
+
for await (const data of asyncPool(1, list, (item) =>
|
|
58
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
59
|
+
const detailResponse = await got({
|
|
60
|
+
method: 'get',
|
|
61
|
+
url: item.link,
|
|
62
|
+
headers,
|
|
63
|
+
});
|
|
64
|
+
const downloadResponse = await got({
|
|
65
|
+
method: 'get',
|
|
66
|
+
url: `${rootUrl}/downloadInfo/list?mid=${item.link.split('/')[4].split('.')[0]}`,
|
|
67
|
+
headers,
|
|
68
|
+
});
|
|
69
|
+
const content = cheerio.load(detailResponse.data);
|
|
70
|
+
|
|
71
|
+
content('svg').remove();
|
|
72
|
+
const torrents = content('.download-list .list-group');
|
|
73
|
+
|
|
74
|
+
item.description = art(path.join(__dirname, 'templates/desc.art'), {
|
|
75
|
+
info: content('.row.mt-3').html(),
|
|
76
|
+
synopsis: content('#synopsis').html(),
|
|
77
|
+
links: downloadResponse.data,
|
|
78
|
+
torrents: torrents.html(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
item.pubDate = timezone(parseDate(content('.bg-purple-lt').text().replace('更新时间:', '')), +8);
|
|
82
|
+
item.guid = `${item.link}#${content('.card h1').text()}`;
|
|
83
|
+
|
|
84
|
+
item.enclosure_url = torrents.html() ? `${rootUrl}${torrents.find('a').first().attr('href')}` : downloadResponse.data.pop().url;
|
|
85
|
+
item.enclosure_type = 'application/x-bittorrent';
|
|
86
|
+
|
|
87
|
+
return item;
|
|
88
|
+
})
|
|
89
|
+
)) {
|
|
90
|
+
items.push(data);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
ctx.state.data = {
|
|
94
|
+
title: '哔嘀影视',
|
|
95
|
+
link: currentUrl,
|
|
96
|
+
item: items,
|
|
97
|
+
};
|
|
98
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const bdys = {
|
|
2
|
+
_name: '哔嘀影视',
|
|
3
|
+
'.': [
|
|
4
|
+
{
|
|
5
|
+
title: '首页',
|
|
6
|
+
docs: 'https://docs.rsshub.app/multimedia.html#bi-di-ying-shi',
|
|
7
|
+
source: ['/s/:caty'],
|
|
8
|
+
target: (params, url) => {
|
|
9
|
+
const searchParams = new URL(url).searchParams;
|
|
10
|
+
return `/bdys/${params.caty}/${searchParams.get('type') || 'all'}/${searchParams.get('area') || 'all'}/${searchParams.get('year') || 'all'}/${searchParams.get('order') || '0'}`;
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
module.exports = {
|
|
17
|
+
'52bdys.com': bdys,
|
|
18
|
+
'bde4.icu': bdys,
|
|
19
|
+
'bdys01.com': bdys,
|
|
20
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{{ if info }}
|
|
2
|
+
{{@ info }}<br>
|
|
3
|
+
{{ /if }}
|
|
4
|
+
|
|
5
|
+
{{ if synopsis }}
|
|
6
|
+
{{@ synopsis }}<br>
|
|
7
|
+
{{ /if}}
|
|
8
|
+
|
|
9
|
+
{{ if links }}
|
|
10
|
+
<div><b>下载地址:</b>
|
|
11
|
+
{{ each links link }}
|
|
12
|
+
<div class="item"><div class="content">{{ link.downloadCategory.name }}: <a href="{{ link.url }}">{{ link.url }}</a></div></div>
|
|
13
|
+
{{ /each }}
|
|
14
|
+
</div>
|
|
15
|
+
{{ /if }}
|
|
16
|
+
|
|
17
|
+
{{ if torrents }}
|
|
18
|
+
<div><b>种子列表:</b>
|
|
19
|
+
{{@ torrents }}
|
|
20
|
+
</div>
|
|
21
|
+
{{ /if }}
|
|
@@ -18,7 +18,7 @@ const mapping = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
module.exports = async (ctx) => {
|
|
21
|
-
const rootUrl = '
|
|
21
|
+
const rootUrl = 'https://gycpt.bphc.com.cn';
|
|
22
22
|
const defaultPath = 'announcement';
|
|
23
23
|
|
|
24
24
|
const pathname = ctx.path.replace(/(^\/beijing\/bphc|\/$)/g, '');
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const config = require('@/config').value;
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const { important = false } = ctx.params;
|
|
10
|
+
const data = await ctx.cache.tryGet(
|
|
11
|
+
'jin10:index',
|
|
12
|
+
async () => {
|
|
13
|
+
const { data: response } = await got('https://flash-api.jin10.com/get_flash_list', {
|
|
14
|
+
headers: {
|
|
15
|
+
'x-app-id': 'bVBF4FyRTn5NJF5n',
|
|
16
|
+
'x-version': '1.0.0',
|
|
17
|
+
},
|
|
18
|
+
searchParams: {
|
|
19
|
+
channel: '-8200',
|
|
20
|
+
vip: '1',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return response.data;
|
|
24
|
+
},
|
|
25
|
+
config.cache.routeExpire,
|
|
26
|
+
false
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const item = data.map((item) => {
|
|
30
|
+
const titleMatch = item.data.content.match(/^【(.*?)】/);
|
|
31
|
+
let title;
|
|
32
|
+
let content = item.data.content;
|
|
33
|
+
if (titleMatch) {
|
|
34
|
+
title = titleMatch[1];
|
|
35
|
+
content = content.replace(titleMatch[0], '');
|
|
36
|
+
} else {
|
|
37
|
+
title = item.data.vip_title || item.data.content;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
title,
|
|
42
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
43
|
+
content,
|
|
44
|
+
pic: item.data.pic,
|
|
45
|
+
}),
|
|
46
|
+
pubDate: timezone(parseDate(item.time), 8),
|
|
47
|
+
link: item.data.link,
|
|
48
|
+
guid: `jin10:index:${item.id}`,
|
|
49
|
+
important: item.important,
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
ctx.state.data = {
|
|
54
|
+
title: '金十数据',
|
|
55
|
+
link: 'https://www.jin10.com/',
|
|
56
|
+
item: important ? item.filter((item) => item.important) : item,
|
|
57
|
+
};
|
|
58
|
+
};
|
package/lib/v2/mclaren/index.js
CHANGED
|
@@ -4,92 +4,93 @@ const path = require('path');
|
|
|
4
4
|
const { art } = require('@/utils/render');
|
|
5
5
|
|
|
6
6
|
module.exports = async (ctx) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
let baseUrl, apiUrl;
|
|
8
|
+
let title, description;
|
|
9
|
+
let lang = ctx.params.lang;
|
|
10
|
+
switch (lang) {
|
|
11
|
+
case 'en':
|
|
12
|
+
baseUrl = 'https://www.mclaren.com';
|
|
13
|
+
title = 'McLaren Racing – Official Website';
|
|
14
|
+
description = 'Latest news and insight from McLaren Racing. Team and driver updates, videos and McLaren Formula 1 LIVE commentary.';
|
|
15
|
+
lang = 'en-UK';
|
|
16
|
+
break;
|
|
17
|
+
case 'zh':
|
|
18
|
+
baseUrl = 'https://cn.mclaren.com';
|
|
19
|
+
title = '迈凯伦赛车 — 官方网站';
|
|
20
|
+
description = '来自迈凯伦一级方程式车队的最新消息。 查看车队和车手近况、视频以及比赛中的迈凯伦实况评论和实时数据。';
|
|
21
|
+
lang = 'zh-CN';
|
|
22
|
+
break;
|
|
23
|
+
case 'es':
|
|
24
|
+
baseUrl = 'https://es.mclaren.com';
|
|
25
|
+
title = 'McLaren Racing - Sitio web oficial';
|
|
26
|
+
description =
|
|
27
|
+
'Consulta las últimas noticias del equipo de Fórmula 1 McLaren. Incluye información sobre el equipo, las últimas actualizaciones de los pilotos y McLaren LIVE, una aplicación con la que podrás seguir los comentarios en directo.';
|
|
28
|
+
lang = 'es-ES';
|
|
29
|
+
break;
|
|
30
|
+
default:
|
|
31
|
+
throw Error(`Language '${lang}' is not supported.`);
|
|
32
|
+
}
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const { category = 'all' } = ctx.params;
|
|
35
|
+
const categoryArr = ['all', 'article', 'report', 'gallery', 'video', 'blog', 'photo_essay'];
|
|
36
|
+
if (!categoryArr.includes(category)) {
|
|
37
|
+
throw Error(`Category '${category}' is not supported.`);
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
const link = baseUrl + '/racing/articles/';
|
|
41
|
+
apiUrl = baseUrl + '/racing/api/grid-search/?count=30&offset=0&type=';
|
|
42
|
+
// count: number of requested entries; default to 16, up to 30.
|
|
43
|
+
// offset: default to 0.
|
|
44
|
+
if (category !== 'all') {
|
|
45
|
+
apiUrl += category;
|
|
46
|
+
}
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
const response = await got(apiUrl);
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
const html = response.data.html;
|
|
51
|
+
const $ = cheerio.load(html);
|
|
52
|
+
const list = $('li')
|
|
53
|
+
.toArray()
|
|
54
|
+
.map((item) => {
|
|
55
|
+
item = $(item);
|
|
56
|
+
const thumbnailUrl = item.find('div.start-grid-content__img').attr('style').slice(22, -2);
|
|
57
|
+
return {
|
|
58
|
+
link: baseUrl + item.find('a.start-grid-content__link').attr('href'),
|
|
59
|
+
thumbnailUrl, // Pass the thumbnail image
|
|
60
|
+
};
|
|
61
|
+
});
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
63
|
+
const items = await Promise.all(
|
|
64
|
+
list.map((item) =>
|
|
65
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
66
|
+
const itemRep = await got(item.link);
|
|
67
|
+
const $ = cheerio.load(itemRep.data);
|
|
68
|
+
$('.livestream--wrapper').last().remove();
|
|
69
|
+
item.title = $('meta[property="og:title"]').attr('content').slice(17);
|
|
70
|
+
item.pubDate = Date.parse($('time[datetime]').first().attr('datetime'));
|
|
71
|
+
const artParams = {
|
|
72
|
+
desc: $('meta[property="og:description"]').attr('content'),
|
|
73
|
+
heroUrl: $('meta[property="og:image"]').attr('content'),
|
|
74
|
+
videoId: $('a[data-video-id]').attr('data-video-id'),
|
|
75
|
+
};
|
|
76
|
+
$('.meta--hold, .show-for-small').remove();
|
|
77
|
+
artParams.content = $('div.article-body').html();
|
|
78
|
+
item.description = art(path.join(__dirname, 'templates/desc.art'), artParams);
|
|
79
|
+
item.media = {
|
|
80
|
+
thumbnail: {
|
|
81
|
+
url: item.thumbnailUrl,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
return item;
|
|
85
|
+
})
|
|
86
|
+
)
|
|
87
|
+
);
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
ctx.state.data = {
|
|
90
|
+
language: lang,
|
|
91
|
+
title,
|
|
92
|
+
description,
|
|
93
|
+
link,
|
|
94
|
+
item: items,
|
|
95
|
+
};
|
|
95
96
|
};
|
package/lib/v2/mclaren/radar.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
'mclaren.com': {
|
|
3
3
|
_name: 'Mclaren Racing',
|
|
4
|
-
www: [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
www: [
|
|
5
|
+
{
|
|
6
|
+
title: 'Mclaren Racing',
|
|
7
|
+
docs: 'https://docs.rsshub.app/new-media.html#mai-kai-lun-sai-che',
|
|
8
|
+
source: '/racing/articles/',
|
|
9
|
+
target: '/mclaren/en/all',
|
|
9
10
|
},
|
|
10
11
|
],
|
|
11
|
-
cn: [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
cn: [
|
|
13
|
+
{
|
|
14
|
+
title: '迈凯伦赛车',
|
|
15
|
+
docs: 'https://docs.rsshub.app/new-media.html#mai-kai-lun-sai-che',
|
|
16
|
+
source: '/racing/articles/',
|
|
17
|
+
target: '/mclaren/zh/all',
|
|
16
18
|
},
|
|
17
19
|
],
|
|
18
|
-
es: [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
es: [
|
|
21
|
+
{
|
|
22
|
+
title: 'Mclaren Racing',
|
|
23
|
+
docs: 'https://docs.rsshub.app/new-media.html#mai-kai-lun-sai-che',
|
|
24
|
+
source: '/racing/articles/',
|
|
25
|
+
target: '/mclaren/es/all',
|
|
23
26
|
},
|
|
24
27
|
],
|
|
25
28
|
},
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
const rootUrl = 'https://www.piyao.org.cn';
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const currentUrl = `${rootUrl}/jrpy/index.htm`;
|
|
9
|
+
|
|
10
|
+
const response = await got(currentUrl);
|
|
11
|
+
const $ = cheerio.load(response.data);
|
|
12
|
+
const list = $('ul#list li')
|
|
13
|
+
.map((_, item) => ({
|
|
14
|
+
title: $(item).find('a').text(),
|
|
15
|
+
link: new URL($(item).find('a').attr('href'), rootUrl).href,
|
|
16
|
+
}))
|
|
17
|
+
.get();
|
|
18
|
+
|
|
19
|
+
const items = await Promise.all(
|
|
20
|
+
list.map((item) =>
|
|
21
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
22
|
+
const detailResponse = await got(item.link);
|
|
23
|
+
const content = cheerio.load(detailResponse.data);
|
|
24
|
+
|
|
25
|
+
item.title = content('div.con_tit > h2').text();
|
|
26
|
+
item.description = content('div.con_txt').html();
|
|
27
|
+
item.pubDate = parseDate(content('div.con_tit > p > span').text().split('时间:')[1]);
|
|
28
|
+
|
|
29
|
+
return item;
|
|
30
|
+
})
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
ctx.state.data = {
|
|
35
|
+
title: '今日辟谣',
|
|
36
|
+
link: currentUrl,
|
|
37
|
+
item: items,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'piyao.org.cn': {
|
|
3
|
+
_name: '中国互联网联合辟谣平台',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '今日辟谣',
|
|
7
|
+
docs: 'https://docs.rsshub.app/other.html#zhong-guo-hu-lian-wang-lian-he-pi-yao-ping-tai',
|
|
8
|
+
source: ['/jrpy/index.htm'],
|
|
9
|
+
target: '/piyao/jrpy',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
const host = 'http://www.rodong.rep.kp';
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const { language = 'ko' } = ctx.params;
|
|
9
|
+
const link = `${host}/${language}/index.php?MkBAMkAxQA==`;
|
|
10
|
+
const { data: response } = await got(link);
|
|
11
|
+
|
|
12
|
+
const $ = cheerio.load(response);
|
|
13
|
+
const list = $('.date_news_list .row')
|
|
14
|
+
.toArray()
|
|
15
|
+
.map((item) => {
|
|
16
|
+
item = $(item);
|
|
17
|
+
return {
|
|
18
|
+
title: item.find('.media-body').text(),
|
|
19
|
+
link: `${host}/${language}/${item.find('.media-body a').attr('href')}`,
|
|
20
|
+
author: item.find('.col-sm-3').text(),
|
|
21
|
+
pubDate: parseDate(item.find('.news_date').text(), 'YYYY.M.D.'),
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const items = await Promise.all(
|
|
26
|
+
list.map((item) =>
|
|
27
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
28
|
+
const { data: response } = await got(item.link);
|
|
29
|
+
const $ = cheerio.load(response);
|
|
30
|
+
|
|
31
|
+
$('.news_Title, .NewsDetail, .News_Detail, #moveNews').remove();
|
|
32
|
+
item.description = $('.col-sm-8').html();
|
|
33
|
+
|
|
34
|
+
return item;
|
|
35
|
+
})
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
ctx.state.data = {
|
|
40
|
+
title: $('head title').text(),
|
|
41
|
+
description: $('head meta[name="description"]').attr('content'),
|
|
42
|
+
link,
|
|
43
|
+
item: items,
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'rodong.rep.kp': {
|
|
3
|
+
_name: '劳动新闻',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '新闻',
|
|
7
|
+
docs: 'https://docs.rsshub.app/traditional-media.html#lao-dong-xin-wen',
|
|
8
|
+
source: ['/cn/index.php', '/en/index.php', '/ko/index.php', '/cn', '/en', '/ko'],
|
|
9
|
+
target: '/rodong/news',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
package/lib/v2/stcn/index.js
CHANGED
|
@@ -3,60 +3,53 @@ const cheerio = require('cheerio');
|
|
|
3
3
|
const timezone = require('@/utils/timezone');
|
|
4
4
|
const { parseDate } = require('@/utils/parse-date');
|
|
5
5
|
|
|
6
|
-
const shortcuts = {
|
|
7
|
-
'news/news': 'xw/news',
|
|
8
|
-
'news/gd': 'gd',
|
|
9
|
-
'news/sd': 'xw/sd',
|
|
10
|
-
'news/pl': 'xw/pl',
|
|
11
|
-
'data/data': 'data',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
6
|
module.exports = async (ctx) => {
|
|
15
|
-
|
|
16
|
-
if (shortcuts.hasOwnProperty(path)) {
|
|
17
|
-
path = shortcuts[path];
|
|
18
|
-
}
|
|
7
|
+
const id = ctx.params.id ?? 'yw';
|
|
19
8
|
|
|
20
9
|
const rootUrl = 'https://www.stcn.com';
|
|
21
|
-
const currentUrl = `${rootUrl}/${
|
|
10
|
+
const currentUrl = `${rootUrl}/article/list/${id}.html`;
|
|
11
|
+
const apiUrl = `${rootUrl}/article/list.html?type=${id}`;
|
|
22
12
|
|
|
23
13
|
const response = await got({
|
|
24
14
|
method: 'get',
|
|
25
|
-
url:
|
|
15
|
+
url: apiUrl,
|
|
26
16
|
});
|
|
27
17
|
|
|
28
|
-
const match = response.data.match(/var curr_channel_id = "(light_\d+)";/);
|
|
29
18
|
const $ = cheerio.load(response.data);
|
|
30
19
|
|
|
31
|
-
$('.
|
|
32
|
-
|
|
33
|
-
let items = $('.box_left, .box_left2, .left2')
|
|
34
|
-
.find('a[title]')
|
|
35
|
-
.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 20)
|
|
20
|
+
let items = $('.t, .tt, .title')
|
|
21
|
+
.find('a')
|
|
36
22
|
.toArray()
|
|
37
23
|
.map((item) => {
|
|
38
24
|
item = $(item);
|
|
39
25
|
|
|
26
|
+
const link = item.attr('href');
|
|
27
|
+
|
|
40
28
|
return {
|
|
41
|
-
title: item.text(),
|
|
42
|
-
link:
|
|
29
|
+
title: item.text().replace(/(^【|】$)/g, ''),
|
|
30
|
+
link: /^http/.test(link) ? link : `${rootUrl}${link}`,
|
|
43
31
|
};
|
|
44
32
|
});
|
|
45
33
|
|
|
46
34
|
items = await Promise.all(
|
|
47
35
|
items.map((item) =>
|
|
48
36
|
ctx.cache.tryGet(item.link, async () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
if (/\.html$/.test(item.link)) {
|
|
38
|
+
const detailResponse = await got({
|
|
39
|
+
method: 'get',
|
|
40
|
+
url: item.link,
|
|
41
|
+
});
|
|
53
42
|
|
|
54
|
-
|
|
43
|
+
const content = cheerio.load(detailResponse.data);
|
|
55
44
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
item.title = content('.detail-title').text();
|
|
46
|
+
item.author = content('.detail-info span').first().text().split(':').pop();
|
|
47
|
+
item.pubDate = timezone(parseDate(content('.detail-info span').last().text()), +8);
|
|
48
|
+
item.category = content('.detail-content-tags div')
|
|
49
|
+
.toArray()
|
|
50
|
+
.map((t) => content(t).text());
|
|
51
|
+
item.description = content('.detail-content').html();
|
|
52
|
+
}
|
|
60
53
|
|
|
61
54
|
return item;
|
|
62
55
|
})
|
|
@@ -64,7 +57,7 @@ module.exports = async (ctx) => {
|
|
|
64
57
|
);
|
|
65
58
|
|
|
66
59
|
ctx.state.data = {
|
|
67
|
-
title:
|
|
60
|
+
title: `证券时报网 - ${$('.breadcrumb a').last().text()}`,
|
|
68
61
|
link: currentUrl,
|
|
69
62
|
item: items,
|
|
70
63
|
};
|
package/lib/v2/stcn/radar.js
CHANGED
|
@@ -3,28 +3,10 @@ module.exports = {
|
|
|
3
3
|
_name: '证券时报网',
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
|
-
title: '
|
|
7
|
-
docs: 'https://docs.rsshub.app/finance.html#zheng-quan-shi-bao-wang-
|
|
8
|
-
source: ['/
|
|
9
|
-
target: (params, url) => `/stcn
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
title: '快讯',
|
|
13
|
-
docs: 'https://docs.rsshub.app/finance.html#zheng-quan-shi-bao-wang-kuai-xun',
|
|
14
|
-
source: ['/kuaixun/:id', '/kuaixun', '/'],
|
|
15
|
-
target: (params, url) => `/stcn${new URL(url).pathname}`,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
title: '股市',
|
|
19
|
-
docs: 'https://docs.rsshub.app/finance.html#zheng-quan-shi-bao-wang-gu-shi',
|
|
20
|
-
source: ['/stock/:id', '/stock', '/'],
|
|
21
|
-
target: (params, url) => `/stcn${new URL(url).pathname}`,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: '数据',
|
|
25
|
-
docs: 'https://docs.rsshub.app/finance.html#zheng-quan-shi-bao-wang-shu-ju',
|
|
26
|
-
source: ['/data/:id', '/data', '/'],
|
|
27
|
-
target: (params, url) => `/stcn${new URL(url).pathname}`,
|
|
6
|
+
title: '栏目',
|
|
7
|
+
docs: 'https://docs.rsshub.app/finance.html#zheng-quan-shi-bao-wang-lan-mu',
|
|
8
|
+
source: ['/'],
|
|
9
|
+
target: (params, url) => `/stcn/${new URL(url).toString().match(/article\/list\/(.*)\.html/)[1]}`,
|
|
28
10
|
},
|
|
29
11
|
],
|
|
30
12
|
},
|
package/lib/v2/stcn/router.js
CHANGED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
|
|
6
|
+
const baseUrl = 'https://u9a9.com';
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const { preview, keyword } = ctx.params;
|
|
10
|
+
|
|
11
|
+
let link;
|
|
12
|
+
let title;
|
|
13
|
+
if (keyword) {
|
|
14
|
+
link = `${baseUrl}/?type=2&search=${keyword}`;
|
|
15
|
+
title = `${keyword} - U9A9`;
|
|
16
|
+
} else {
|
|
17
|
+
link = baseUrl;
|
|
18
|
+
title = 'U9A9';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const { data: response } = await got(link);
|
|
22
|
+
const $ = cheerio.load(response);
|
|
23
|
+
|
|
24
|
+
const items = $('table tr')
|
|
25
|
+
.slice(1) // skip thead
|
|
26
|
+
.toArray()
|
|
27
|
+
.map((item) => {
|
|
28
|
+
item = $(item);
|
|
29
|
+
const a = item.find('td').eq(1).find('a');
|
|
30
|
+
const { size, unit } = item
|
|
31
|
+
.find('td')
|
|
32
|
+
.eq(3)
|
|
33
|
+
.text()
|
|
34
|
+
.match(/(?<size>\d+\.\d+)\s(?<unit>\w+)/).groups;
|
|
35
|
+
return {
|
|
36
|
+
title: a.attr('title'),
|
|
37
|
+
link: `${baseUrl}${a.attr('href')}`,
|
|
38
|
+
pubDate: timezone(parseDate(item.find('td').eq(4).text()), +8),
|
|
39
|
+
|
|
40
|
+
enclosure_url: item.find('td').eq(2).find('a').eq(1).attr('href'),
|
|
41
|
+
enclosure_length: parseInt(size * (unit === 'GB' ? 1024 * 1024 * 1024 : 1024 * 1024)),
|
|
42
|
+
enclosure_type: 'application/x-bittorrent',
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (preview) {
|
|
47
|
+
await Promise.all(
|
|
48
|
+
items.map((item) =>
|
|
49
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
50
|
+
const { data: response } = await got(item.link);
|
|
51
|
+
const $ = cheerio.load(response);
|
|
52
|
+
|
|
53
|
+
item.description = $('.panel-body').eq(1).html();
|
|
54
|
+
|
|
55
|
+
return item;
|
|
56
|
+
})
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ctx.state.data = {
|
|
62
|
+
title,
|
|
63
|
+
link,
|
|
64
|
+
item: items,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'u9a9.com': {
|
|
3
|
+
_name: 'U9A9',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '首页',
|
|
7
|
+
docs: 'https://docs.rsshub.app/multimedia.html#u9a9',
|
|
8
|
+
source: ['/'],
|
|
9
|
+
target: '/u9a9',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '搜索',
|
|
13
|
+
docs: 'https://docs.rsshub.app/multimedia.html#u9a9',
|
|
14
|
+
source: ['/'],
|
|
15
|
+
target: (_, url) => `/u9a9/search/${new URL(url).searchParams.get('search')}`,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsshub",
|
|
3
|
-
"version": "1.0.0-master.
|
|
3
|
+
"version": "1.0.0-master.fc015b9",
|
|
4
4
|
"description": "Make RSS Great Again!",
|
|
5
5
|
"main": "lib/pkg.js",
|
|
6
6
|
"files": [
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
"eslint-plugin-prettier": "4.2.1",
|
|
62
62
|
"eslint-plugin-yml": "1.4.0",
|
|
63
63
|
"fs-extra": "11.1.0",
|
|
64
|
-
"jest": "29.4.
|
|
64
|
+
"jest": "29.4.2",
|
|
65
65
|
"jest-junit": "15.0.0",
|
|
66
66
|
"meilisearch": "0.31.1",
|
|
67
67
|
"mockdate": "3.0.5",
|
|
68
68
|
"nock": "13.3.0",
|
|
69
69
|
"nodemon": "2.0.20",
|
|
70
|
-
"prettier": "2.8.
|
|
70
|
+
"prettier": "2.8.4",
|
|
71
71
|
"prettier-check": "2.0.0",
|
|
72
72
|
"pretty-quick": "3.1.3",
|
|
73
73
|
"remark": "13.0.0",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const response = await got.get('https://www.jin10.com/');
|
|
6
|
-
const $ = cheerio.load(response.data);
|
|
7
|
-
let date;
|
|
8
|
-
|
|
9
|
-
const item = $('#jin_flash_list .jin-flash-item-container')
|
|
10
|
-
.filter((index, ele) => !!$('.right-content div:first-of-type', ele).text() && !$('.is-vip', ele).length)
|
|
11
|
-
.map((index, ele) => {
|
|
12
|
-
const year = new Date().getFullYear();
|
|
13
|
-
const time = $('.item-time', ele).text();
|
|
14
|
-
const title = $('.right-content div:first-of-type', ele).text();
|
|
15
|
-
const link = $('.right-content .flash-item-share_right a', ele).attr('href');
|
|
16
|
-
|
|
17
|
-
date = $('.jin-flash-date-line span', ele).text().trim() ? $('.jin-flash-date-line span', ele).text().trim() : date;
|
|
18
|
-
|
|
19
|
-
const datetime = year + '-' + date.replace('月', '-').replace('日', ` ${time}`);
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
title,
|
|
23
|
-
link,
|
|
24
|
-
description: datetime,
|
|
25
|
-
pubDate: new Date(datetime),
|
|
26
|
-
};
|
|
27
|
-
})
|
|
28
|
-
.get();
|
|
29
|
-
|
|
30
|
-
ctx.state.data = {
|
|
31
|
-
title: '金十数据',
|
|
32
|
-
link: 'https://www.jin10.com/',
|
|
33
|
-
item,
|
|
34
|
-
};
|
|
35
|
-
};
|
package/lib/v2/mp4er/index.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const type = ctx.params.type || 'all';
|
|
6
|
-
const caty = ctx.params.caty || 'all';
|
|
7
|
-
const area = ctx.params.area || 'all';
|
|
8
|
-
const year = ctx.params.year || 'all';
|
|
9
|
-
const order = ctx.params.order || '0';
|
|
10
|
-
|
|
11
|
-
const rootUrl = 'https://www.52bdys.com';
|
|
12
|
-
const currentUrl = `${rootUrl}/s/${caty}?${type === 'all' ? '' : '&type=' + type}${area === 'all' ? '' : '&area=' + area}${year === 'all' ? '' : '&year=' + year}&order=${order}`;
|
|
13
|
-
const response = await got({
|
|
14
|
-
method: 'get',
|
|
15
|
-
url: currentUrl,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const $ = cheerio.load(response.data);
|
|
19
|
-
|
|
20
|
-
let jsessionid = '';
|
|
21
|
-
|
|
22
|
-
const list = $('.card a')
|
|
23
|
-
.slice(0, 15)
|
|
24
|
-
.map((_, item) => {
|
|
25
|
-
item = $(item);
|
|
26
|
-
const link = item.attr('href').split(';jsessionid=');
|
|
27
|
-
jsessionid = link[1];
|
|
28
|
-
return {
|
|
29
|
-
title: item.attr('title'),
|
|
30
|
-
link: `${rootUrl}${link[0]}`,
|
|
31
|
-
pubDate: Date.parse(item.parent().find('.meta span').text()),
|
|
32
|
-
};
|
|
33
|
-
})
|
|
34
|
-
.get();
|
|
35
|
-
|
|
36
|
-
const headers = {
|
|
37
|
-
cookie: `JSESSIONID=${jsessionid}`,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const items = await Promise.all(
|
|
41
|
-
list.map((item) =>
|
|
42
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
43
|
-
const detailResponse = await got({
|
|
44
|
-
method: 'get',
|
|
45
|
-
url: item.link,
|
|
46
|
-
headers,
|
|
47
|
-
});
|
|
48
|
-
const downloadResponse = await got({
|
|
49
|
-
method: 'get',
|
|
50
|
-
url: `${rootUrl}/downloadInfo/list?mid=${item.link.split('/')[4].split('.')[0]}`,
|
|
51
|
-
headers,
|
|
52
|
-
});
|
|
53
|
-
const content = cheerio.load(detailResponse.data);
|
|
54
|
-
|
|
55
|
-
let downloadLinks = '';
|
|
56
|
-
for (const downloadLink of downloadResponse.data) {
|
|
57
|
-
downloadLinks += `<div class="item"><div class="content">${downloadLink.downloadCategory.name}: <a href="${downloadLink.url}">${downloadLink.url}</a></div></div>`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const torrents = content('#torrent-list .list');
|
|
61
|
-
|
|
62
|
-
item.description = `
|
|
63
|
-
${content('.info0').html()}
|
|
64
|
-
<div>
|
|
65
|
-
<b>下载地址:</b>
|
|
66
|
-
${downloadLinks}
|
|
67
|
-
</div>
|
|
68
|
-
${torrents.html() ? `<div><b>种子列表:</b>${torrents.html()}</div>` : ''}
|
|
69
|
-
`.replace(/\n +/gm, ''); // Minify the string.
|
|
70
|
-
item.enclosure_url = torrents.html() ? `${rootUrl}${torrents.find('a.header').last().attr('href')}` : downloadResponse.data.pop().url;
|
|
71
|
-
item.enclosure_type = 'application/x-bittorrent';
|
|
72
|
-
|
|
73
|
-
return item;
|
|
74
|
-
})
|
|
75
|
-
)
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
ctx.state.data = {
|
|
79
|
-
title: '哔嘀影视',
|
|
80
|
-
link: currentUrl,
|
|
81
|
-
item: items,
|
|
82
|
-
};
|
|
83
|
-
};
|
package/lib/v2/mp4er/radar.js
DELETED
package/lib/v2/mp4er/router.js
DELETED