rsshub 1.0.0-master.f099a33 → 1.0.0-master.f0a838e
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/config.js +1 -0
- package/lib/middleware/parameter.js +17 -2
- package/lib/radar-rules.js +49 -66
- package/lib/router.js +20 -20
- package/lib/routes/agefans/update.js +1 -1
- package/lib/routes/universities/uestc/sice.js +12 -33
- package/lib/utils/wechat-mp.js +9 -2
- package/lib/v2/36kr/maintainer.js +1 -1
- package/lib/v2/36kr/router.js +1 -1
- package/lib/v2/36kr/search/article.js +13 -56
- package/lib/v2/36kr/user.js +47 -22
- package/lib/v2/acfun/article.js +100 -0
- package/lib/{routes → v2}/acfun/bangumi.js +7 -7
- package/lib/v2/acfun/maintainer.js +5 -0
- package/lib/v2/acfun/radar.js +25 -0
- package/lib/v2/acfun/router.js +5 -0
- package/lib/v2/acfun/video.js +45 -0
- package/lib/v2/agora0/index.js +54 -0
- package/lib/v2/agora0/maintainer.js +3 -0
- package/lib/v2/agora0/radar.js +13 -0
- package/lib/v2/agora0/router.js +3 -0
- package/lib/v2/allrecode/index.js +65 -0
- package/lib/v2/allrecode/maintainer.js +5 -0
- package/lib/v2/allrecode/news.js +35 -0
- package/lib/v2/allrecode/radar.js +25 -0
- package/lib/v2/allrecode/router.js +4 -0
- package/lib/v2/appleinsider/index.js +59 -0
- package/lib/v2/appleinsider/maintainer.js +3 -0
- package/lib/v2/appleinsider/radar.js +13 -0
- package/lib/v2/appleinsider/router.js +3 -0
- package/lib/v2/biquge/index.js +78 -0
- package/lib/v2/biquge/maintainer.js +3 -0
- package/lib/v2/biquge/radar.js +29 -0
- package/lib/v2/biquge/router.js +3 -0
- package/lib/v2/cbnweek/index.js +46 -0
- package/lib/v2/cbnweek/maintainer.js +3 -0
- package/lib/v2/cbnweek/radar.js +13 -0
- package/lib/v2/cbnweek/router.js +3 -0
- package/lib/v2/ccac/news.js +12 -3
- package/lib/v2/cde/index.js +2 -2
- package/lib/v2/cde/maintainer.js +1 -0
- package/lib/v2/cde/radar.js +22 -4
- package/lib/v2/cde/router.js +1 -0
- package/lib/v2/cde/templates/xxgk/breakthroughCure.art +18 -0
- package/lib/v2/cde/templates/xxgk/cliniCal.art +16 -0
- package/lib/v2/cde/templates/xxgk/priorityApproval.art +18 -0
- package/lib/v2/cde/utils.js +2 -2
- package/lib/v2/cde/xxgk.js +73 -0
- package/lib/v2/chinadegrees/maintainer.js +3 -0
- package/lib/v2/chinadegrees/province.js +66 -0
- package/lib/v2/chinadegrees/radar.js +13 -0
- package/lib/v2/chinadegrees/router.js +3 -0
- package/lib/v2/chinadegrees/templates/description.art +4 -0
- package/lib/v2/cscse/maintainer.js +3 -0
- package/lib/v2/cscse/radar.js +13 -0
- package/lib/v2/cscse/router.js +3 -0
- package/lib/v2/cscse/tzgg.js +54 -0
- package/lib/{routes/universities/scvtc/xygg.js → v2/darwinawards/index.js} +25 -14
- package/lib/v2/darwinawards/maintainer.js +4 -0
- package/lib/v2/darwinawards/radar.js +13 -0
- package/lib/v2/darwinawards/router.js +4 -0
- package/lib/v2/dgjyw/index.js +67 -0
- package/lib/v2/dgjyw/maintainer.js +3 -0
- package/lib/v2/dgjyw/radar.js +13 -0
- package/lib/v2/dgjyw/router.js +3 -0
- package/lib/v2/douyin/hashtag.js +7 -43
- package/lib/v2/douyin/live.js +68 -0
- package/lib/v2/douyin/maintainer.js +2 -0
- package/lib/v2/douyin/radar.js +8 -0
- package/lib/v2/douyin/router.js +1 -0
- package/lib/v2/douyin/user.js +1 -43
- package/lib/v2/douyin/utils.js +50 -0
- package/lib/v2/economist/full.js +6 -4
- package/lib/v2/ezone/index.js +5 -3
- package/lib/v2/fda/cdrh.js +60 -0
- package/lib/v2/fda/maintainer.js +3 -0
- package/lib/v2/fda/radar.js +13 -0
- package/lib/v2/fda/router.js +3 -0
- package/lib/v2/gov/customs/list.js +21 -17
- package/lib/v2/gov/customs/utils.js +9 -5
- package/lib/v2/gov/maintainer.js +5 -0
- package/lib/v2/gov/nmpa/generic.js +83 -0
- package/lib/v2/gov/nsfc/index.js +83 -0
- package/lib/v2/gov/pbc/goutongjiaoliu.js +20 -15
- package/lib/v2/gov/pbc/tradeAnnouncement.js +18 -14
- package/lib/v2/gov/radar.js +72 -2
- package/lib/v2/gov/router.js +5 -0
- package/lib/v2/gov/shaanxi/kjt.js +55 -0
- package/lib/v2/gov/shanghai/yjj/index.js +54 -0
- package/lib/v2/gov/xuzhou/hrss.js +54 -0
- package/lib/v2/hdu/cs/{index.js → notice.js} +1 -4
- package/lib/v2/hdu/cs/pg.js +54 -0
- package/lib/v2/hdu/maintainer.js +1 -0
- package/lib/v2/hdu/radar.js +6 -0
- package/lib/v2/hdu/router.js +2 -1
- package/lib/v2/ielts/index.js +7 -2
- package/lib/v2/mdpi/journal.js +65 -0
- package/lib/v2/mdpi/maintainer.js +3 -0
- package/lib/v2/mdpi/radar.js +13 -0
- package/lib/v2/mdpi/router.js +3 -0
- package/lib/v2/mdpi/templates/description.art +12 -0
- package/lib/v2/mindmeister/example.js +44 -0
- package/lib/v2/mindmeister/maintainer.js +3 -0
- package/lib/v2/mindmeister/radar.js +13 -0
- package/lib/v2/mindmeister/router.js +3 -0
- package/lib/v2/mindmeister/templates/image.art +1 -0
- package/lib/v2/nbd/radar.js +2 -2
- package/lib/v2/ncwu/maintainer.js +3 -0
- package/lib/v2/ncwu/notice.js +27 -0
- package/lib/v2/ncwu/radar.js +13 -0
- package/lib/v2/ncwu/router.js +3 -0
- package/lib/v2/netease/exclusive.js +148 -0
- package/lib/v2/netease/maintainer.js +1 -0
- package/lib/v2/netease/radar.js +8 -0
- package/lib/v2/netease/router.js +1 -0
- package/lib/v2/netease/templates/exclusive.art +11 -0
- package/lib/v2/nju/rczp.js +34 -24
- package/lib/v2/nju/zcc.js +6 -8
- package/lib/v2/njust/utils.js +4 -0
- package/lib/v2/nuaa/utils/pypasswaf.js +4 -5
- package/lib/v2/nyaa/maintainer.js +4 -0
- package/lib/v2/nyaa/radar.js +32 -0
- package/lib/v2/nyaa/router.js +4 -0
- package/lib/{routes → v2}/nyaa/search.js +4 -2
- package/lib/v2/nytimes/daily_briefing_chinese.js +47 -41
- package/lib/v2/nytimes/index.js +3 -3
- package/lib/v2/nytimes/maintainer.js +1 -1
- package/lib/v2/nytimes/templates/image.art +3 -0
- package/lib/v2/nytimes/utils.js +7 -1
- package/lib/{routes/outagereport/service.js → v2/outagereport/index.js} +2 -2
- package/lib/v2/outagereport/maintainer.js +3 -0
- package/lib/v2/outagereport/radar.js +13 -0
- package/lib/v2/outagereport/router.js +3 -0
- package/lib/v2/pincong/utils.js +7 -1
- package/lib/v2/pku/maintainer.js +3 -0
- package/lib/v2/pku/radar.js +20 -0
- package/lib/v2/pku/router.js +3 -0
- package/lib/v2/pku/ss/admission.js +53 -0
- package/lib/v2/pku/ss/notice.js +53 -0
- package/lib/v2/pku/ss/pg_admin.js +53 -0
- package/lib/v2/prestige-av/maintainer.js +3 -0
- package/lib/v2/prestige-av/radar.js +18 -0
- package/lib/v2/prestige-av/router.js +3 -0
- package/lib/{routes → v2}/prestige-av/series.js +8 -5
- package/lib/v2/qq/kg/cache.js +28 -0
- package/lib/v2/qq/kg/reply.js +21 -0
- package/lib/v2/qq/kg/user.js +50 -0
- package/lib/v2/qq/maintainer.js +2 -0
- package/lib/v2/qq/radar.js +14 -0
- package/lib/v2/qq/router.js +2 -0
- package/lib/v2/sakurazaka46/blog.js +54 -0
- package/lib/v2/sakurazaka46/maintainer.js +4 -0
- package/lib/v2/sakurazaka46/news.js +51 -0
- package/lib/v2/sakurazaka46/radar.js +19 -0
- package/lib/v2/sakurazaka46/router.js +4 -0
- package/lib/v2/samsung/maintainer.js +3 -0
- package/lib/v2/samsung/radar.js +13 -0
- package/lib/v2/samsung/research/blog.js +49 -0
- package/lib/v2/samsung/router.js +3 -0
- package/lib/v2/scvtc/maintainer.js +3 -0
- package/lib/v2/scvtc/radar.js +13 -0
- package/lib/v2/scvtc/router.js +3 -0
- package/lib/v2/scvtc/xygg.js +40 -0
- package/lib/v2/shuiguopai/index.js +76 -0
- package/lib/v2/shuiguopai/maintainer.js +3 -0
- package/lib/v2/shuiguopai/radar.js +13 -0
- package/lib/v2/shuiguopai/router.js +3 -0
- package/lib/v2/shuiguopai/templates/description.art +6 -0
- package/lib/v2/slowmist/radar.js +13 -0
- package/lib/v2/slowmist/router.js +3 -0
- package/lib/v2/slowmist/slowmist.js +39 -0
- package/lib/v2/supchina/index.js +67 -0
- package/lib/v2/supchina/maintainer.js +4 -0
- package/lib/v2/supchina/podcasts.js +66 -0
- package/lib/v2/supchina/radar.js +19 -0
- package/lib/v2/supchina/router.js +4 -0
- package/lib/v2/tiktok/user.js +22 -55
- package/lib/v2/trending/allTrending.js +169 -0
- package/lib/v2/trending/maintainer.js +3 -0
- package/lib/v2/trending/radar.js +35 -0
- package/lib/v2/trending/router.js +3 -0
- package/lib/v2/trending/templates/content.art +24 -0
- package/lib/v2/u3c3/index.js +59 -0
- package/lib/v2/u3c3/maintainer.js +3 -0
- package/lib/v2/u3c3/radar.js +29 -0
- package/lib/v2/u3c3/router.js +3 -0
- package/lib/v2/uraaka-joshi/uraaka-joshi-user.js +7 -1
- package/lib/v2/uraaka-joshi/uraaka-joshi.js +8 -1
- package/lib/v2/vlive/index.js +71 -0
- package/lib/v2/vlive/maintainer.js +3 -0
- package/lib/v2/vlive/radar.js +13 -0
- package/lib/v2/vlive/router.js +3 -0
- package/lib/v2/vlive/templates/post.art +8 -0
- package/lib/v2/vlive/templates/video.art +3 -0
- package/lib/v2/xiaohongshu/util.js +6 -6
- package/lib/v2/xjtu/2yuan/news.js +61 -0
- package/lib/v2/xjtu/dean.js +83 -0
- package/lib/{routes/universities → v2}/xjtu/ee.js +5 -5
- package/lib/{routes/universities → v2}/xjtu/gs/tzgg.js +6 -6
- package/lib/v2/xjtu/international.js +51 -0
- package/lib/v2/xjtu/job.js +81 -0
- package/lib/v2/xjtu/maintainer.js +9 -0
- package/lib/v2/xjtu/radar.js +53 -0
- package/lib/v2/xjtu/router.js +9 -0
- package/lib/v2/xjtu/std.js +58 -0
- package/lib/v2/xjtu/templates/attachments.art +3 -0
- package/lib/v2/xjtu/templates/std.art +4 -0
- package/lib/v2/xueqiu/column.js +42 -0
- package/lib/v2/xueqiu/maintainer.js +1 -0
- package/lib/v2/xueqiu/radar.js +6 -0
- package/lib/v2/xueqiu/router.js +1 -0
- package/lib/v2/zhangyoubao/index.js +42 -0
- package/lib/v2/zhangyoubao/maintainer.js +3 -0
- package/lib/v2/zhangyoubao/radar.js +13 -0
- package/lib/v2/zhangyoubao/router.js +3 -0
- package/lib/v2/zhangyoubao/templates/article.art +1 -0
- package/lib/v2/zhihu/zhuanlan.js +2 -2
- package/package.json +20 -20
- package/lib/routes/acfun/video.js +0 -44
- package/lib/routes/darwinawards/articles.js +0 -42
- package/lib/routes/dgjyw/index.js +0 -66
- package/lib/routes/sakurazaka46/blog.js +0 -38
- package/lib/routes/universities/ncwu/notice.js +0 -42
- package/lib/routes/universities/xjtu/dean.js +0 -86
- package/lib/routes/universities/xjtu/international.js +0 -53
- package/lib/routes/universities/xjtu/job.js +0 -50
- package/lib/v2/nsfc/maintainer.js +0 -3
- package/lib/v2/nsfc/news.js +0 -92
- package/lib/v2/nsfc/radar.js +0 -31
- package/lib/v2/nsfc/router.js +0 -3
package/lib/config.js
CHANGED
|
@@ -93,6 +93,7 @@ const calculateValue = () => {
|
|
|
93
93
|
},
|
|
94
94
|
feature: {
|
|
95
95
|
allow_user_hotlink_template: envs.ALLOW_USER_HOTLINK_TEMPLATE === 'true',
|
|
96
|
+
filter_regex_engine: envs.FILTER_REGEX_ENGINE || 're2',
|
|
96
97
|
},
|
|
97
98
|
suffix: envs.SUFFIX,
|
|
98
99
|
titleLengthLimit: parseInt(envs.TITLE_LENGTH_LIMIT) || 150,
|
|
@@ -152,10 +152,25 @@ module.exports = async (ctx, next) => {
|
|
|
152
152
|
// filter
|
|
153
153
|
const makeRegex = (string) => {
|
|
154
154
|
// default: case_senstivie = true
|
|
155
|
+
const engine = config.feature.filter_regex_engine;
|
|
155
156
|
if (ctx.query.filter_case_sensitive === 'false') {
|
|
156
|
-
|
|
157
|
+
switch (engine) {
|
|
158
|
+
case 'regexp':
|
|
159
|
+
return new RegExp(string, 'i');
|
|
160
|
+
case 're2':
|
|
161
|
+
return new RE2(string, 'i');
|
|
162
|
+
default:
|
|
163
|
+
throw Error(`Invalid Engine Value: ${engine}, please check your config.`);
|
|
164
|
+
}
|
|
157
165
|
} else {
|
|
158
|
-
|
|
166
|
+
switch (engine) {
|
|
167
|
+
case 'regexp':
|
|
168
|
+
return new RegExp(string);
|
|
169
|
+
case 're2':
|
|
170
|
+
return new RE2(string);
|
|
171
|
+
default:
|
|
172
|
+
throw Error(`Invalid Engine Value: ${engine}, please check your config.`);
|
|
173
|
+
}
|
|
159
174
|
}
|
|
160
175
|
};
|
|
161
176
|
|
package/lib/radar-rules.js
CHANGED
|
@@ -1089,35 +1089,35 @@ module.exports = {
|
|
|
1089
1089
|
},
|
|
1090
1090
|
],
|
|
1091
1091
|
},
|
|
1092
|
-
'nsfc.gov.cn': {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
},
|
|
1092
|
+
// 'nsfc.gov.cn': {
|
|
1093
|
+
// _name: '国家自然科学基金委员会',
|
|
1094
|
+
// www: [
|
|
1095
|
+
// {
|
|
1096
|
+
// title: '基金要闻',
|
|
1097
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1098
|
+
// source: '/*',
|
|
1099
|
+
// target: '/nsfc/news/jjyw',
|
|
1100
|
+
// },
|
|
1101
|
+
// {
|
|
1102
|
+
// title: '通知公告',
|
|
1103
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1104
|
+
// source: '/*',
|
|
1105
|
+
// target: '/nsfc/news/tzgg',
|
|
1106
|
+
// },
|
|
1107
|
+
// {
|
|
1108
|
+
// title: '资助成果',
|
|
1109
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1110
|
+
// source: '/*',
|
|
1111
|
+
// target: '/nsfc/news/zzcg',
|
|
1112
|
+
// },
|
|
1113
|
+
// {
|
|
1114
|
+
// title: '科普快讯',
|
|
1115
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1116
|
+
// source: '/*',
|
|
1117
|
+
// target: '/nsfc/news/kpkx',
|
|
1118
|
+
// },
|
|
1119
|
+
// ],
|
|
1120
|
+
// },
|
|
1121
1121
|
'japanpost.jp': {
|
|
1122
1122
|
_name: '日本郵便',
|
|
1123
1123
|
'trackings.post': [
|
|
@@ -1164,26 +1164,26 @@ module.exports = {
|
|
|
1164
1164
|
},
|
|
1165
1165
|
],
|
|
1166
1166
|
},
|
|
1167
|
-
'biquge5200.com': {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
},
|
|
1177
|
-
'biquge.info': {
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
},
|
|
1167
|
+
// 'biquge5200.com': {
|
|
1168
|
+
// www: [
|
|
1169
|
+
// {
|
|
1170
|
+
// title: 'biquge5200.com',
|
|
1171
|
+
// docs: 'https://docs.rsshub.app/reading.html#bi-qu-ge-biquge5200-com',
|
|
1172
|
+
// source: '/:id',
|
|
1173
|
+
// target: '/novel/biquge/:id',
|
|
1174
|
+
// },
|
|
1175
|
+
// ],
|
|
1176
|
+
// },
|
|
1177
|
+
// 'biquge.info': {
|
|
1178
|
+
// www: [
|
|
1179
|
+
// {
|
|
1180
|
+
// title: 'biquge.info',
|
|
1181
|
+
// docs: 'https://docs.rsshub.app/reading.html#bi-qu-ge-biquge-info',
|
|
1182
|
+
// source: '/:id',
|
|
1183
|
+
// target: '/novel/biqugeinfo/:id',
|
|
1184
|
+
// },
|
|
1185
|
+
// ],
|
|
1186
|
+
// },
|
|
1187
1187
|
'matters.news': {
|
|
1188
1188
|
_name: 'Matters',
|
|
1189
1189
|
'.': [
|
|
@@ -1610,23 +1610,6 @@ module.exports = {
|
|
|
1610
1610
|
},
|
|
1611
1611
|
],
|
|
1612
1612
|
},
|
|
1613
|
-
'acfun.cn': {
|
|
1614
|
-
_name: 'AcFun',
|
|
1615
|
-
www: [
|
|
1616
|
-
{
|
|
1617
|
-
tilte: '番剧',
|
|
1618
|
-
docs: 'https://docs.rsshub.app/anime.html#acfun-fan-ju',
|
|
1619
|
-
source: '/bangumi/:id',
|
|
1620
|
-
target: (params) => `/acfun/bangumi/${params.id.replace('aa', '')}`,
|
|
1621
|
-
},
|
|
1622
|
-
{
|
|
1623
|
-
title: '用户投稿',
|
|
1624
|
-
docs: 'https://docs.rsshub.app/anime.html#acfun-yong-hu-tou-gao',
|
|
1625
|
-
source: '/u/:id',
|
|
1626
|
-
target: '/acfun/user/video/:id',
|
|
1627
|
-
},
|
|
1628
|
-
],
|
|
1629
|
-
},
|
|
1630
1613
|
'jjmhw.cc': {
|
|
1631
1614
|
_name: '漫小肆',
|
|
1632
1615
|
www: [
|
package/lib/router.js
CHANGED
|
@@ -228,8 +228,8 @@ router.get('/pornhub/:language?/users/:username', lazyloadRouteHandler('./routes
|
|
|
228
228
|
router.get('/pornhub/:language?/model/:username/:sort?', lazyloadRouteHandler('./routes/pornhub/model'));
|
|
229
229
|
router.get('/pornhub/:language?/pornstar/:username/:sort?', lazyloadRouteHandler('./routes/pornhub/pornstar'));
|
|
230
230
|
|
|
231
|
-
// Prestige
|
|
232
|
-
router.get('/prestige-av/series/:mid/:sort?', lazyloadRouteHandler('./routes/prestige-av/series'));
|
|
231
|
+
// Prestige migrated to v2
|
|
232
|
+
// router.get('/prestige-av/series/:mid/:sort?', lazyloadRouteHandler('./routes/prestige-av/series'));
|
|
233
233
|
|
|
234
234
|
// yande.re
|
|
235
235
|
router.get('/yande.re/post/popular_recent', lazyloadRouteHandler('./routes/yande.re/post_popular_recent'));
|
|
@@ -460,8 +460,8 @@ router.get('/mafengwo/ziyouxing/:code', lazyloadRouteHandler('./routes/mafengwo/
|
|
|
460
460
|
// router.get('/earthquake/ceic/:type', lazyloadRouteHandler('./routes/earthquake/ceic'));
|
|
461
461
|
|
|
462
462
|
// 小说
|
|
463
|
-
router.get('/novel/biquge/:id', lazyloadRouteHandler('./routes/novel/biquge'));
|
|
464
|
-
router.get('/novel/biqugeinfo/:id/:limit?', lazyloadRouteHandler('./routes/novel/biqugeinfo'));
|
|
463
|
+
// router.get('/novel/biquge/:id', lazyloadRouteHandler('./routes/novel/biquge'));
|
|
464
|
+
// router.get('/novel/biqugeinfo/:id/:limit?', lazyloadRouteHandler('./routes/novel/biqugeinfo'));
|
|
465
465
|
router.get('/novel/uukanshu/:uid', lazyloadRouteHandler('./routes/novel/uukanshu'));
|
|
466
466
|
router.get('/novel/wenxuemi/:id1/:id2', lazyloadRouteHandler('./routes/novel/wenxuemi'));
|
|
467
467
|
router.get('/novel/booksky/:id', lazyloadRouteHandler('./routes/novel/booksky'));
|
|
@@ -759,7 +759,7 @@ router.get('/upc/main/:type?', lazyloadRouteHandler('./routes/universities/upc/m
|
|
|
759
759
|
router.get('/upc/jsj/:type?', lazyloadRouteHandler('./routes/universities/upc/jsj'));
|
|
760
760
|
|
|
761
761
|
// 华北水利水电大学
|
|
762
|
-
router.get('/ncwu/notice', lazyloadRouteHandler('./routes/universities/ncwu/notice'));
|
|
762
|
+
// router.get('/ncwu/notice', lazyloadRouteHandler('./routes/universities/ncwu/notice'));
|
|
763
763
|
|
|
764
764
|
// 太原师范学院
|
|
765
765
|
router.get('/tynu', lazyloadRouteHandler('./routes/universities/tynu/tynu'));
|
|
@@ -939,9 +939,9 @@ router.get('/nhentai/:key/:keyword/:mode?', lazyloadRouteHandler('./routes/nhent
|
|
|
939
939
|
// 龙腾网
|
|
940
940
|
router.get('/ltaaa/:category?', lazyloadRouteHandler('./routes/ltaaa/index'));
|
|
941
941
|
|
|
942
|
-
// AcFun
|
|
943
|
-
router.get('/acfun/bangumi/:id', lazyloadRouteHandler('./routes/acfun/bangumi'));
|
|
944
|
-
router.get('/acfun/user/video/:uid', lazyloadRouteHandler('./routes/acfun/video'));
|
|
942
|
+
// AcFun migrated to v2
|
|
943
|
+
// router.get('/acfun/bangumi/:id', lazyloadRouteHandler('./routes/acfun/bangumi'));
|
|
944
|
+
// router.get('/acfun/user/video/:uid', lazyloadRouteHandler('./routes/acfun/video'));
|
|
945
945
|
|
|
946
946
|
// Auto Trader
|
|
947
947
|
router.get('/autotrader/:query', lazyloadRouteHandler('./routes/autotrader'));
|
|
@@ -1726,7 +1726,7 @@ router.get('/metacritic/release/:platform/:type/:sort?', lazyloadRouteHandler('.
|
|
|
1726
1726
|
router.get('/kkj/news', lazyloadRouteHandler('./routes/kkj/news'));
|
|
1727
1727
|
|
|
1728
1728
|
// Outage.Report
|
|
1729
|
-
router.get('/outagereport/:name/:count?', lazyloadRouteHandler('./routes/outagereport/service'));
|
|
1729
|
+
// router.get('/outagereport/:name/:count?', lazyloadRouteHandler('./routes/outagereport/service'));
|
|
1730
1730
|
|
|
1731
1731
|
// sixthtone
|
|
1732
1732
|
router.get('/sixthtone/news', lazyloadRouteHandler('./routes/sixthtone/news'));
|
|
@@ -1894,7 +1894,7 @@ router.get('/keyakizaka46/news', lazyloadRouteHandler('./routes/keyakizaka46/new
|
|
|
1894
1894
|
router.get('/hinatazaka46/news', lazyloadRouteHandler('./routes/hinatazaka46/news'));
|
|
1895
1895
|
router.get('/keyakizaka46/blog', lazyloadRouteHandler('./routes/keyakizaka46/blog'));
|
|
1896
1896
|
router.get('/hinatazaka46/blog', lazyloadRouteHandler('./routes/hinatazaka46/blog'));
|
|
1897
|
-
router.get('/sakurazaka46/blog', lazyloadRouteHandler('./routes/sakurazaka46/blog'));
|
|
1897
|
+
// router.get('/sakurazaka46/blog', lazyloadRouteHandler('./routes/sakurazaka46/blog'));
|
|
1898
1898
|
|
|
1899
1899
|
// 酷安
|
|
1900
1900
|
router.get('/coolapk/tuwen/:type?', lazyloadRouteHandler('./routes/coolapk/tuwen'));
|
|
@@ -2265,8 +2265,8 @@ router.get('/transferwise/pair/:source/:target', lazyloadRouteHandler('./routes/
|
|
|
2265
2265
|
// chocolatey
|
|
2266
2266
|
router.get('/chocolatey/software/:name?', lazyloadRouteHandler('./routes/chocolatey/software'));
|
|
2267
2267
|
|
|
2268
|
-
// Nyaa
|
|
2269
|
-
router.get('/nyaa/search/:query?', lazyloadRouteHandler('./routes/nyaa/search'));
|
|
2268
|
+
// Nyaa migrated to v2
|
|
2269
|
+
// router.get('/nyaa/search/:query?', lazyloadRouteHandler('./routes/nyaa/search'));
|
|
2270
2270
|
|
|
2271
2271
|
// 片源网 migrated to v2
|
|
2272
2272
|
// router.get('/pianyuan/index/:media?', lazyloadRouteHandler('./routes/pianyuan/app'));
|
|
@@ -2492,11 +2492,11 @@ router.get('/wolley/user/:id', lazyloadRouteHandler('./routes/wolley/user'));
|
|
|
2492
2492
|
router.get('/wolley/host/:host', lazyloadRouteHandler('./routes/wolley/host'));
|
|
2493
2493
|
|
|
2494
2494
|
// 西安交大
|
|
2495
|
-
router.get('/xjtu/gs/tzgg', lazyloadRouteHandler('./routes/universities/xjtu/gs/tzgg'));
|
|
2496
|
-
router.get('/xjtu/dean/:subpath+', lazyloadRouteHandler('./routes/universities/xjtu/dean'));
|
|
2497
|
-
router.get('/xjtu/international/:subpath+', lazyloadRouteHandler('./routes/universities/xjtu/international'));
|
|
2498
|
-
router.get('/xjtu/job/:subpath?', lazyloadRouteHandler('./routes/universities/xjtu/job'));
|
|
2499
|
-
router.get('/xjtu/ee/:id?', lazyloadRouteHandler('./routes/universities/xjtu/ee'));
|
|
2495
|
+
// router.get('/xjtu/gs/tzgg', lazyloadRouteHandler('./routes/universities/xjtu/gs/tzgg'));
|
|
2496
|
+
// router.get('/xjtu/dean/:subpath+', lazyloadRouteHandler('./routes/universities/xjtu/dean'));
|
|
2497
|
+
// router.get('/xjtu/international/:subpath+', lazyloadRouteHandler('./routes/universities/xjtu/international'));
|
|
2498
|
+
// router.get('/xjtu/job/:subpath?', lazyloadRouteHandler('./routes/universities/xjtu/job'));
|
|
2499
|
+
// router.get('/xjtu/ee/:id?', lazyloadRouteHandler('./routes/universities/xjtu/ee'));
|
|
2500
2500
|
|
|
2501
2501
|
// booksource
|
|
2502
2502
|
router.get('/booksource', lazyloadRouteHandler('./routes/booksource/index'));
|
|
@@ -2863,7 +2863,7 @@ router.get('/law/jctd', lazyloadRouteHandler('./routes/law/jctd'));
|
|
|
2863
2863
|
router.get('/samsungmembers/latest', lazyloadRouteHandler('./routes/samsungmembers/latest'));
|
|
2864
2864
|
|
|
2865
2865
|
// 东莞教研网
|
|
2866
|
-
router.get('/dgjyw/:type', lazyloadRouteHandler('./routes/dgjyw/index'));
|
|
2866
|
+
// router.get('/dgjyw/:type', lazyloadRouteHandler('./routes/dgjyw/index'));
|
|
2867
2867
|
|
|
2868
2868
|
// 中国信息通信研究院
|
|
2869
2869
|
router.get('/gov/caict/bps', lazyloadRouteHandler('./routes/gov/caict/bps'));
|
|
@@ -3034,10 +3034,10 @@ router.get('/jlu/oa', lazyloadRouteHandler('./routes/universities/jlu/oa'));
|
|
|
3034
3034
|
router.get('/hfut/tzgg', lazyloadRouteHandler('./routes/universities/hfut/tzgg'));
|
|
3035
3035
|
|
|
3036
3036
|
// Darwin Awards
|
|
3037
|
-
router.get('/darwinawards/all', lazyloadRouteHandler('./routes/darwinawards/articles'));
|
|
3037
|
+
// router.get('/darwinawards/all', lazyloadRouteHandler('./routes/darwinawards/articles'));
|
|
3038
3038
|
|
|
3039
3039
|
// 四川职业技术学院
|
|
3040
|
-
router.get('/scvtc/xygg', lazyloadRouteHandler('./routes/universities/scvtc/xygg'));
|
|
3040
|
+
// router.get('/scvtc/xygg', lazyloadRouteHandler('./routes/universities/scvtc/xygg'));
|
|
3041
3041
|
|
|
3042
3042
|
// 华南理工大学土木与交通学院
|
|
3043
3043
|
router.get('/scut/scet/notice', lazyloadRouteHandler('./routes/universities/scut/scet/notice'));
|
|
@@ -2,7 +2,7 @@ const got = require('@/utils/got');
|
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
3
|
|
|
4
4
|
module.exports = async (ctx) => {
|
|
5
|
-
const rootUrl = 'https://www.
|
|
5
|
+
const rootUrl = 'https://www.agemys.com';
|
|
6
6
|
const currentUrl = `${rootUrl}/update`;
|
|
7
7
|
const response = await got({
|
|
8
8
|
method: 'get',
|
|
@@ -1,40 +1,18 @@
|
|
|
1
1
|
const cheerio = require('cheerio');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const dayjs = require('dayjs');
|
|
2
4
|
|
|
3
5
|
module.exports = async (ctx) => {
|
|
4
6
|
const baseIndexUrl = 'https://www.sice.uestc.edu.cn/index.htm';
|
|
5
7
|
const host = 'https://www.sice.uestc.edu.cn/';
|
|
6
|
-
const browser = await require('@/utils/puppeteer')();
|
|
8
|
+
const browser = await require('@/utils/puppeteer')({ stealth: true });
|
|
7
9
|
const page = await browser.newPage();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// 在每个新页面打开前执行以下脚本
|
|
12
|
-
const newProto = navigator.__proto__;
|
|
13
|
-
delete newProto.webdriver; // 删除navigator.webdriver字段
|
|
14
|
-
navigator.__proto__ = newProto;
|
|
15
|
-
window.chrome = {}; // 添加window.chrome字段,为增加真实性还需向内部填充一些值
|
|
16
|
-
window.chrome.app = { InstallState: 'hehe', RunningState: 'haha', getDetails: 'xixi', getIsInstalled: 'ohno' };
|
|
17
|
-
window.chrome.csi = function () {};
|
|
18
|
-
window.chrome.loadTimes = function () {};
|
|
19
|
-
window.chrome.runtime = function () {};
|
|
20
|
-
Object.defineProperty(navigator, 'userAgent', {
|
|
21
|
-
// userAgent在无头模式下有headless字样,所以需覆写
|
|
22
|
-
get: () => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36',
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(navigator, 'plugins', {
|
|
25
|
-
// 伪装真实的插件信息
|
|
26
|
-
get: () => [{ description: 'Portable Document Format', filename: 'internal-pdf-viewer', length: 1, name: 'Chrome PDF Plugin' }],
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(navigator, 'languages', {
|
|
29
|
-
// 添加语言
|
|
30
|
-
get: () => ['zh-CN', 'zh', 'en'],
|
|
31
|
-
});
|
|
32
|
-
const originalQuery = window.navigator.permissions.query; // notification伪装
|
|
33
|
-
window.navigator.permissions.query = (parameters) => (parameters.name === 'notifications' ? Promise.resolve({ state: Notification.permission }) : originalQuery(parameters));
|
|
10
|
+
await page.setRequestInterception(true);
|
|
11
|
+
page.on('request', (request) => {
|
|
12
|
+
request.resourceType() === 'document' || request.resourceType() === 'script' ? request.continue() : request.abort();
|
|
34
13
|
});
|
|
35
|
-
|
|
36
14
|
await page.goto(baseIndexUrl, {
|
|
37
|
-
waitUntil: '
|
|
15
|
+
waitUntil: 'networkidle2',
|
|
38
16
|
});
|
|
39
17
|
const content = await page.content();
|
|
40
18
|
await browser.close();
|
|
@@ -43,14 +21,15 @@ module.exports = async (ctx) => {
|
|
|
43
21
|
const out = $('.notice p')
|
|
44
22
|
.map((index, item) => {
|
|
45
23
|
item = $(item);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
24
|
+
const now = dayjs();
|
|
25
|
+
let date = dayjs(now.year() + '-' + item.find('a.date').text());
|
|
26
|
+
if (now < date) {
|
|
27
|
+
date = dayjs(now.year() - 1 + '-' + item.find('a.date').text());
|
|
49
28
|
}
|
|
50
29
|
return {
|
|
51
30
|
title: item.find('a[href]').text(),
|
|
52
31
|
link: host + item.find('a[href]').attr('href'),
|
|
53
|
-
pubDate: date,
|
|
32
|
+
pubDate: parseDate(date),
|
|
54
33
|
};
|
|
55
34
|
})
|
|
56
35
|
.get();
|
package/lib/utils/wechat-mp.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* There are at least three folders which are relevant with WeChat MP (Official Account Platform / Media Platform):
|
|
5
5
|
* lib/v2/wechat
|
|
6
|
+
* lib/v2/gov/npma
|
|
6
7
|
* lib/v2/gzh360
|
|
7
8
|
* lib/v2/pku/nsd/gd
|
|
8
9
|
* lib/v2/sdu/cs
|
|
@@ -104,6 +105,14 @@ const fixArticleContent = (html, skipImg = false) => {
|
|
|
104
105
|
}
|
|
105
106
|
});
|
|
106
107
|
|
|
108
|
+
// add breaks in code section
|
|
109
|
+
$('code').each((_, code) => {
|
|
110
|
+
$('<br>').insertAfter(code);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// clear line index tags in code section
|
|
114
|
+
$('.code-snippet__line-index').remove();
|
|
115
|
+
|
|
107
116
|
// fix single picture article
|
|
108
117
|
// example: https://mp.weixin.qq.com/s/4p5YmYuASiQSYFiy7KqydQ
|
|
109
118
|
$('script').each((_, script) => {
|
|
@@ -186,7 +195,6 @@ const fetchArticle = async (ctx, url, bypassHostCheck = false) => {
|
|
|
186
195
|
let summary = $('meta[name=description]').attr('content');
|
|
187
196
|
summary = summary !== title ? summary : '';
|
|
188
197
|
let description = fixArticleContent($('#js_content'));
|
|
189
|
-
|
|
190
198
|
// No article get or article is too short, try the original url
|
|
191
199
|
const originalUrl = detectOriginalArticleUrl($);
|
|
192
200
|
if (originalUrl) {
|
|
@@ -211,7 +219,6 @@ const fetchArticle = async (ctx, url, bypassHostCheck = false) => {
|
|
|
211
219
|
|
|
212
220
|
let mpName = $('.profile_nickname').first().text();
|
|
213
221
|
mpName = mpName && mpName.trim();
|
|
214
|
-
|
|
215
222
|
return { title, author, description, summary, pubDate, mpName, link: url };
|
|
216
223
|
});
|
|
217
224
|
};
|
package/lib/v2/36kr/router.js
CHANGED
|
@@ -3,5 +3,5 @@ module.exports = (router) => {
|
|
|
3
3
|
router.get('/news/:category?', require('./news'));
|
|
4
4
|
router.get('/newsflashes', require('./newsflashes'));
|
|
5
5
|
router.get('/search/article/:keyword', require('./search/article'));
|
|
6
|
-
router.get('/user/:
|
|
6
|
+
router.get('/user/:id', require('./user'));
|
|
7
7
|
};
|
|
@@ -2,69 +2,26 @@ const got = require('@/utils/got');
|
|
|
2
2
|
const { parseDate } = require('@/utils/parse-date');
|
|
3
3
|
|
|
4
4
|
module.exports = async (ctx) => {
|
|
5
|
-
const
|
|
6
|
-
const csrfresponse = await got.get('https://36kr.com/pp/api/csrf');
|
|
7
|
-
const cookies = csrfresponse.headers['set-cookie'].toString();
|
|
8
|
-
const token = cookies.match(/M-XSRF-TOKEN=.{64}/)[0];
|
|
9
|
-
const acw_tc = cookies.match(/acw_tc=.{61}/)[0];
|
|
10
|
-
const krnewsfrontss = cookies.match(/krnewsfrontss=.{32}/)[0];
|
|
5
|
+
const keyword = ctx.params.keyword ?? '';
|
|
11
6
|
|
|
12
|
-
const
|
|
7
|
+
const rootUrl = 'https://www.36kr.com';
|
|
8
|
+
const currentUrl = `${rootUrl}/search/articles/${keyword}`;
|
|
13
9
|
|
|
14
10
|
const response = await got({
|
|
15
|
-
method: '
|
|
16
|
-
url:
|
|
17
|
-
headers: {
|
|
18
|
-
'Content-Type': 'application/json',
|
|
19
|
-
cookie: `${token};${acw_tc};${krnewsfrontss};`,
|
|
20
|
-
'M-X-XSRF-TOKEN': token.replace('M-XSRF-TOKEN=', ''),
|
|
21
|
-
},
|
|
22
|
-
data: JSON.stringify({
|
|
23
|
-
param: {
|
|
24
|
-
pageCallback: Buffer.from(
|
|
25
|
-
JSON.stringify({
|
|
26
|
-
firstId: 1,
|
|
27
|
-
lastId: 1,
|
|
28
|
-
firstCreateTime: timestamp,
|
|
29
|
-
lastCreateTime: timestamp,
|
|
30
|
-
})
|
|
31
|
-
).toString('base64'),
|
|
32
|
-
pageEvent: 1,
|
|
33
|
-
pageSize: 20,
|
|
34
|
-
platformId: 2,
|
|
35
|
-
searchType: 'article',
|
|
36
|
-
searchWord: keyword,
|
|
37
|
-
siteId: 1,
|
|
38
|
-
sort: 'date',
|
|
39
|
-
},
|
|
40
|
-
partner_id: 'web',
|
|
41
|
-
timestamp,
|
|
42
|
-
}),
|
|
11
|
+
method: 'get',
|
|
12
|
+
url: currentUrl,
|
|
43
13
|
});
|
|
44
14
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const items = await Promise.all(
|
|
52
|
-
(response.data.data.itemList || []).map(async (item) => {
|
|
53
|
-
const link = `https://www.36kr.com/p/${item.itemId}`;
|
|
54
|
-
const single = {
|
|
55
|
-
title: item.widgetTitle,
|
|
56
|
-
link,
|
|
57
|
-
pubDate: parseDate(item.publishTime),
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const other = await ctx.cache.tryGet(link, () => load(link));
|
|
61
|
-
return { ...single, ...other };
|
|
62
|
-
})
|
|
63
|
-
);
|
|
15
|
+
const items = JSON.parse(response.data.match(/"itemList":(.*),"pageCallback"/)[1]).map((item) => ({
|
|
16
|
+
title: item.widgetTitle.replace(/<\/?em>/g, ''),
|
|
17
|
+
link: `${rootUrl}/p/${item.itemId}`,
|
|
18
|
+
description: `<p>${item.content}</p>`,
|
|
19
|
+
pubDate: parseDate(item.publishTime),
|
|
20
|
+
}));
|
|
64
21
|
|
|
65
22
|
ctx.state.data = {
|
|
66
|
-
title: `
|
|
67
|
-
link:
|
|
23
|
+
title: `36氪 - ${keyword}相关文章`,
|
|
24
|
+
link: currentUrl,
|
|
68
25
|
item: items,
|
|
69
26
|
};
|
|
70
27
|
};
|
package/lib/v2/36kr/user.js
CHANGED
|
@@ -2,35 +2,60 @@ const got = require('@/utils/got');
|
|
|
2
2
|
const { parseDate } = require('@/utils/parse-date');
|
|
3
3
|
|
|
4
4
|
module.exports = async (ctx) => {
|
|
5
|
-
const
|
|
5
|
+
const id = ctx.params.id;
|
|
6
|
+
|
|
7
|
+
const rootUrl = 'https://36kr.com';
|
|
8
|
+
const apiRootUrl = 'https://gateway.36kr.com';
|
|
9
|
+
const currentUrl = `${rootUrl}/user/${id}`;
|
|
10
|
+
|
|
11
|
+
const infoResponse = await got({
|
|
12
|
+
method: 'post',
|
|
13
|
+
url: `${apiRootUrl}/api/mis/user/info`,
|
|
14
|
+
json: {
|
|
15
|
+
param: {
|
|
16
|
+
userId: id,
|
|
17
|
+
siteId: 1,
|
|
18
|
+
platformId: 2,
|
|
19
|
+
},
|
|
20
|
+
platformId: 2,
|
|
21
|
+
siteId: 1,
|
|
22
|
+
userId: id,
|
|
23
|
+
partner_id: 'web',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
6
27
|
const response = await got({
|
|
7
|
-
method: '
|
|
8
|
-
url:
|
|
28
|
+
method: 'post',
|
|
29
|
+
url: `${apiRootUrl}/api/mis/me/article`,
|
|
30
|
+
json: {
|
|
31
|
+
param: {
|
|
32
|
+
userId: id,
|
|
33
|
+
pageEvent: 0,
|
|
34
|
+
pageSize: 20,
|
|
35
|
+
pageCallback: '',
|
|
36
|
+
siteId: 1,
|
|
37
|
+
platformId: 2,
|
|
38
|
+
},
|
|
39
|
+
pageCallback: '',
|
|
40
|
+
pageEvent: 0,
|
|
41
|
+
pageSize: 20,
|
|
42
|
+
platformId: 2,
|
|
43
|
+
siteId: 1,
|
|
44
|
+
userId: id,
|
|
45
|
+
partner_id: 'web',
|
|
46
|
+
},
|
|
9
47
|
});
|
|
10
|
-
const data = JSON.parse(response.data.match(/"authorDetailData":(.*?),"channel":/)[1]);
|
|
11
48
|
|
|
12
|
-
const
|
|
13
|
-
const authorFlowList = data.authorFlowList.data.itemList;
|
|
14
|
-
const articleList = authorFlowList.map((item) => ({
|
|
49
|
+
const items = response.data.data.itemList.map((item) => ({
|
|
15
50
|
title: item.templateMaterial.widgetTitle,
|
|
16
|
-
link:
|
|
51
|
+
link: `${rootUrl}/p/${item.itemId}`,
|
|
17
52
|
pubDate: parseDate(item.templateMaterial.publishTime),
|
|
53
|
+
description: `<p>${item.templateMaterial.widgetContent}</p>`,
|
|
18
54
|
}));
|
|
19
55
|
|
|
20
56
|
ctx.state.data = {
|
|
21
|
-
title: `
|
|
22
|
-
link:
|
|
23
|
-
item:
|
|
24
|
-
articleList.map((item) =>
|
|
25
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
26
|
-
const contentResponse = await got({ method: 'get', url: item.link });
|
|
27
|
-
const result = contentResponse.data.match(/"articleDetailData":(.*?),"articleRecommendData":/) || contentResponse.data.match(/"videoDetail":(.*?),"authorVideos":/);
|
|
28
|
-
const contentData = JSON.parse(result[1]);
|
|
29
|
-
item.description = contentData.data.widgetContent;
|
|
30
|
-
return item;
|
|
31
|
-
})
|
|
32
|
-
)
|
|
33
|
-
),
|
|
34
|
-
description: `${authorInfo.label} | ${authorInfo.summary}`,
|
|
57
|
+
title: `36kr - ${infoResponse.data.data.userNick}`,
|
|
58
|
+
link: currentUrl,
|
|
59
|
+
item: items,
|
|
35
60
|
};
|
|
36
61
|
};
|