rsshub 1.0.0-master.e4c6dab → 1.0.0-master.e50dc70

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.
Files changed (114) hide show
  1. package/lib/config.js +135 -124
  2. package/lib/middleware/template.js +4 -4
  3. package/lib/router.js +0 -15
  4. package/lib/routes/afdian/dynamic.js +2 -1
  5. package/lib/routes/bilibili/article.js +1 -0
  6. package/lib/routes/bilibili/dynamic.js +1 -0
  7. package/lib/routes/fdroid/apprelease.js +1 -1
  8. package/lib/routes/guancha/member.js +24 -10
  9. package/lib/routes/hentaimama/videos.js +1 -1
  10. package/lib/routes/lizhi/user.js +1 -1
  11. package/lib/routes/missevan/drama.js +1 -1
  12. package/lib/routes/missevan/latest.js +1 -1
  13. package/lib/routes/ncm/djradio.js +3 -4
  14. package/lib/routes/nhentai/util.js +2 -2
  15. package/lib/routes/radio/radio.js +1 -1
  16. package/lib/routes/sina/rollnews.js +8 -3
  17. package/lib/routes/tencent/wechat/tgchannel.js +7 -1
  18. package/lib/routes/touhougarakuta/index.js +4 -2
  19. package/lib/routes/touhougarakuta/json2html.js +22 -10
  20. package/lib/routes/universities/hitwh/today.js +6 -6
  21. package/lib/routes/ximalaya/album.js +2 -2
  22. package/lib/routes/yyets/todayfilelist.js +0 -1
  23. package/lib/routes/zhihu/activities.js +1 -0
  24. package/lib/routes/zhihu/daily.js +1 -0
  25. package/lib/routes/zhihu/daily_section.js +1 -0
  26. package/lib/utils/puppeteer.js +1 -1
  27. package/lib/v2/35photo/actual.js +7 -0
  28. package/lib/v2/35photo/author.js +9 -0
  29. package/lib/v2/35photo/genre.js +9 -0
  30. package/lib/v2/35photo/interesting.js +7 -0
  31. package/lib/v2/35photo/maintainer.js +8 -0
  32. package/lib/v2/35photo/map.js +7 -0
  33. package/lib/v2/35photo/new.js +7 -0
  34. package/lib/v2/35photo/radar.js +43 -0
  35. package/lib/v2/35photo/router.js +8 -0
  36. package/lib/v2/35photo/utils.js +42 -0
  37. package/lib/v2/ajmide/index.js +1 -1
  38. package/lib/v2/app-center/templates/description.art +1 -1
  39. package/lib/v2/bbcnewslabs/maintainer.js +3 -0
  40. package/lib/v2/bbcnewslabs/news.js +32 -0
  41. package/lib/v2/bbcnewslabs/radar.js +13 -0
  42. package/lib/v2/bbcnewslabs/router.js +3 -0
  43. package/lib/v2/bigquant/collections.js +35 -0
  44. package/lib/v2/bigquant/maintainer.js +3 -0
  45. package/lib/v2/bigquant/radar.js +13 -0
  46. package/lib/v2/bigquant/router.js +3 -0
  47. package/lib/v2/bitmovin/blog.js +33 -0
  48. package/lib/v2/bitmovin/maintainer.js +3 -0
  49. package/lib/v2/bitmovin/radar.js +13 -0
  50. package/lib/v2/bitmovin/router.js +3 -0
  51. package/lib/v2/dayanzai/index.js +58 -0
  52. package/lib/v2/dayanzai/maintainer.js +3 -0
  53. package/lib/v2/dayanzai/radar.js +13 -0
  54. package/lib/v2/dayanzai/router.js +3 -0
  55. package/lib/v2/ff14/ff14_global.js +1 -1
  56. package/lib/v2/foresightnews/index.js +88 -0
  57. package/lib/v2/foresightnews/maintainer.js +6 -0
  58. package/lib/v2/foresightnews/radar.js +31 -0
  59. package/lib/v2/foresightnews/router.js +3 -0
  60. package/lib/v2/gcores/category.js +126 -0
  61. package/lib/v2/gcores/maintainer.js +4 -0
  62. package/lib/v2/gcores/radar.js +19 -0
  63. package/lib/v2/gcores/router.js +4 -0
  64. package/lib/v2/gcores/tag.js +126 -0
  65. package/lib/v2/google/maintainer.js +1 -0
  66. package/lib/v2/google/router.js +1 -0
  67. package/lib/v2/google/sitesRecentChanges.js +52 -0
  68. package/lib/v2/gov/maintainer.js +6 -0
  69. package/lib/v2/gov/mee/ywdt.js +80 -0
  70. package/lib/v2/gov/miit/wjfb.js +61 -0
  71. package/lib/{routes → v2}/gov/miit/wjgs.js +0 -0
  72. package/lib/v2/gov/miit/yjzj.js +59 -0
  73. package/lib/{routes → v2}/gov/miit/zcjd.js +0 -0
  74. package/lib/{routes → v2}/gov/miit/zcwj.js +0 -0
  75. package/lib/v2/gov/radar.js +28 -0
  76. package/lib/v2/gov/router.js +6 -0
  77. package/lib/v2/ithome/index.js +1 -0
  78. package/lib/v2/liulinblog/itnews.js +23 -0
  79. package/lib/v2/liulinblog/kuaixun.js +17 -0
  80. package/lib/v2/liulinblog/maintainer.js +4 -0
  81. package/lib/v2/liulinblog/radar.js +33 -0
  82. package/lib/v2/liulinblog/router.js +4 -0
  83. package/lib/v2/liulinblog/utils.js +39 -0
  84. package/lib/v2/ntdtv/channel.js +44 -0
  85. package/lib/v2/ntdtv/maintainer.js +3 -0
  86. package/lib/v2/ntdtv/radar.js +13 -0
  87. package/lib/v2/ntdtv/router.js +3 -0
  88. package/lib/v2/segmentfault/channel.js +46 -0
  89. package/lib/v2/segmentfault/maintainer.js +4 -0
  90. package/lib/v2/segmentfault/radar.js +19 -0
  91. package/lib/v2/segmentfault/router.js +4 -0
  92. package/lib/v2/segmentfault/user.js +43 -0
  93. package/lib/v2/soundofhope/channel.js +42 -0
  94. package/lib/v2/soundofhope/maintainer.js +3 -0
  95. package/lib/v2/soundofhope/radar.js +13 -0
  96. package/lib/v2/soundofhope/router.js +3 -0
  97. package/lib/v2/sputniknews/index.js +93 -0
  98. package/lib/v2/sputniknews/maintainer.js +3 -0
  99. package/lib/v2/sputniknews/radar.js +13 -0
  100. package/lib/v2/sputniknews/router.js +3 -0
  101. package/lib/v2/telegram/channel.js +1 -1
  102. package/lib/v2/test/index.js +1 -0
  103. package/lib/v2/whitehouse/maintainer.js +1 -0
  104. package/lib/v2/whitehouse/ostp.js +50 -0
  105. package/lib/v2/whitehouse/radar.js +6 -0
  106. package/lib/v2/whitehouse/router.js +1 -0
  107. package/lib/v2/xiaoyuzhou/pickup.js +2 -2
  108. package/lib/v2/xiaoyuzhou/podcast.js +1 -1
  109. package/lib/views/rss.art +5 -4
  110. package/package.json +6 -6
  111. package/lib/routes/gcores/category.js +0 -127
  112. package/lib/routes/gov/mee/gs.js +0 -54
  113. package/lib/routes/segmentfault/channel.js +0 -90
  114. package/lib/routes/segmentfault/user.js +0 -90
package/lib/config.js CHANGED
@@ -25,83 +25,34 @@ const calculateValue = () => {
25
25
  }
26
26
 
27
27
  value = {
28
+ // app config
29
+ disallowRobot: envs.DISALLOW_ROBOT !== '0' && envs.DISALLOW_ROBOT !== 'false',
30
+ enableCluster: envs.ENABLE_CLUSTER,
28
31
  isPackage: envs.IS_PACKAGE,
29
- noLogfiles: envs.NO_LOGFILES,
32
+ nodeName: envs.NODE_NAME,
33
+ puppeteerWSEndpoint: envs.PUPPETEER_WS_ENDPOINT,
34
+ // network
30
35
  connect: {
31
36
  port: envs.PORT || 1200, // 监听端口
32
37
  socket: envs.SOCKET || null, // 监听 Unix Socket, null 为禁用
33
38
  },
39
+ listenInaddrAny: envs.LISTEN_INADDR_ANY || 1, // 是否允许公网连接,取值 0 1
40
+ requestRetry: parseInt(envs.REQUEST_RETRY) || 2, // 请求失败重试次数
41
+ requestTimeout: parseInt(envs.REQUEST_TIMEOUT) || 30000, // Milliseconds to wait for the server to end the response before aborting the request
42
+ ua: envs.UA || 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36',
43
+ // cors request
44
+ allowOrigin: envs.ALLOW_ORIGIN,
45
+ // cache
34
46
  cache: {
35
47
  type: typeof envs.CACHE_TYPE === 'undefined' ? 'memory' : envs.CACHE_TYPE, // 缓存类型,支持 'memory' 和 'redis',设为空可以禁止缓存
36
48
  requestTimeout: parseInt(envs.CACHE_REQUEST_TIMEOUT) || 60,
37
49
  routeExpire: parseInt(envs.CACHE_EXPIRE) || 5 * 60, // 路由缓存时间,单位为秒
38
50
  contentExpire: parseInt(envs.CACHE_CONTENT_EXPIRE) || 1 * 60 * 60, // 不变内容缓存时间,单位为秒
39
51
  },
40
- ua: envs.UA || 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36',
41
- listenInaddrAny: envs.LISTEN_INADDR_ANY || 1, // 是否允许公网连接,取值 0 1
42
- requestRetry: parseInt(envs.REQUEST_RETRY) || 2, // 请求失败重试次数
43
- requestTimeout: parseInt(envs.REQUEST_TIMEOUT) || 30000, // Milliseconds to wait for the server to end the response before aborting the request
44
- // 是否显示 Debug 信息,取值 'true' 'false' 'some_string' ,取值为 'true' 时永久显示,取值为 'false' 时永远隐藏,取值为 'some_string' 时请求带上 '?debug=some_string' 显示
45
- debugInfo: envs.DEBUG_INFO || 'true',
46
- disallowRobot: envs.DISALLOW_ROBOT !== '0' && envs.DISALLOW_ROBOT !== 'false',
47
- titleLengthLimit: parseInt(envs.TITLE_LENGTH_LIMIT) || 150,
48
52
  redis: {
49
53
  url: envs.REDIS_URL || 'redis://localhost:6379/',
50
54
  },
51
- nodeName: envs.NODE_NAME,
52
- suffix: envs.SUFFIX,
53
- pixiv: {
54
- refreshToken: envs.PIXIV_REFRESHTOKEN,
55
- bypassCdn: envs.PIXIV_BYPASS_CDN !== '0' && envs.PIXIV_BYPASS_CDN !== 'false',
56
- bypassCdnHostname: envs.PIXIV_BYPASS_HOSTNAME || 'public-api.secure.pixiv.net',
57
- bypassCdnDoh: envs.PIXIV_BYPASS_DOH || 'https://1.1.1.1/dns-query',
58
- imgProxy: envs.PIXIV_IMG_PROXY || 'https://i.pixiv.cat',
59
- },
60
- fanbox: {
61
- session: envs.FANBOX_SESSION_ID,
62
- },
63
- disqus: {
64
- api_key: envs.DISQUS_API_KEY,
65
- },
66
- spotify: {
67
- clientId: envs.SPOTIFY_CLIENT_ID,
68
- clientSecret: envs.SPOTIFY_CLIENT_SECRET,
69
- refreshToken: envs.SPOTIFY_REFRESHTOKEN,
70
- },
71
- twitter: {
72
- consumer_key: envs.TWITTER_CONSUMER_KEY,
73
- consumer_secret: envs.TWITTER_CONSUMER_SECRET,
74
- tokens: twitter_tokens,
75
- authorization: envs.TWITTER_WEBAPI_AUTHORIZAION || 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',
76
- // 此处硬编码参考自https://github.com/mikf/gallery-dl/blob/master/gallery_dl/extractor/twitter.py#L550
77
- },
78
- youtube: {
79
- key: envs.YOUTUBE_KEY,
80
- },
81
- telegram: {
82
- token: envs.TELEGRAM_TOKEN,
83
- },
84
- github: {
85
- access_token: envs.GITHUB_ACCESS_TOKEN,
86
- },
87
- authentication: {
88
- name: envs.HTTP_BASIC_AUTH_NAME || 'usernam3',
89
- pass: envs.HTTP_BASIC_AUTH_PASS || 'passw0rd',
90
- },
91
- bilibili: {
92
- cookies: bilibili_cookies,
93
- },
94
- yuque: {
95
- token: envs.YUQUE_TOKEN,
96
- },
97
- zhihu: {
98
- cookies: envs.ZHIHU_COOKIES,
99
- },
100
- ncm: {
101
- cookies: envs.NCM_COOKIES || '',
102
- },
103
- puppeteerWSEndpoint: envs.PUPPETEER_WS_ENDPOINT,
104
- loggerLevel: envs.LOGGER_LEVEL || 'info',
55
+ // proxy
105
56
  proxyUri: envs.PROXY_URI,
106
57
  proxy: {
107
58
  protocol: envs.PROXY_PROTOCOL,
@@ -110,26 +61,70 @@ const calculateValue = () => {
110
61
  auth: envs.PROXY_AUTH,
111
62
  url_regex: envs.PROXY_URL_REGEX || '.*',
112
63
  },
113
- allowOrigin: envs.ALLOW_ORIGIN,
64
+ // auth
65
+ authentication: {
66
+ name: envs.HTTP_BASIC_AUTH_NAME || 'usernam3',
67
+ pass: envs.HTTP_BASIC_AUTH_PASS || 'passw0rd',
68
+ },
69
+ // access control
114
70
  blacklist: envs.BLACKLIST && envs.BLACKLIST.split(','),
115
71
  whitelist: envs.WHITELIST && envs.WHITELIST.split(','),
116
72
  allowLocalhost: envs.ALLOW_LOCALHOST,
117
73
  accessKey: envs.ACCESS_KEY,
118
- enableCluster: envs.ENABLE_CLUSTER,
119
- email: {
120
- config: email_config,
121
- },
74
+ // logging
75
+ // 是否显示 Debug 信息,取值 'true' 'false' 'some_string' ,取值为 'true' 时永久显示,取值为 'false' 时永远隐藏,取值为 'some_string' 时请求带上 '?debug=some_string' 显示
76
+ debugInfo: envs.DEBUG_INFO || 'true',
77
+ loggerLevel: envs.LOGGER_LEVEL || 'info',
78
+ noLogfiles: envs.NO_LOGFILES,
122
79
  sentry: {
123
80
  dsn: envs.SENTRY,
124
81
  routeTimeout: parseInt(envs.SENTRY_ROUTE_TIMEOUT) || 30000,
125
82
  },
83
+ // feed config
84
+ hotlink: {
85
+ template: envs.HOTLINK_TEMPLATE,
86
+ },
87
+ suffix: envs.SUFFIX,
88
+ titleLengthLimit: parseInt(envs.TITLE_LENGTH_LIMIT) || 150,
89
+
90
+ // Route-specific Configurations
91
+ bilibili: {
92
+ cookies: bilibili_cookies,
93
+ },
94
+ btbyr: {
95
+ host: envs.BTBYR_HOST,
96
+ cookies: envs.BTBYR_COOKIE,
97
+ },
98
+ bupt: {
99
+ portal_cookie: envs.BUPT_PORTAL_COOKIE,
100
+ },
126
101
  chuiniu: {
127
102
  member: envs.CHUINIU_MEMBER,
128
103
  },
129
- weibo: {
130
- app_key: envs.WEIBO_APP_KEY,
131
- app_secret: envs.WEIBO_APP_SECRET,
132
- redirect_url: envs.WEIBO_REDIRECT_URL,
104
+ dida365: {
105
+ username: envs.DIDA365_USERNAME,
106
+ password: envs.DIDA365_PASSWORD,
107
+ },
108
+ discuz: {
109
+ cookies: discuz_cookies,
110
+ },
111
+ disqus: {
112
+ api_key: envs.DISQUS_API_KEY,
113
+ },
114
+ douban: {
115
+ cookie: envs.DOUBAN_COOKIE,
116
+ },
117
+ ehentai: {
118
+ ipb_member_id: envs.EH_IPB_MEMBER_ID,
119
+ ipb_pass_hash: envs.EH_IPB_PASS_HASH,
120
+ sk: envs.EH_SK,
121
+ igneous: envs.EH_IGNEOUS,
122
+ },
123
+ email: {
124
+ config: email_config,
125
+ },
126
+ fanbox: {
127
+ session: envs.FANBOX_SESSION_ID,
133
128
  },
134
129
  fanfou: {
135
130
  consumer_key: envs.FANFOU_CONSUMER_KEY,
@@ -137,27 +132,17 @@ const calculateValue = () => {
137
132
  username: envs.FANFOU_USERNAME,
138
133
  password: envs.FANFOU_PASSWORD,
139
134
  },
140
- lastfm: {
141
- api_key: envs.LASTFM_API_KEY,
142
- },
143
- pkubbs: {
144
- cookie: envs.PKUBBS_COOKIE,
145
- },
146
- bupt: {
147
- portal_cookie: envs.BUPT_PORTAL_COOKIE,
148
- },
149
- nhentai: {
150
- username: envs.NHENTAI_USERNAME,
151
- password: envs.NHENTAI_PASSWORD,
135
+ game4399: {
136
+ cookie: envs.GAME_4399,
152
137
  },
153
- discuz: {
154
- cookies: discuz_cookies,
138
+ github: {
139
+ access_token: envs.GITHUB_ACCESS_TOKEN,
155
140
  },
156
- scihub: {
157
- host: envs.SCIHUB_HOST || 'https://sci-hub.se/',
141
+ google: {
142
+ fontsApiKey: envs.GOOGLE_FONTS_API_KEY,
158
143
  },
159
- hotlink: {
160
- template: envs.HOTLINK_TEMPLATE,
144
+ infzm: {
145
+ cookie: envs.INFZM_COOKIE,
161
146
  },
162
147
  initium: {
163
148
  username: envs.INITIUM_USERNAME,
@@ -165,68 +150,94 @@ const calculateValue = () => {
165
150
  bearertoken: envs.INITIUM_BEARER_TOKEN,
166
151
  iap_receipt: envs.INITIUM_IAP_RECEIPT,
167
152
  },
168
- btbyr: {
169
- host: envs.BTBYR_HOST,
170
- cookies: envs.BTBYR_COOKIE,
153
+ instagram: {
154
+ username: envs.IG_USERNAME,
155
+ password: envs.IG_PASSWORD,
156
+ proxy: envs.IG_PROXY,
157
+ },
158
+ lastfm: {
159
+ api_key: envs.LASTFM_API_KEY,
171
160
  },
172
161
  mastodon: {
173
162
  apiHost: envs.MASTODON_API_HOST,
174
163
  accessToken: envs.MASTODON_API_ACCESS_TOKEN,
175
164
  acctDomain: envs.MASTODON_API_ACCT_DOMAIN,
176
165
  },
177
- xiaoyuzhou: {
178
- device_id: envs.XIAOYUZHOU_ID,
179
- refresh_token: envs.XIAOYUZHOU_TOKEN,
180
- },
181
166
  miniflux: {
182
167
  instance: envs.MINIFLUX_INSTANCE || 'https://reader.miniflux.app',
183
168
  token: envs.MINIFLUX_TOKEN || '',
184
169
  },
185
- nga: {
186
- uid: envs.NGA_PASSPORT_UID,
187
- cid: envs.NGA_PASSPORT_CID,
170
+ ncm: {
171
+ cookies: envs.NCM_COOKIES || '',
188
172
  },
189
173
  newrank: {
190
174
  cookie: envs.NEWRANK_COOKIE,
191
175
  },
192
- ximalaya: {
193
- token: envs.XIMALAYA_TOKEN,
176
+ nga: {
177
+ uid: envs.NGA_PASSPORT_UID,
178
+ cid: envs.NGA_PASSPORT_CID,
194
179
  },
195
- game4399: {
196
- cookie: envs.GAME_4399,
180
+ nhentai: {
181
+ username: envs.NHENTAI_USERNAME,
182
+ password: envs.NHENTAI_PASSWORD,
197
183
  },
198
- dida365: {
199
- username: envs.DIDA365_USERNAME,
200
- password: envs.DIDA365_PASSWORD,
184
+ pixiv: {
185
+ refreshToken: envs.PIXIV_REFRESHTOKEN,
186
+ bypassCdn: envs.PIXIV_BYPASS_CDN !== '0' && envs.PIXIV_BYPASS_CDN !== 'false',
187
+ bypassCdnHostname: envs.PIXIV_BYPASS_HOSTNAME || 'public-api.secure.pixiv.net',
188
+ bypassCdnDoh: envs.PIXIV_BYPASS_DOH || 'https://1.1.1.1/dns-query',
189
+ imgProxy: envs.PIXIV_IMG_PROXY || 'https://i.pixiv.cat',
190
+ },
191
+ pkubbs: {
192
+ cookie: envs.PKUBBS_COOKIE,
201
193
  },
202
194
  scboy: {
203
195
  token: envs.SCBOY_BBS_TOKEN,
204
196
  },
205
- wordpress: {
206
- cdnUrl: envs.WORDPRESS_CDN,
197
+ scihub: {
198
+ host: envs.SCIHUB_HOST || 'https://sci-hub.se/',
207
199
  },
208
- ehentai: {
209
- ipb_member_id: envs.EH_IPB_MEMBER_ID,
210
- ipb_pass_hash: envs.EH_IPB_PASS_HASH,
211
- sk: envs.EH_SK,
212
- igneous: envs.EH_IGNEOUS,
200
+ spotify: {
201
+ clientId: envs.SPOTIFY_CLIENT_ID,
202
+ clientSecret: envs.SPOTIFY_CLIENT_SECRET,
203
+ refreshToken: envs.SPOTIFY_REFRESHTOKEN,
213
204
  },
214
- infzm: {
215
- cookie: envs.INFZM_COOKIE,
205
+ telegram: {
206
+ token: envs.TELEGRAM_TOKEN,
207
+ },
208
+ twitter: {
209
+ consumer_key: envs.TWITTER_CONSUMER_KEY,
210
+ consumer_secret: envs.TWITTER_CONSUMER_SECRET,
211
+ tokens: twitter_tokens,
212
+ authorization: envs.TWITTER_WEBAPI_AUTHORIZAION || 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',
213
+ // 此处硬编码参考自https://github.com/mikf/gallery-dl/blob/master/gallery_dl/extractor/twitter.py#L550
214
+ },
215
+ weibo: {
216
+ app_key: envs.WEIBO_APP_KEY,
217
+ app_secret: envs.WEIBO_APP_SECRET,
218
+ redirect_url: envs.WEIBO_REDIRECT_URL,
216
219
  },
217
220
  wenku8: {
218
221
  cookie: envs.WENKU8_COOKIE,
219
222
  },
220
- google: {
221
- fontsApiKey: envs.GOOGLE_FONTS_API_KEY,
223
+ wordpress: {
224
+ cdnUrl: envs.WORDPRESS_CDN,
222
225
  },
223
- instagram: {
224
- username: envs.IG_USERNAME,
225
- password: envs.IG_PASSWORD,
226
- proxy: envs.IG_PROXY,
226
+ xiaoyuzhou: {
227
+ device_id: envs.XIAOYUZHOU_ID,
228
+ refresh_token: envs.XIAOYUZHOU_TOKEN,
227
229
  },
228
- douban: {
229
- cookie: envs.DOUBAN_COOKIE,
230
+ ximalaya: {
231
+ token: envs.XIMALAYA_TOKEN,
232
+ },
233
+ youtube: {
234
+ key: envs.YOUTUBE_KEY,
235
+ },
236
+ yuque: {
237
+ token: envs.YUQUE_TOKEN,
238
+ },
239
+ zhihu: {
240
+ cookies: envs.ZHIHU_COOKIES,
230
241
  },
231
242
  };
232
243
  };
@@ -54,10 +54,10 @@ module.exports = async (ctx, next) => {
54
54
  }
55
55
  }
56
56
 
57
- if (item.enclosure_length) {
58
- const itunes_duration =
59
- Math.floor(item.enclosure_length / 3600) + ':' + (Math.floor((item.enclosure_length % 3600) / 60) / 100).toFixed(2).slice(-2) + ':' + (((item.enclosure_length % 3600) % 60) / 100).toFixed(2).slice(-2);
60
- item.itunes_duration = itunes_duration;
57
+ if (item.itunes_duration && ((typeof item.itunes_duration === 'string' && item.itunes_duration.indexOf(':') === -1) || (typeof item.itunes_duration === 'number' && !isNaN(item.itunes_duration)))) {
58
+ item.itunes_duration = +item.itunes_duration;
59
+ item.itunes_duration =
60
+ Math.floor(item.itunes_duration / 3600) + ':' + (Math.floor((item.itunes_duration % 3600) / 60) / 100).toFixed(2).slice(-2) + ':' + (((item.itunes_duration % 3600) % 60) / 100).toFixed(2).slice(-2);
61
61
  }
62
62
  });
63
63
  }
package/lib/router.js CHANGED
@@ -338,9 +338,6 @@ router.get('/t66y/:id/:type?', lazyloadRouteHandler('./routes/t66y/index'));
338
338
  // 色中色
339
339
  router.get('/sexinsex/:id/:type?', lazyloadRouteHandler('./routes/sexinsex/index'));
340
340
 
341
- // 机核
342
- router.get('/gcores/category/:category', lazyloadRouteHandler('./routes/gcores/category'));
343
-
344
341
  // 国家地理
345
342
  router.get('/natgeo/dailyphoto', lazyloadRouteHandler('./routes/natgeo/dailyphoto'));
346
343
  router.get('/natgeo/:cat/:type?', lazyloadRouteHandler('./routes/natgeo/natgeo'));
@@ -1265,9 +1262,6 @@ router.get('/gov/ndrc/xwdt/:caty?', lazyloadRouteHandler('./routes/gov/ndrc/xwdt
1265
1262
  // 中华人民共和国-海关总署
1266
1263
  router.get('/gov/customs/list/:gchannel', lazyloadRouteHandler('./routes/gov/customs/list'));
1267
1264
 
1268
- // 中华人民共和国生态环境部
1269
- router.get('/gov/mee/gs', lazyloadRouteHandler('./routes/gov/mee/gs'));
1270
-
1271
1265
  // 中华人民共和国教育部
1272
1266
  router.get('/gov/moe/:type', lazyloadRouteHandler('./routes/gov/moe/moe'));
1273
1267
 
@@ -1377,10 +1371,6 @@ router.get('/leetcode/articles', lazyloadRouteHandler('./routes/leetcode/article
1377
1371
  router.get('/leetcode/submission/us/:user', lazyloadRouteHandler('./routes/leetcode/check-us'));
1378
1372
  router.get('/leetcode/submission/cn/:user', lazyloadRouteHandler('./routes/leetcode/check-cn'));
1379
1373
 
1380
- // segmentfault
1381
- router.get('/segmentfault/channel/:name', lazyloadRouteHandler('./routes/segmentfault/channel'));
1382
- router.get('/segmentfault/user/:name', lazyloadRouteHandler('./routes/segmentfault/user'));
1383
-
1384
1374
  // 虎扑
1385
1375
  router.get('/hupu/bxj/:id/:order?', lazyloadRouteHandler('./routes/hupu/bbs'));
1386
1376
  router.get('/hupu/bbs/:id/:order?', lazyloadRouteHandler('./routes/hupu/bbs'));
@@ -2294,11 +2284,6 @@ router.get('/noi/winners-list', lazyloadRouteHandler('./routes/noi/winners-list'
2294
2284
  router.get('/noi/province-news', lazyloadRouteHandler('./routes/noi/province-news'));
2295
2285
  router.get('/noi/rg-news', lazyloadRouteHandler('./routes/noi/rg-news'));
2296
2286
 
2297
- // 中国工业化和信息部
2298
- router.get('/gov/miit/zcwj', lazyloadRouteHandler('./routes/gov/miit/zcwj'));
2299
- router.get('/gov/miit/wjgs', lazyloadRouteHandler('./routes/gov/miit/wjgs'));
2300
- router.get('/gov/miit/zcjd', lazyloadRouteHandler('./routes/gov/miit/zcjd'));
2301
-
2302
2287
  // 中国国家认证认可监管管理员会
2303
2288
  router.get('/gov/cnca/jgdt', lazyloadRouteHandler('./routes/gov/cnca/jgdt'));
2304
2289
  router.get('/gov/cnca/hydt', lazyloadRouteHandler('./routes/gov/cnca/hydt'));
@@ -9,7 +9,7 @@ module.exports = async (ctx) => {
9
9
  },
10
10
  });
11
11
  const userInfo = userInfoRes.data.data.user;
12
- const { user_id, name } = userInfo;
12
+ const { user_id, name, avatar } = userInfo;
13
13
 
14
14
  const dynamicRes = await got(`${baseUrl}/api/post/get-list`, {
15
15
  searchParams: {
@@ -29,6 +29,7 @@ module.exports = async (ctx) => {
29
29
  ctx.state.data = {
30
30
  title: `${name}的爱发电动态`,
31
31
  description: `${name}的爱发电动态`,
32
+ image: avatar,
32
33
  link: `${baseUrl}/@${url_slug}`,
33
34
  item: list,
34
35
  };
@@ -17,6 +17,7 @@ module.exports = async (ctx) => {
17
17
  ctx.state.data = {
18
18
  title: `${name} 的 bilibili 专栏`,
19
19
  link: `https://space.bilibili.com/${uid}/#/article`,
20
+ image: data.articles && data.articles[0].author.face,
20
21
  description: `${name} 的 bilibili 专栏`,
21
22
  item:
22
23
  data.articles &&
@@ -81,6 +81,7 @@ module.exports = async (ctx) => {
81
81
  title: `${data[0].desc.user_profile.info.uname} 的 bilibili 动态`,
82
82
  link: `https://space.bilibili.com/${uid}/dynamic`,
83
83
  description: `${data[0].desc.user_profile.info.uname} 的 bilibili 动态`,
84
+ image: data[0].desc.user_profile.info.face,
84
85
  item: data.map((item) => {
85
86
  const getTitle = (data) => (data ? data.title || data.description || data.content || (data.vest && data.vest.content) || '' : '');
86
87
  const getDes = (data) =>
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
6
6
  const data = response.data;
7
7
  const $ = cheerio.load(data);
8
8
 
9
- const app_name = $('.package-title').find('h3').text();
9
+ const app_name = $('.package-title').find('h3').text().trim();
10
10
  const app_descr = $('.package-title').find('.package-summary').text();
11
11
 
12
12
  const items = [];
@@ -1,4 +1,6 @@
1
1
  const got = require('@/utils/got');
2
+ const { parseDate } = require('@/utils/parse-date');
3
+ const timezone = require('@/utils/timezone');
2
4
 
3
5
  const title = {
4
6
  recommend: '精选',
@@ -51,16 +53,28 @@ module.exports = async (ctx) => {
51
53
  break;
52
54
 
53
55
  default:
54
- items = response.data.data[caty].map((item) => ({
55
- title: item.title,
56
- link: item.jump_url,
57
- author: item.author_name,
58
- description: `<img src="${item.big_pic}"><p>${item.summary}</p>`,
59
- enclosure_url: item.media_url,
60
- enclosure_length: item.media_size,
61
- enclosure_type: 'audio/mpeg',
62
- pubDate: new Date(item.created_at * 1000).toUTCString(),
63
- }));
56
+ items = response.data.data[caty].map((item) => {
57
+ let timeArray = item.media_time && item.media_time.trim().split(/\D+/, 3);
58
+ timeArray = timeArray && timeArray.filter((item) => item !== '');
59
+ let itunes_duration;
60
+ if (timeArray) {
61
+ itunes_duration = 0;
62
+ itunes_duration += timeArray.length >= 1 ? parseInt(timeArray.slice(-1)) : 0;
63
+ itunes_duration += timeArray.length >= 2 ? parseInt(timeArray.slice(-2)) * 60 : 0;
64
+ itunes_duration += timeArray.length >= 3 ? parseInt(timeArray.slice(-3)) * 60 * 60 : 0;
65
+ }
66
+ return {
67
+ title: item.title,
68
+ link: item.jump_url,
69
+ author: item.author_name,
70
+ description: `<img src="${item.big_pic}"><p>${item.summary}</p>`,
71
+ enclosure_url: item.media_url,
72
+ enclosure_length: item.media_size,
73
+ itunes_duration,
74
+ enclosure_type: 'audio/mpeg',
75
+ pubDate: isNaN(+item.created_at) ? timezone(parseDate(item.created_at), +8) : parseDate(item.created_at * 1000),
76
+ };
77
+ });
64
78
  }
65
79
 
66
80
  ctx.state.data = {
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
21
21
  item = $(item);
22
22
  return {
23
23
  title: item.find('img').attr('alt'),
24
- description: '<img src="' + item.find('img').attr('src') + '">',
24
+ description: '<img src="' + item.find('img').attr('data-src') + '">',
25
25
  pubDate: item.find('.data span').text(),
26
26
  guid: new Date(item.find('.data span').text()),
27
27
  link: item.find('a').attr('href'),
@@ -18,7 +18,7 @@ module.exports = async (ctx) => {
18
18
  const list = response.data.audios.map((item) => ({
19
19
  title: item.name,
20
20
  enclosure_url: item.url,
21
- enclosure_length: item.duration,
21
+ itunes_duration: item.duration,
22
22
  enclosure_type: 'audio/mpeg',
23
23
  link: `https://www.lizhi.fm/${$('div.user_info div.desc span').eq(0).text().replace('FM ', '')}/${item.id}`,
24
24
  pubDate: new Date(item.create_time).toUTCString(),
@@ -17,7 +17,7 @@ module.exports = async (ctx) => {
17
17
  return {
18
18
  title: item.name,
19
19
  enclosure_url: soundData.soundurl,
20
- enclosure_length: soundData.duration,
20
+ itunes_duration: ~~(soundData.duration / 1000),
21
21
  enclosure_type: 'audio/mpeg',
22
22
  image: dramaResp.data.info.drama.cover,
23
23
  itunes_author: soundData.username,
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
24
24
  return {
25
25
  title: item.name + (item.integrity === 3 ? '(已完结)' : '(更新至 ' + item.newest + ')'),
26
26
  enclosure_url: soundData.soundurl,
27
- enclosure_length: soundData.duration,
27
+ itunes_duration: ~~(soundData.duration / 1000),
28
28
  enclosure_type: 'audio/mpeg',
29
29
  image: item.cover,
30
30
  itunes_author: soundData.username,
@@ -38,12 +38,12 @@ module.exports = async (ctx) => {
38
38
  const list = programs.map((pg) => {
39
39
  const description = (pg.description || '').split('\n').map((p) => p);
40
40
  const duration = ~~(pg.duration / 1000);
41
- const itunes_duration = `${(duration / 60).toFixed(0).padStart(2, '0')}:${(duration % 60).toFixed(0).padStart(2, '0')}`;
41
+ const mm_ss_duration = `${(duration / 60).toFixed(0).padStart(2, '0')}:${(duration % 60).toFixed(0).padStart(2, '0')}`;
42
42
 
43
43
  const html = art(path.join(__dirname, 'templates/djradio-content.art'), {
44
44
  pg,
45
45
  description,
46
- itunes_duration,
46
+ itunes_duration: mm_ss_duration,
47
47
  });
48
48
 
49
49
  return {
@@ -56,9 +56,8 @@ module.exports = async (ctx) => {
56
56
  content: { html },
57
57
  itunes_item_image: pg.coverUrl,
58
58
  enclosure_url: `https://music.163.com/song/media/outer/url?id=${pg.mainTrackId}.mp3`,
59
- enclosure_length: duration,
60
59
  enclosure_type: 'audio/mpeg',
61
- itunes_duration,
60
+ itunes_duration: duration,
62
61
  };
63
62
  });
64
63
  return list;
@@ -91,7 +91,7 @@ const parseSimpleDetail = ($ele) => {
91
91
  const link = resolve('https://nhentai.net', $ele.attr('href'));
92
92
  const thumb = $ele.children('img');
93
93
  const thumbSrc = thumb.attr('data-src') || thumb.attr('src');
94
- const highResoThumbSrc = thumbSrc.replace('thumb', '1').replace('t.nhentai.net', 'i.nhentai.net');
94
+ const highResoThumbSrc = thumbSrc.replace('thumb', '1').replace(/t\d+\.nhentai\.net/, 'i.nhentai.net');
95
95
  return {
96
96
  title: $ele.children('.caption').text(),
97
97
  link,
@@ -121,7 +121,7 @@ const getDetail = async (simple) => {
121
121
  .map((_, ele) => resolve('https://nhentai.net', $(ele).attr('data-src')))
122
122
  .get()
123
123
  .map((src) => src.replace(/(.+)(\d+)t\.(.+)/, (_, p1, p2, p3) => `${p1}${p2}.${p3}`)) // thumb to high-quality
124
- .map((src) => src.replace('t.nhentai.net', 'i.nhentai.net'));
124
+ .map((src) => src.replace(/t\d+\.nhentai\.net/, 'i.nhentai.net'));
125
125
 
126
126
  const renderImg = (src) => `<img src="${src}" /><br />`;
127
127
  return {
@@ -31,7 +31,7 @@ module.exports = async (ctx) => {
31
31
  guid: item.id,
32
32
  itunes_item_image: 'http://www.radio.cn/pc-portal/image/icon_32.jpg',
33
33
  enclosure_url: 'http://' + item.stream_domain1 + item.stream_url1,
34
- enclosure_length: item.resource_length,
34
+ itunes_duration: item.resource_length,
35
35
  enclosure_type: 'audio/x-m4a',
36
36
  };
37
37
  return single;
@@ -1,8 +1,13 @@
1
1
  const got = require('@/utils/got');
2
2
  const cheerio = require('cheerio');
3
+ const { parseDate } = require('@/utils/parse-date');
3
4
 
4
5
  module.exports = async (ctx) => {
5
- const response = await got.get(`https://feed.mix.sina.com.cn/api/roll/get?pageid=372&lid=2431&k=&num=50&page=1&r=${Math.random()}&callback=&_=${new Date().getTime()}`);
6
+ const response = await got(`https://feed.mix.sina.com.cn/api/roll/get?pageid=372&lid=2431&k=&num=50&page=1&r=${Math.random()}&callback=&_=${new Date().getTime()}`, {
7
+ headers: {
8
+ Referer: 'https://tech.sina.com.cn/',
9
+ },
10
+ });
6
11
  const list = response.data.result.data;
7
12
 
8
13
  const out = await Promise.all(
@@ -22,9 +27,9 @@ module.exports = async (ctx) => {
22
27
  title,
23
28
  link,
24
29
  description,
25
- pubDate: new Date(date).toUTCString(),
30
+ pubDate: parseDate(date),
26
31
  };
27
- return Promise.resolve(single);
32
+ return single;
28
33
  })
29
34
  );
30
35
 
@@ -143,7 +143,13 @@ module.exports = async (ctx) => {
143
143
  }
144
144
 
145
145
  // 修复文字格式错误
146
- single.description = single.description.replace(/<section(.*?)>/g, '<p $1/>');
146
+ single.description = single.description
147
+ .replace(/(<strong.*?>)(.*?)(<\/strong>)/g, '$1<span style="font-size: 16px; line-height: 16px;">$2</span>$3')
148
+ .replace(/<section(.*?)>(.*?)<\/section>/g, '<p $1>$2</p>')
149
+ .replace(/(<p.*?>)(.*?)(<\/p>)/g, '$1<span style="font-size: 16px; line-height: 16px;">$2</span>$3')
150
+ .replace(/<p.*?data-encc.*?>.*?<\/p>/g, '')
151
+ .replace(/<h\d(.*?)>(.*?)<\/h\d>/g, '<p $1>$2</p>')
152
+ .replace(/<br.*?>/g, '');
147
153
 
148
154
  return single;
149
155
  })