rsshub 1.0.0-master.fe4f650 → 1.0.0-master.fe560d2
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/README.md +3 -3
- package/lib/config.js +1 -1
- package/lib/middleware/parameter.js +3 -3
- package/lib/radar-rules.js +0 -46
- package/lib/router.js +28 -28
- package/lib/routes/v2ex/post.js +3 -0
- package/lib/utils/puppeteer-utils.js +63 -0
- package/lib/utils/puppeteer.js +13 -8
- package/lib/utils/request-wrapper.js +38 -100
- package/lib/utils/unify-proxy.js +116 -0
- package/lib/utils/wechat-mp.js +2 -0
- package/lib/v2/18comic/utils.js +2 -2
- package/lib/v2/36kr/index.js +29 -24
- package/lib/v2/agora0/maintainer.js +1 -0
- package/lib/v2/agora0/pen0.js +43 -0
- package/lib/v2/agora0/radar.js +12 -1
- package/lib/v2/agora0/router.js +1 -0
- package/lib/v2/aiea/index.js +39 -0
- package/lib/v2/aiea/maintainer.js +3 -0
- package/lib/v2/aiea/radar.js +13 -0
- package/lib/v2/aiea/router.js +3 -0
- package/lib/v2/baidu/radar.js +6 -6
- package/lib/v2/bangumi/online/online.js +4 -2
- package/lib/v2/bangumi/tv/group/reply.js +13 -1
- package/lib/v2/bangumi/tv/group/topic.js +22 -9
- package/lib/v2/bilibili/cache.js +34 -1
- package/lib/v2/bilibili/userCollection.js +1 -2
- package/lib/v2/bilibili/utils.js +10 -0
- package/lib/v2/bilibili/video-all.js +5 -2
- package/lib/v2/bilibili/video.js +3 -1
- package/lib/v2/bytes/bytes.js +25 -0
- package/lib/v2/bytes/maintainer.js +4 -0
- package/lib/v2/bytes/radar.js +13 -0
- package/lib/v2/bytes/router.js +3 -0
- package/lib/v2/caijing/maintainer.js +3 -0
- package/lib/v2/caijing/radar.js +13 -0
- package/lib/v2/caijing/roll.js +46 -0
- package/lib/v2/caijing/router.js +3 -0
- package/lib/v2/cdzjryb/maintainer.js +3 -0
- package/lib/v2/cdzjryb/projectList.js +49 -0
- package/lib/v2/cdzjryb/radar.js +13 -0
- package/lib/v2/cdzjryb/router.js +3 -0
- package/lib/v2/cdzjryb/templates/projectList.art +23 -0
- package/lib/v2/chsi/kydt.js +51 -0
- package/lib/v2/chsi/maintainer.js +3 -0
- package/lib/v2/chsi/radar.js +13 -0
- package/lib/v2/chsi/router.js +3 -0
- package/lib/v2/cnbeta/radar.js +6 -6
- package/lib/v2/cnbeta/router.js +1 -1
- package/lib/v2/cnbeta/type.js +6 -12
- package/lib/v2/cnbeta/utils.js +5 -8
- package/lib/v2/cngal/entry.js +25 -0
- package/lib/v2/cngal/maintainer.js +4 -0
- package/lib/v2/cngal/radar.js +19 -0
- package/lib/v2/cngal/router.js +4 -0
- package/lib/v2/cngal/templates/entry-description.art +4 -0
- package/lib/v2/cngal/templates/weekly-description.art +4 -0
- package/lib/v2/cngal/weekly.js +20 -0
- package/lib/v2/cnki/author.js +45 -0
- package/lib/v2/cnki/journals.js +2 -23
- package/lib/v2/cnki/maintainer.js +1 -0
- package/lib/v2/cnki/radar.js +8 -0
- package/lib/v2/cnki/router.js +1 -0
- package/lib/v2/cnki/utils.js +26 -0
- package/lib/v2/codeforces/maintainer.js +1 -0
- package/lib/v2/codeforces/radar.js +8 -0
- package/lib/v2/codeforces/recent_actions.js +47 -0
- package/lib/v2/codeforces/router.js +1 -0
- package/lib/v2/curius/links.js +43 -0
- package/lib/v2/curius/maintainer.js +3 -0
- package/lib/v2/curius/radar.js +13 -0
- package/lib/v2/curius/router.js +3 -0
- package/lib/v2/curius/templates/description.art +16 -0
- package/lib/v2/douyin/hashtag.js +20 -19
- package/lib/v2/douyin/live.js +2 -21
- package/lib/v2/douyin/user.js +2 -17
- package/lib/v2/douyin/utils.js +85 -0
- package/lib/v2/{acm-ecnu → ecnu}/contest.js +1 -4
- package/lib/v2/ecnu/maintainer.js +4 -0
- package/lib/v2/ecnu/radar.js +30 -0
- package/lib/v2/ecnu/router.js +4 -0
- package/lib/v2/{acm-ecnu → ecnu}/templates/description.art +0 -0
- package/lib/v2/ecnu/yjs.js +37 -0
- package/lib/v2/ehentai/ehapi.js +23 -12
- package/lib/v2/foresightnews/index.js +8 -11
- package/lib/v2/foreverblog/feeds.js +36 -0
- package/lib/v2/foreverblog/maintainer.js +3 -0
- package/lib/v2/foreverblog/radar.js +13 -0
- package/lib/v2/foreverblog/router.js +3 -0
- package/lib/v2/freewechat/maintainer.js +3 -0
- package/lib/v2/freewechat/profile.js +61 -0
- package/lib/v2/freewechat/radar.js +13 -0
- package/lib/v2/freewechat/router.js +3 -0
- package/lib/v2/gcores/category.js +16 -6
- package/lib/v2/good/index.js +15 -14
- package/lib/v2/gov/customs/list.js +1 -1
- package/lib/v2/gov/dianbai/dianbai.js +18 -0
- package/lib/v2/gov/gaozhou/gaozhou.js +19 -0
- package/lib/v2/gov/general/general.js +250 -0
- package/lib/v2/gov/general/templates/zcjdpt.art +128 -0
- package/lib/v2/gov/gz/index.js +38 -0
- package/lib/v2/gov/huazhou/huazhou.js +19 -0
- package/lib/v2/gov/hunan/changsha/major-email.js +52 -0
- package/lib/v2/gov/maintainer.js +19 -2
- package/lib/v2/gov/maoming/maoming.js +417 -0
- package/lib/v2/gov/maonan/maonan.js +100 -0
- package/lib/v2/gov/mgs/mgs.js +19 -0
- package/lib/v2/gov/mmht/mmht.js +19 -0
- package/lib/v2/gov/nmpa/generic.js +1 -1
- package/lib/v2/gov/radar.js +197 -0
- package/lib/v2/gov/router.js +18 -2
- package/lib/v2/gov/sasac/generic.js +42 -0
- package/lib/v2/gov/sdb/sdb.js +19 -0
- package/lib/v2/gov/shanghai/yjj/index.js +3 -1
- package/lib/v2/gov/xinyi/xinyi.js +19 -0
- package/lib/v2/gov/zhengce/govall.js +55 -0
- package/lib/v2/gov/zhengce/wenjian.js +47 -0
- package/lib/v2/gov/zhengce/zhengceku.js +22 -0
- package/lib/v2/gov/zhengce/zuixin.js +39 -0
- package/lib/v2/guanhai/index.js +47 -0
- package/lib/v2/guanhai/maintainer.js +4 -0
- package/lib/v2/guanhai/radar.js +13 -0
- package/lib/v2/guanhai/router.js +3 -0
- package/lib/v2/hackernews/index.js +6 -0
- package/lib/v2/hellogithub/volume.js +15 -32
- package/lib/v2/{heu → hrbeu}/gx/card.js +5 -10
- package/lib/v2/{heu → hrbeu}/gx/list.js +12 -20
- package/lib/v2/hrbeu/job/bigemploy.js +25 -0
- package/lib/v2/{heu → hrbeu}/job/calendar.js +8 -16
- package/lib/v2/{heu → hrbeu}/job/list.js +11 -16
- package/lib/v2/{heu → hrbeu}/maintainer.js +2 -1
- package/lib/v2/{heu → hrbeu}/radar.js +18 -10
- package/lib/v2/{heu → hrbeu}/router.js +3 -2
- package/lib/v2/{heu → hrbeu}/uae/list.js +12 -17
- package/lib/v2/hrbeu/ugs/news.js +98 -0
- package/lib/v2/{heu → hrbeu}/yjsy/list.js +8 -16
- package/lib/v2/ieee-security/maintainer.js +3 -0
- package/lib/v2/ieee-security/radar.js +13 -0
- package/lib/v2/ieee-security/router.js +3 -0
- package/lib/v2/ieee-security/sp.js +36 -0
- package/lib/v2/javbus/index.js +8 -2
- package/lib/v2/javbus/templates/description.art +12 -1
- package/lib/v2/jike/user.js +1 -0
- package/lib/v2/lang/maintainer.js +3 -0
- package/lib/v2/lang/radar.js +13 -0
- package/lib/v2/lang/room.js +40 -0
- package/lib/v2/lang/router.js +3 -0
- package/lib/v2/lang/templates/room.art +1 -0
- package/lib/v2/liulinblog/utils.js +7 -4
- package/lib/v2/luogu/daily.js +1 -1
- package/lib/v2/mangadex/index.js +73 -0
- package/lib/v2/mangadex/maintainer.js +3 -0
- package/lib/v2/mangadex/radar.js +13 -0
- package/lib/v2/mangadex/router.js +3 -0
- package/lib/v2/mihoyo/ys/news.js +3 -2
- package/lib/v2/mirror/index.js +15 -8
- package/lib/v2/mrdx/daily.js +79 -0
- package/lib/v2/mrdx/maintainer.js +3 -0
- package/lib/v2/mrdx/radar.js +13 -0
- package/lib/v2/mrdx/router.js +3 -0
- package/lib/v2/mrdx/utils.js +17 -0
- package/lib/v2/mtime/news.js +1 -1
- package/lib/v2/nautil/maintainer.js +3 -0
- package/lib/v2/nautil/radar.js +13 -0
- package/lib/v2/nautil/router.js +3 -0
- package/lib/v2/nautil/templates/description.art +6 -0
- package/lib/v2/nautil/topics.js +57 -0
- package/lib/v2/ndss-symposium/maintainer.js +3 -0
- package/lib/v2/ndss-symposium/ndss.js +80 -0
- package/lib/v2/ndss-symposium/radar.js +13 -0
- package/lib/v2/ndss-symposium/router.js +3 -0
- package/lib/v2/nextapple/realtime.js +1 -1
- package/lib/v2/nintendo/direct.js +31 -0
- package/lib/v2/nintendo/eshop_cn.js +44 -0
- package/lib/v2/nintendo/eshop_hk.js +79 -0
- package/lib/v2/nintendo/eshop_jp.js +34 -0
- package/lib/v2/nintendo/eshop_us.js +32 -0
- package/lib/v2/nintendo/maintainer.js +7 -0
- package/lib/v2/nintendo/news.js +23 -0
- package/lib/v2/nintendo/news_china.js +35 -0
- package/lib/v2/nintendo/radar.js +70 -0
- package/lib/v2/nintendo/router.js +10 -0
- package/lib/{routes → v2}/nintendo/system-update.js +2 -2
- package/lib/v2/nintendo/templates/direct.art +6 -0
- package/lib/v2/nintendo/templates/eshop_cn.art +21 -0
- package/lib/v2/nintendo/templates/eshop_hk.art +61 -0
- package/lib/v2/nintendo/templates/eshop_jp.art +3 -0
- package/lib/v2/nintendo/templates/eshop_us.art +24 -0
- package/lib/{routes → v2}/nintendo/utils.js +34 -50
- package/lib/v2/njxzc/home.js +13 -9
- package/lib/v2/nmtv/column.js +53 -0
- package/lib/v2/nmtv/maintainer.js +3 -0
- package/lib/v2/nmtv/radar.js +13 -0
- package/lib/v2/nmtv/router.js +3 -0
- package/lib/v2/nmtv/templates/description.art +9 -0
- package/lib/v2/nua/lib.js +39 -0
- package/lib/v2/nua/maintainer.js +1 -0
- package/lib/v2/nua/radar.js +8 -0
- package/lib/v2/nua/router.js +1 -0
- package/lib/v2/nua/utils.js +7 -12
- package/lib/v2/nuaa/utils/pypasswaf.js +3 -2
- package/lib/v2/nyaa/main.js +16 -23
- package/lib/v2/nyaa/maintainer.js +7 -4
- package/lib/v2/nyaa/radar.js +27 -29
- package/lib/v2/nyaa/router.js +4 -2
- package/lib/v2/odaily/post.js +15 -20
- package/lib/v2/odaily/utils.js +1 -1
- package/lib/v2/paradigm/maintainer.js +3 -0
- package/lib/v2/paradigm/radar.js +13 -0
- package/lib/v2/paradigm/router.js +3 -0
- package/lib/v2/paradigm/writing.js +44 -0
- package/lib/v2/picuki/maintainer.js +1 -1
- package/lib/v2/picuki/profile.js +10 -8
- package/lib/v2/picuki/utils.js +21 -0
- package/lib/v2/pixiv/api/getRanking.js +1 -1
- package/lib/v2/pixiv/ranking.js +3 -0
- package/lib/v2/producthunt/templates/descImg.art +2 -2
- package/lib/v2/qlu/maintainer.js +3 -0
- package/lib/v2/qlu/notice.js +54 -0
- package/lib/v2/qlu/radar.js +13 -0
- package/lib/v2/qlu/router.js +3 -0
- package/lib/v2/reactnewsletter/maintainer.js +4 -0
- package/lib/v2/reactnewsletter/radar.js +13 -0
- package/lib/v2/reactnewsletter/reactnewsletter.js +25 -0
- package/lib/v2/reactnewsletter/router.js +3 -0
- package/lib/v2/researchgate/maintainer.js +3 -0
- package/lib/v2/researchgate/publications.js +70 -0
- package/lib/v2/researchgate/radar.js +13 -0
- package/lib/v2/researchgate/router.js +3 -0
- package/lib/v2/saraba1st/digest.js +79 -0
- package/lib/v2/saraba1st/maintainer.js +1 -0
- package/lib/v2/saraba1st/radar.js +12 -3
- package/lib/v2/saraba1st/router.js +1 -0
- package/lib/v2/saraba1st/templates/digest.art +5 -0
- package/lib/v2/sctv/maintainer.js +1 -1
- package/lib/v2/sctv/programme.js +39 -17
- package/lib/v2/sctv/router.js +1 -1
- package/lib/v2/shmtu/jwc.js +57 -0
- package/lib/v2/shmtu/maintainer.js +5 -0
- package/lib/v2/shmtu/portal.js +81 -0
- package/lib/v2/shmtu/radar.js +29 -0
- package/lib/v2/shmtu/router.js +5 -0
- package/lib/v2/shmtu/templates/portal.art +30 -0
- package/lib/v2/shmtu/www.js +58 -0
- package/lib/v2/sigsac/ccs.js +57 -0
- package/lib/v2/sigsac/maintainer.js +3 -0
- package/lib/v2/sigsac/radar.js +13 -0
- package/lib/v2/sigsac/router.js +3 -0
- package/lib/v2/simpleinfo/index.js +50 -0
- package/lib/v2/simpleinfo/maintainer.js +3 -0
- package/lib/v2/simpleinfo/radar.js +19 -0
- package/lib/v2/simpleinfo/router.js +3 -0
- package/lib/v2/simpleinfo/templates/description.art +6 -0
- package/lib/v2/sse/maintainer.js +1 -1
- package/lib/v2/telegram/channel.js +54 -38
- package/lib/v2/tencent/maintainer.js +2 -0
- package/lib/v2/tencent/news/coronavirus/data.js +71 -0
- package/lib/v2/tencent/news/coronavirus/total.js +34 -0
- package/lib/v2/tencent/news/coronavirus/utils.js +17 -0
- package/lib/v2/tencent/radar.js +8 -0
- package/lib/v2/tencent/router.js +2 -0
- package/lib/v2/tencent/templates/coronavirus/chinaTotal.art +6 -0
- package/lib/v2/tencent/templates/coronavirus/data.art +4 -0
- package/lib/v2/test/index.js +8 -0
- package/lib/v2/theverge/index.js +9 -1
- package/lib/v2/theverge/maintainer.js +1 -1
- package/lib/v2/theverge/radar.js +2 -2
- package/lib/v2/theverge/router.js +1 -1
- package/lib/v2/tingshuitz/changsha.js +43 -0
- package/lib/v2/tingshuitz/maintainer.js +1 -0
- package/lib/v2/tingshuitz/radar.js +10 -0
- package/lib/v2/tingshuitz/router.js +1 -0
- package/lib/v2/twitter/web-api/twitter-api.js +19 -15
- package/lib/v2/twreporter/category.js +17 -8
- package/lib/v2/uber/blog.js +59 -0
- package/lib/v2/uber/maintainer.js +3 -0
- package/lib/v2/uber/radar.js +13 -0
- package/lib/v2/uber/router.js +3 -0
- package/lib/v2/usenix/maintainer.js +3 -0
- package/lib/v2/usenix/radar.js +13 -0
- package/lib/v2/usenix/router.js +3 -0
- package/lib/v2/usenix/usenix.js +63 -0
- package/lib/v2/usepanda/index.js +26 -0
- package/lib/v2/usepanda/maintainer.js +3 -0
- package/lib/v2/usepanda/radar.js +11 -0
- package/lib/v2/usepanda/router.js +3 -0
- package/lib/v2/uw/gix/news.js +67 -0
- package/lib/v2/uw/maintainer.js +3 -0
- package/lib/v2/uw/radar.js +13 -0
- package/lib/v2/uw/router.js +3 -0
- package/lib/v2/verse/articles.js +42 -0
- package/lib/v2/verse/maintainer.js +3 -0
- package/lib/v2/verse/radar.js +13 -0
- package/lib/v2/verse/router.js +3 -0
- package/lib/{routes → v2}/weibo/keyword.js +2 -2
- package/lib/v2/weibo/maintainer.js +8 -0
- package/lib/v2/weibo/oasis/user.js +20 -0
- package/lib/v2/weibo/radar.js +48 -0
- package/lib/v2/weibo/router.js +8 -0
- package/lib/{routes → v2}/weibo/search/hot.js +2 -0
- package/lib/{routes → v2}/weibo/super_index.js +2 -2
- package/lib/{routes → v2}/weibo/timeline.js +2 -2
- package/lib/{routes → v2}/weibo/user.js +2 -2
- package/lib/{routes → v2}/weibo/utils.js +49 -14
- package/lib/v2/ymgal/article.js +61 -0
- package/lib/v2/ymgal/game.js +41 -0
- package/lib/v2/ymgal/maintainer.js +4 -0
- package/lib/v2/ymgal/radar.js +31 -0
- package/lib/v2/ymgal/router.js +4 -0
- package/lib/v2/ymgal/templates/description.art +7 -0
- package/lib/v2/zhihu/pin/utils.js +49 -41
- package/package.json +26 -27
- package/lib/routes/blogs/foreverblog.js +0 -33
- package/lib/routes/gov/zhengce/govall.js +0 -59
- package/lib/routes/gov/zhengce/wenjian.js +0 -53
- package/lib/routes/gov/zhengce/zuixin.js +0 -42
- package/lib/routes/langlive/room.js +0 -33
- package/lib/routes/nautilus/topics.js +0 -45
- package/lib/routes/nintendo/direct.js +0 -34
- package/lib/routes/nintendo/eshop_cn.js +0 -51
- package/lib/routes/nintendo/eshop_hk.js +0 -26
- package/lib/routes/nintendo/eshop_jp.js +0 -20
- package/lib/routes/nintendo/eshop_us.js +0 -36
- package/lib/routes/nintendo/news.js +0 -25
- package/lib/routes/nintendo/news_china.js +0 -41
- package/lib/routes/researchgate/publications.js +0 -60
- package/lib/routes/universities/ecnuyjs/ecnuyjs.js +0 -23
- package/lib/routes/universities/shmtu/jwc.js +0 -75
- package/lib/routes/universities/shmtu/www.js +0 -61
- package/lib/routes/weibo/oasis/user.js +0 -17
- package/lib/v2/acm-ecnu/maintainer.js +0 -3
- package/lib/v2/acm-ecnu/radar.js +0 -19
- package/lib/v2/acm-ecnu/router.js +0 -3
- package/lib/v2/cnbeta/index.js +0 -16
- package/lib/v2/heu/job/bigemploy.js +0 -42
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const url = 'https://www.ieee-security.org/';
|
|
5
|
+
// https://www.ieee-security.org/TC/SP2023/program-papers.html
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const last = new Date().getFullYear() + 1;
|
|
9
|
+
const urlList = Array.from({ length: last - 2020 }, (_, v) => `${url}TC/SP${v + 2020}/program-papers.html`);
|
|
10
|
+
const responses = await got.all(urlList.map((url) => got(url)));
|
|
11
|
+
|
|
12
|
+
const items = responses.map((response) => {
|
|
13
|
+
const $ = cheerio.load(response.data);
|
|
14
|
+
return $('div.panel-body > div.list-group-item')
|
|
15
|
+
.toArray()
|
|
16
|
+
.map((item) => {
|
|
17
|
+
item = $(item);
|
|
18
|
+
const title = item.find('b').text().trim();
|
|
19
|
+
const link = response.url;
|
|
20
|
+
return {
|
|
21
|
+
title,
|
|
22
|
+
author: item.html().trim().split('<br>')[1].trim(),
|
|
23
|
+
link: `${link}#${title}`,
|
|
24
|
+
pubDate: parseDate(link.match(/SP(\d{4})/)[1], 'YYYY'),
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
ctx.state.data = {
|
|
30
|
+
title: 'S&P',
|
|
31
|
+
link: `${url}TC/SP-Index.html`,
|
|
32
|
+
description: 'IEEE Symposium on Security and Privacy Accepted Papers',
|
|
33
|
+
allowEmpty: true,
|
|
34
|
+
item: items.flat(),
|
|
35
|
+
};
|
|
36
|
+
};
|
package/lib/v2/javbus/index.js
CHANGED
|
@@ -4,6 +4,11 @@ const { parseDate } = require('@/utils/parse-date');
|
|
|
4
4
|
const { art } = require('@/utils/render');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
|
|
7
|
+
const toSize = (raw) => {
|
|
8
|
+
const matches = raw.match(/(\d+(\.\d+)?)(\w+)/);
|
|
9
|
+
return matches[3] === 'GB' ? matches[1] * 1024 : matches[1];
|
|
10
|
+
};
|
|
11
|
+
|
|
7
12
|
module.exports = async (ctx) => {
|
|
8
13
|
const isWestern = /^\/western/.test(ctx.path);
|
|
9
14
|
|
|
@@ -19,7 +24,7 @@ module.exports = async (ctx) => {
|
|
|
19
24
|
const $ = cheerio.load(response.data);
|
|
20
25
|
|
|
21
26
|
let items = $('.movie-box')
|
|
22
|
-
.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) :
|
|
27
|
+
.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 50)
|
|
23
28
|
.toArray()
|
|
24
29
|
.map((item) => {
|
|
25
30
|
item = $(item);
|
|
@@ -98,11 +103,12 @@ module.exports = async (ctx) => {
|
|
|
98
103
|
link: td.first().attr('href'),
|
|
99
104
|
size: td.eq(1).text().trim(),
|
|
100
105
|
date: td.last().text().trim(),
|
|
106
|
+
score: content(tr).find('a').length ** 8 * toSize(td.eq(1).text().trim()),
|
|
101
107
|
};
|
|
102
108
|
});
|
|
103
109
|
|
|
104
110
|
if (magnets) {
|
|
105
|
-
item.enclosure_url = magnets[0].link;
|
|
111
|
+
item.enclosure_url = magnets.sort((a, b) => b.score - a.score)[0].link;
|
|
106
112
|
item.enclosure_type = 'application/x-bittorrent';
|
|
107
113
|
}
|
|
108
114
|
} catch (e) {
|
|
@@ -9,9 +9,20 @@
|
|
|
9
9
|
{{/if}}
|
|
10
10
|
<br>
|
|
11
11
|
<h4>磁力連結投稿</h4>
|
|
12
|
+
<table>
|
|
13
|
+
<tr>
|
|
14
|
+
<th>磁力名稱</th>
|
|
15
|
+
<th>檔案大小</th>
|
|
16
|
+
<th>分享日期</th>
|
|
17
|
+
</tr>
|
|
12
18
|
{{each magnets magnet}}
|
|
13
|
-
<
|
|
19
|
+
<tr>
|
|
20
|
+
<td><a href="{{ magnet.link }}">{{ magnet.title }}</a></td>
|
|
21
|
+
<td>{{ magnet.size }}</td>
|
|
22
|
+
<td>{{ magnet.date }}</td>
|
|
23
|
+
</tr>
|
|
14
24
|
{{/each}}
|
|
25
|
+
</table>
|
|
15
26
|
<h4>樣品圖像</h4>
|
|
16
27
|
{{each thumbs}}
|
|
17
28
|
<img src="{{ $value }}">
|
package/lib/v2/jike/user.js
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { art } = require('@/utils/render');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const id = ctx.params.id;
|
|
7
|
+
const url = `https://www.lang.live/room/${id}`;
|
|
8
|
+
|
|
9
|
+
const api = 'https://api.lang.live/langweb/v1/room/liveinfo';
|
|
10
|
+
const {
|
|
11
|
+
data: { data },
|
|
12
|
+
} = await got(api, {
|
|
13
|
+
searchParams: {
|
|
14
|
+
room_id: id,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
let item = [];
|
|
19
|
+
const name = data.live_info.nickname;
|
|
20
|
+
if (data.live_info.live_status === 1) {
|
|
21
|
+
item = [
|
|
22
|
+
{
|
|
23
|
+
title: `${name} 开播了`,
|
|
24
|
+
link: url,
|
|
25
|
+
guid: `lang:live:room:${id}:${data.live_info.live_id}`,
|
|
26
|
+
description: art(path.join(__dirname, 'templates/room.art'), {
|
|
27
|
+
live_info: data.live_info,
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
ctx.state.data = {
|
|
34
|
+
title: `${name} 的浪 Play 直播`,
|
|
35
|
+
description: data.live_info.sign,
|
|
36
|
+
link: url,
|
|
37
|
+
item,
|
|
38
|
+
allowEmpty: true,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<img src="{{ live_info.headimg }}">
|
|
@@ -4,12 +4,12 @@ const { parseDate } = require('@/utils/parse-date');
|
|
|
4
4
|
|
|
5
5
|
const processList = (res) => {
|
|
6
6
|
const $ = cheerio.load(res.data);
|
|
7
|
-
const list = $('div.posts-wrapper > div
|
|
7
|
+
const list = $('div.archive.container > div.row > div > div > div.row.posts-wrapper.scroll > div')
|
|
8
8
|
.map((_, item) => ({
|
|
9
9
|
title: $(item).find('h2.entry-title').text(),
|
|
10
10
|
link: $(item).find('h2.entry-title > a').attr('href'),
|
|
11
11
|
pubDate: parseDate($(item).find('time').attr('datetime')),
|
|
12
|
-
author:
|
|
12
|
+
author: '60秒读懂世界',
|
|
13
13
|
}))
|
|
14
14
|
.get();
|
|
15
15
|
|
|
@@ -22,8 +22,11 @@ const processItems = async (list, ctx) => {
|
|
|
22
22
|
ctx.cache.tryGet(item.link, async () => {
|
|
23
23
|
const detailResponse = await got(item.link);
|
|
24
24
|
const $ = cheerio.load(detailResponse.data);
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const fullContent = $('div > div.entry-wrapper > div.entry-content');
|
|
26
|
+
fullContent.find('img').remove();
|
|
27
|
+
fullContent.find('div.pt-0').remove();
|
|
28
|
+
fullContent.find('div.post-note').remove();
|
|
29
|
+
item.description = fullContent.html();
|
|
27
30
|
|
|
28
31
|
return item;
|
|
29
32
|
})
|
package/lib/v2/luogu/daily.js
CHANGED
|
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
|
|
|
21
21
|
link,
|
|
22
22
|
author: firstPost.find('p').eq(1).text(),
|
|
23
23
|
guid: `${link}#${issueHeading}`,
|
|
24
|
-
pubDate: parseDate(issueHeading.match(/(\d{4} 年 \d{2} 月 \d{2} 日)/)[1], 'YYYY 年
|
|
24
|
+
pubDate: parseDate(issueHeading.match(/(\d{4} 年 \d{1,2} 月 \d{1,2} 日)/)[1], 'YYYY 年 M 月 D 日'),
|
|
25
25
|
},
|
|
26
26
|
];
|
|
27
27
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { RequestInProgressError } = require('@/errors');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const { id, lang } = ctx.params;
|
|
7
|
+
let data = (await got.get(`https://api.mangadex.org/manga/${id}`)).data;
|
|
8
|
+
if (data.result === 'error') {
|
|
9
|
+
throw new RequestInProgressError(data.errors[0].detail);
|
|
10
|
+
}
|
|
11
|
+
data = data.data;
|
|
12
|
+
let title;
|
|
13
|
+
if (lang) {
|
|
14
|
+
title = data.attributes.title[lang];
|
|
15
|
+
if (!title) {
|
|
16
|
+
title = data.attributes.altTitles.find((altTitle) => altTitle[lang])?.[lang];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (!title) {
|
|
20
|
+
title = data.attributes.title[data.attributes.originalLanguage];
|
|
21
|
+
if (!title) {
|
|
22
|
+
title = data.attributes.altTitles.find((altTitle) => altTitle[data.attributes.originalLanguage])?.[data.attributes.originalLanguage];
|
|
23
|
+
if (!title) {
|
|
24
|
+
title = Object.values(data.attributes.title)[0];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
let description;
|
|
29
|
+
if (lang) {
|
|
30
|
+
description = data.attributes.description[lang];
|
|
31
|
+
}
|
|
32
|
+
if (!description) {
|
|
33
|
+
description = data.attributes.description[data.attributes.originalLanguage];
|
|
34
|
+
if (!description) {
|
|
35
|
+
description = Object.values(data.attributes.description)[0];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let url = `https://api.mangadex.org/manga/${id}/feed?order[publishAt]=desc`;
|
|
40
|
+
if (lang) {
|
|
41
|
+
url += `&translatedLanguage[]=${lang}`;
|
|
42
|
+
}
|
|
43
|
+
data = (await got.get(url)).data;
|
|
44
|
+
if (data.result === 'error') {
|
|
45
|
+
throw new RequestInProgressError(data.errors[0].detail);
|
|
46
|
+
}
|
|
47
|
+
ctx.state.data = {
|
|
48
|
+
title: `${title} - MangaDex`,
|
|
49
|
+
link: `https://mangadex.org/title/${id}`,
|
|
50
|
+
description,
|
|
51
|
+
allowEmpty: true,
|
|
52
|
+
item: data.data.map((chapter) => {
|
|
53
|
+
const title = [];
|
|
54
|
+
if (chapter.attributes.volume) {
|
|
55
|
+
title.push(`Vol. ${chapter.attributes.volume}`);
|
|
56
|
+
}
|
|
57
|
+
if (chapter.attributes.chapter) {
|
|
58
|
+
title.push(`Ch. ${chapter.attributes.chapter}`);
|
|
59
|
+
}
|
|
60
|
+
if (chapter.attributes.title) {
|
|
61
|
+
title.push(chapter.attributes.title);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
title: title.join(' '),
|
|
65
|
+
link: `https://mangadex.org/chapter/${chapter.id}`,
|
|
66
|
+
pubDate: parseDate(chapter.attributes.publishAt),
|
|
67
|
+
};
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
if (lang) {
|
|
71
|
+
ctx.state.data.language = lang;
|
|
72
|
+
}
|
|
73
|
+
};
|
package/lib/v2/mihoyo/ys/news.js
CHANGED
|
@@ -43,12 +43,13 @@ const titles = {
|
|
|
43
43
|
module.exports = async (ctx) => {
|
|
44
44
|
const location = ctx.params.location ?? 'main';
|
|
45
45
|
const category = ctx.params.category ?? 'latest';
|
|
46
|
+
const limit = ctx.query.limit ? Number(ctx.query.limit) : 30;
|
|
46
47
|
|
|
47
48
|
const is_zh_CN = location === 'main';
|
|
48
49
|
|
|
49
50
|
const rootUrl = is_zh_CN
|
|
50
|
-
? `https://ys.mihoyo.com/content/ysCn/getContentList?pageSize
|
|
51
|
-
: `https://genshin.mihoyo.com/content/yuanshen/getContentList?pageSize
|
|
51
|
+
? `https://ys.mihoyo.com/content/ysCn/getContentList?pageSize=${limit}&pageNum=1&channelId=${config[category][location]}`
|
|
52
|
+
: `https://genshin.mihoyo.com/content/yuanshen/getContentList?pageSize=${limit}&pageNum=1&channelId=${config[category][location]}`;
|
|
52
53
|
|
|
53
54
|
const response = await got(rootUrl);
|
|
54
55
|
|
package/lib/v2/mirror/index.js
CHANGED
|
@@ -15,16 +15,23 @@ module.exports = async (ctx) => {
|
|
|
15
15
|
|
|
16
16
|
const data = JSON.parse(response.data.match(/"__NEXT_DATA__" type="application\/json">({"props":.*})<\/script>/)[1]);
|
|
17
17
|
|
|
18
|
-
const items = data.props.pageProps.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const items = Object.keys(data.props.pageProps.__APOLLO_STATE__)
|
|
19
|
+
.filter((key) => key.startsWith('entry:'))
|
|
20
|
+
.map((key) => {
|
|
21
|
+
const item = data.props.pageProps.__APOLLO_STATE__[key];
|
|
22
|
+
return {
|
|
23
|
+
title: item.title,
|
|
24
|
+
description: md.render(item.body),
|
|
25
|
+
link: `${currentUrl}/${item._id}`,
|
|
26
|
+
pubDate: parseDate(item.publishedAtTimestamp, 'X'),
|
|
27
|
+
author: data.props.pageProps.publicationLayoutProject.displayName,
|
|
28
|
+
};
|
|
29
|
+
});
|
|
25
30
|
|
|
26
31
|
ctx.state.data = {
|
|
27
|
-
title: `${data.props.pageProps.
|
|
32
|
+
title: `${data.props.pageProps.publicationLayoutProject.displayName} - Mirror`,
|
|
33
|
+
description: data.props.pageProps.publicationLayoutProject.description,
|
|
34
|
+
image: data.props.pageProps.publicationLayoutProject.avatarURL,
|
|
28
35
|
link: currentUrl,
|
|
29
36
|
item: items,
|
|
30
37
|
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const cheerio = require('cheerio');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { getElementChildrenInnerText } = require('./utils');
|
|
4
|
+
const dayjs = require('dayjs');
|
|
5
|
+
const utc = require('dayjs/plugin/utc');
|
|
6
|
+
dayjs.extend(utc);
|
|
7
|
+
|
|
8
|
+
const got = require('@/utils/got');
|
|
9
|
+
|
|
10
|
+
module.exports = async (ctx) => {
|
|
11
|
+
const dateFormatted = dayjs().utcOffset(8).format('YYYYMMDD');
|
|
12
|
+
|
|
13
|
+
const baseUrl = `http://mrdx.cn/content/${dateFormatted}`;
|
|
14
|
+
const link = `${baseUrl}/Page01DK.htm`;
|
|
15
|
+
|
|
16
|
+
const indexPageResponse = await got({
|
|
17
|
+
url: link,
|
|
18
|
+
method: 'get',
|
|
19
|
+
});
|
|
20
|
+
const $ = cheerio.load(indexPageResponse.data);
|
|
21
|
+
|
|
22
|
+
// 当日所有文章Url在<a>的`daoxiang` attribute中
|
|
23
|
+
// 其站点使用**非标准**的HTML语法
|
|
24
|
+
// eg: `<a class="foo" daoxiang="foo-bar.htm">Lorem ipsum</a>`
|
|
25
|
+
const passagesList = $('.listdaohang > ul > li a')
|
|
26
|
+
.toArray()
|
|
27
|
+
.map((item) => ({
|
|
28
|
+
link: new URL(`${baseUrl}/${item.attribs.daoxiang}`).href,
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
const passages = await Promise.all(
|
|
32
|
+
passagesList.map((passage) =>
|
|
33
|
+
ctx.cache.tryGet(passage.link, async () => {
|
|
34
|
+
const response = await got({
|
|
35
|
+
url: passage.link,
|
|
36
|
+
method: 'get',
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const $ = cheerio.load(response.data);
|
|
40
|
+
|
|
41
|
+
// 标题在`h2`,`h3`,`h4`,`h5`中,有多余空格和换行符
|
|
42
|
+
// 但是Middleware会处理
|
|
43
|
+
const title =
|
|
44
|
+
getElementChildrenInnerText($('.bggray > .margin15 > h2')[0]) +
|
|
45
|
+
getElementChildrenInnerText($('.bggray > .margin15 > h3')[0]) +
|
|
46
|
+
getElementChildrenInnerText($('.bggray > .margin15 > h4')[0]) +
|
|
47
|
+
getElementChildrenInnerText($('.bggray > .margin15 > h5')[0]);
|
|
48
|
+
|
|
49
|
+
// 作者和发布时间
|
|
50
|
+
// 中间用超多空格分隔
|
|
51
|
+
// 头尾均有多余空格
|
|
52
|
+
// eg: 新华每日电讯 2022年12月21日
|
|
53
|
+
const [author, pubDate] = getElementChildrenInnerText($('.shijian')[0])
|
|
54
|
+
.split(' ')
|
|
55
|
+
.filter((item) => item !== '')
|
|
56
|
+
.map((item) => item.trim());
|
|
57
|
+
|
|
58
|
+
const content = $('.contenttext').html();
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
title,
|
|
62
|
+
author,
|
|
63
|
+
pubDate: parseDate(pubDate, 'YYYY年MM月DD日'),
|
|
64
|
+
guid: passage.link,
|
|
65
|
+
link: passage.link,
|
|
66
|
+
description: content,
|
|
67
|
+
};
|
|
68
|
+
})
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
ctx.state.data = {
|
|
73
|
+
title: '新华每日电讯',
|
|
74
|
+
link,
|
|
75
|
+
item: passages,
|
|
76
|
+
description:
|
|
77
|
+
'中国报纸发行前三强。位列《人民日报》,《参考消息》之后。《新华每日电讯》是新华社出版的一份新闻电讯报,1993年创办,具有很高的权威性和准确性,有“一报在手,便知天下”之美誉。《新华每日电讯》为对开八版日报,集中刊登[新华社]每天向国内播发的电讯稿及图片稿。打开《新华每日电讯》,中国和全世界每天发生的重大事件便将一目了然。在人类生活节奏日益加快的当今世界,《新华每日电讯》以最便捷、最醒目的方式为公众提供最重要的新闻报道,受到公众的喜爱和拥护。',
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function getElementChildrenInnerText(element) {
|
|
2
|
+
let text = '';
|
|
3
|
+
for (const child of element.children) {
|
|
4
|
+
if (child.type === 'text') {
|
|
5
|
+
text += child.data.trim();
|
|
6
|
+
}
|
|
7
|
+
if (child.children !== undefined) {
|
|
8
|
+
text += getElementChildrenInnerText(child);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return text;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
getElementChildrenInnerText,
|
|
17
|
+
};
|
package/lib/v2/mtime/news.js
CHANGED
|
@@ -5,7 +5,7 @@ const { parseDate } = require('@/utils/parse-date');
|
|
|
5
5
|
const asyncPool = require('tiny-async-pool');
|
|
6
6
|
|
|
7
7
|
module.exports = async (ctx) => {
|
|
8
|
-
const link = '
|
|
8
|
+
const link = 'http://news.mtime.com';
|
|
9
9
|
const response = await got(link, {
|
|
10
10
|
https: {
|
|
11
11
|
rejectUnauthorized: false,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const cheerio = require('cheerio');
|
|
2
|
+
const got = require('@/utils/got');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const baseUrl = 'https://nautil.us';
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const categoryIdMap = await ctx.cache.tryGet('nautil:categories', async () => {
|
|
10
|
+
const { data } = await got(`${baseUrl}/wp-json/wp/v2/categories`, {
|
|
11
|
+
searchParams: {
|
|
12
|
+
per_page: 100,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
return data.map((item) => ({
|
|
16
|
+
id: item.id,
|
|
17
|
+
name: item.name,
|
|
18
|
+
slug: item.slug,
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const { data: list } = await got(`${baseUrl}/wp-json/wp/v2/posts`, {
|
|
23
|
+
searchParams: {
|
|
24
|
+
categories: categoryIdMap.find((item) => item.slug === ctx.params.tid.toLowerCase()).id,
|
|
25
|
+
per_page: ctx.query.limit ? parseInt(ctx.query.limit) : 20,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const out = list.map((item) => {
|
|
30
|
+
const head = item.yoast_head_json;
|
|
31
|
+
const $ = cheerio.load(item.content.rendered, null, false);
|
|
32
|
+
// lazyload images
|
|
33
|
+
$('img').each((_, e) => {
|
|
34
|
+
e = $(e);
|
|
35
|
+
e.attr('src', e.attr('data-src') ?? e.attr('srcset'));
|
|
36
|
+
e.attr('src', e.attr('src').split('?')[0]);
|
|
37
|
+
e.removeAttr('data-src');
|
|
38
|
+
e.removeAttr('srcset');
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
title: item.title.rendered,
|
|
42
|
+
author: item.yoast_head_json.author,
|
|
43
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
44
|
+
head,
|
|
45
|
+
rendered: $.html(),
|
|
46
|
+
}),
|
|
47
|
+
link: item.link,
|
|
48
|
+
pubDate: parseDate(item.date_gmt),
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
ctx.state.data = {
|
|
53
|
+
title: 'Nautilus | ' + categoryIdMap.find((item) => item.slug === ctx.params.tid.toLowerCase()).name,
|
|
54
|
+
link: `${baseUrl}/topics/${ctx.params.tid}/`,
|
|
55
|
+
item: out,
|
|
56
|
+
};
|
|
57
|
+
};
|