rsshub 1.0.0-master.f455f54 → 1.0.0-master.f45bc34

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 (294) hide show
  1. package/lib/assets/logo.svg +1 -0
  2. package/lib/config.ts +12 -0
  3. package/lib/errors/index.test.ts +15 -5
  4. package/lib/errors/index.tsx +1 -1
  5. package/lib/errors/types/captcha.ts +5 -0
  6. package/lib/middleware/parameter.ts +1 -1
  7. package/lib/registry.ts +3 -3
  8. package/lib/routes/163/news/rank.ts +1 -1
  9. package/lib/routes/51cto/utils.ts +1 -1
  10. package/lib/routes/6park/index.ts +1 -1
  11. package/lib/routes/6v123/index.ts +488 -0
  12. package/lib/routes/6v123/namespace.ts +1 -0
  13. package/lib/routes/aa1/60s.ts +189 -0
  14. package/lib/routes/{xinhuanet → aa1}/namespace.ts +3 -3
  15. package/lib/routes/abc/index.ts +1 -1
  16. package/lib/routes/acgvinyl/namespace.ts +6 -0
  17. package/lib/routes/acgvinyl/news.ts +86 -0
  18. package/lib/routes/ally/rail.ts +1 -1
  19. package/lib/routes/anthropic/news.ts +13 -11
  20. package/lib/routes/apnews/mobile-api.ts +1 -1
  21. package/lib/routes/apnews/sitemap.ts +1 -1
  22. package/lib/routes/apple/apps.ts +2 -2
  23. package/lib/routes/apple/podcast.ts +58 -25
  24. package/lib/routes/aqara/post.ts +1 -1
  25. package/lib/routes/bangumi.tv/group/reply.ts +1 -1
  26. package/lib/routes/banshujiang/index.ts +763 -0
  27. package/lib/routes/banshujiang/namespace.ts +9 -0
  28. package/lib/routes/banshujiang/templates/description.art +17 -0
  29. package/lib/routes/bestofjs/monthly.ts +137 -0
  30. package/lib/routes/bestofjs/namespace.ts +11 -0
  31. package/lib/routes/bestofjs/templates/description.art +36 -0
  32. package/lib/routes/bfl/announcements.ts +1 -1
  33. package/lib/routes/bilibili/cache.ts +97 -3
  34. package/lib/routes/bilibili/dynamic.ts +52 -12
  35. package/lib/routes/bilibili/page.ts +1 -1
  36. package/lib/routes/bilibili/ranking.ts +23 -17
  37. package/lib/routes/bilibili/video.ts +35 -74
  38. package/lib/routes/bilibili/wasm-exec.ts +1 -1
  39. package/lib/routes/bilibili/weekly-recommend.ts +22 -6
  40. package/lib/routes/bjp/apod.ts +1 -1
  41. package/lib/routes/bnext/index.ts +58 -0
  42. package/lib/routes/bnext/namespace.ts +7 -0
  43. package/lib/routes/bookwalker/namespace.ts +9 -0
  44. package/lib/routes/bookwalker/search.ts +115 -0
  45. package/lib/routes/bookwalker/templates/description.art +13 -0
  46. package/lib/routes/buaa/jiaowu.ts +1 -1
  47. package/lib/routes/bullionvault/gold-news.ts +3 -3
  48. package/lib/routes/cast/index.ts +1 -1
  49. package/lib/routes/cbndata/information.ts +250 -0
  50. package/lib/routes/cbndata/namespace.ts +9 -0
  51. package/lib/routes/cbndata/templates/description.art +17 -0
  52. package/lib/routes/ccg/index.ts +181 -0
  53. package/lib/routes/ccg/namespace.ts +9 -0
  54. package/lib/routes/ccg/templates/description.art +21 -0
  55. package/lib/routes/cline/blog.ts +34 -23
  56. package/lib/routes/commonhealth/index.ts +70 -0
  57. package/lib/routes/commonhealth/namespace.ts +7 -0
  58. package/lib/routes/commonhealth/templates/description.art +2 -0
  59. package/lib/routes/cool18/index.ts +1 -1
  60. package/lib/routes/coolapk/utils.ts +5 -4
  61. package/lib/routes/coolbuy/index.ts +106 -0
  62. package/lib/routes/coolbuy/namespace.ts +9 -0
  63. package/lib/routes/coolbuy/templates/description.art +48 -0
  64. package/lib/routes/coolidge/film-guide.ts +60 -0
  65. package/lib/routes/coolidge/namespace.ts +7 -0
  66. package/lib/routes/coolidge/news.ts +65 -0
  67. package/lib/routes/coolidge/templates/description.art +4 -0
  68. package/lib/routes/coomer/index.ts +11 -8
  69. package/lib/routes/copymanga/comic.ts +1 -1
  70. package/lib/routes/cpta/handler.ts +1 -1
  71. package/lib/routes/creative-comic/book.ts +1 -1
  72. package/lib/routes/daum/potplayer.ts +1 -1
  73. package/lib/routes/dealstreetasia/home.ts +1 -1
  74. package/lib/routes/dedao/index.ts +3 -3
  75. package/lib/routes/dgut/jwb.ts +73 -0
  76. package/lib/routes/dgut/namespace.ts +9 -0
  77. package/lib/routes/digitalpolicyalert/activity-tracker.ts +135 -0
  78. package/lib/routes/digitalpolicyalert/namespace.ts +9 -0
  79. package/lib/routes/dockerhub/utils.ts +1 -1
  80. package/lib/routes/dora-world/article.ts +2 -2
  81. package/lib/routes/e-hentai/index.ts +1 -1
  82. package/lib/routes/ehentai/ehapi.ts +3 -3
  83. package/lib/routes/elecfans/article.ts +64 -0
  84. package/lib/routes/elecfans/namespace.ts +7 -0
  85. package/lib/routes/elecfans/soft.ts +69 -0
  86. package/lib/routes/engineering/namespace.ts +8 -0
  87. package/lib/routes/engineering/tag.ts +55 -0
  88. package/lib/routes/englishhome/index.ts +55 -0
  89. package/lib/routes/englishhome/namespace.ts +6 -0
  90. package/lib/routes/epicgames/index.ts +2 -2
  91. package/lib/routes/espn/news.ts +1 -1
  92. package/lib/routes/eventbrite/events.ts +152 -0
  93. package/lib/routes/eventbrite/namespace.ts +7 -0
  94. package/lib/routes/eventernote/actors.ts +61 -64
  95. package/lib/routes/fantia/search.ts +1 -1
  96. package/lib/routes/follow/profile.ts +1 -1
  97. package/lib/routes/followin/news.ts +1 -1
  98. package/lib/routes/foresightnews/util.ts +1 -1
  99. package/lib/routes/gamer/gnn-index.ts +8 -3
  100. package/lib/routes/gamer/hot.ts +5 -5
  101. package/lib/routes/github/activity.ts +1 -1
  102. package/lib/routes/gitstar-ranking/index.ts +150 -0
  103. package/lib/routes/gitstar-ranking/namespace.ts +9 -0
  104. package/lib/routes/gitstar-ranking/templates/description.art +38 -0
  105. package/lib/routes/gov/beijing/bphc/index.ts +1 -1
  106. package/lib/routes/gov/ccdi/index.ts +1 -1
  107. package/lib/routes/gov/general/general.ts +1 -1
  108. package/lib/routes/gov/mem/namespace.ts +7 -0
  109. package/lib/routes/gov/mem/zfxxgkpt.ts +96 -0
  110. package/lib/routes/gov/mot/index.ts +158 -53
  111. package/lib/routes/hameln/chapter.ts +1 -1
  112. package/lib/routes/hellogithub/report.ts +1 -1
  113. package/lib/routes/hostmonit/cloudflareyes.ts +1 -1
  114. package/lib/routes/hpoi/banner-item.ts +28 -11
  115. package/lib/routes/hpoi/info.ts +1 -1
  116. package/lib/routes/hudsonrivertrading/index.ts +122 -0
  117. package/lib/routes/hudsonrivertrading/namespace.ts +7 -0
  118. package/lib/routes/huggingface/daily-papers.ts +45 -9
  119. package/lib/routes/hust/gs.ts +1 -1
  120. package/lib/routes/hust/mse.ts +1 -1
  121. package/lib/routes/huxiu/util.ts +2 -2
  122. package/lib/routes/hypergryph/arknights/announce.ts +1 -1
  123. package/lib/routes/immich/cursed-knowledge.ts +49 -0
  124. package/lib/routes/immich/namespace.ts +7 -0
  125. package/lib/routes/infoq/presentations.ts +1 -1
  126. package/lib/routes/instagram/common-utils.ts +3 -3
  127. package/lib/routes/japanpost/utils.ts +2 -2
  128. package/lib/routes/javbus/index.ts +1 -1
  129. package/lib/routes/javlibrary/utils.ts +1 -1
  130. package/lib/routes/jbma/namespace.ts +17 -0
  131. package/lib/routes/jbma/report.ts +473 -0
  132. package/lib/routes/jetbrains/comments.ts +1 -1
  133. package/lib/routes/jimmyspa/books.ts +1 -1
  134. package/lib/routes/jimmyspa/news.ts +1 -1
  135. package/lib/routes/jingzhengu/utils.ts +1 -1
  136. package/lib/routes/juejin/aicoding.ts +102 -0
  137. package/lib/routes/juejin/trending.ts +70 -20
  138. package/lib/routes/juejin/utils.ts +36 -51
  139. package/lib/routes/kakuyomu/works.ts +1 -1
  140. package/lib/routes/kemono/index.ts +16 -8
  141. package/lib/routes/kemono/templates/discord.art +1 -1
  142. package/lib/routes/komiic/comic.ts +1 -1
  143. package/lib/routes/koyso/index.ts +338 -0
  144. package/lib/routes/koyso/namespace.ts +9 -0
  145. package/lib/routes/koyso/templates/description.art +13 -0
  146. package/lib/routes/line/utils.ts +1 -1
  147. package/lib/routes/lovelive-anime/topics.ts +5 -6
  148. package/lib/routes/maccms/index.ts +1 -1
  149. package/lib/routes/mercari/util.ts +1 -1
  150. package/lib/routes/meteoblue/namespace.ts +8 -0
  151. package/lib/routes/meteoblue/weathernews.ts +75 -0
  152. package/lib/routes/meteor/index.ts +1 -1
  153. package/lib/routes/mihoyo/sr/news.ts +2 -1
  154. package/lib/routes/mihoyo/zzz/news.ts +107 -0
  155. package/lib/routes/mingpao/index.ts +1 -1
  156. package/lib/routes/mit/hanlab.ts +61 -0
  157. package/lib/routes/mit/namespace.ts +6 -0
  158. package/lib/routes/mittrchina/index.ts +3 -3
  159. package/lib/routes/modelscope/learn.ts +94 -0
  160. package/lib/routes/moodysmismicrosite/report.ts +1 -1
  161. package/lib/routes/nankai/ai-notice.ts +142 -0
  162. package/lib/routes/natgeo/natgeo.ts +2 -2
  163. package/lib/routes/neu/yz.ts +172 -0
  164. package/lib/routes/nhk/news-web-easy.ts +1 -1
  165. package/lib/routes/nicovideo/mylist.ts +39 -0
  166. package/lib/routes/nicovideo/types.ts +27 -0
  167. package/lib/routes/nicovideo/utils.ts +27 -1
  168. package/lib/routes/nikkei/cn/index.ts +1 -4
  169. package/lib/routes/nio/namespace.ts +9 -0
  170. package/lib/routes/nio/nioradio.ts +75 -0
  171. package/lib/routes/now/news.ts +1 -1
  172. package/lib/routes/nytimes/index.ts +1 -1
  173. package/lib/routes/oilchem/index.ts +1 -1
  174. package/lib/routes/oncc/money18.ts +1 -1
  175. package/lib/routes/picuki/profile.ts +13 -5
  176. package/lib/routes/pixiv/novel-api/user-novels/sfw.ts +1 -1
  177. package/lib/routes/pixivision/utils.ts +1 -1
  178. package/lib/routes/pku/hr.ts +1 -1
  179. package/lib/routes/pku/scc/recruit.ts +1 -1
  180. package/lib/routes/pornhub/model.ts +2 -7
  181. package/lib/routes/pornhub/pornstar.ts +2 -7
  182. package/lib/routes/pornhub/users.ts +2 -7
  183. package/lib/routes/pornhub/utils.ts +12 -1
  184. package/lib/routes/ps/trophy.ts +1 -1
  185. package/lib/routes/pubscholar/utils.ts +14 -1
  186. package/lib/routes/questmobile/report.ts +1 -1
  187. package/lib/routes/qweather/3days.ts +14 -14
  188. package/lib/routes/qweather/now.ts +12 -10
  189. package/lib/routes/qweather/util.tsx +89 -0
  190. package/lib/routes/radio-canada/latest.ts +30 -17
  191. package/lib/routes/ruc/ai.ts +1 -1
  192. package/lib/routes/ruc/hr.ts +1 -1
  193. package/lib/routes/samrdprc/index.ts +241 -0
  194. package/lib/routes/samrdprc/namespace.ts +1 -1
  195. package/lib/routes/scpta/namespace.ts +8 -0
  196. package/lib/routes/scpta/news.ts +101 -0
  197. package/lib/routes/sdo/ff14risingstones/api.ts +78 -0
  198. package/lib/routes/sdo/ff14risingstones/constant.ts +338 -0
  199. package/lib/routes/sdo/ff14risingstones/posts.ts +80 -0
  200. package/lib/routes/sdo/ff14risingstones/strats.ts +75 -0
  201. package/lib/routes/sdo/ff14risingstones/templates/duties-party.art +41 -0
  202. package/lib/routes/sdo/ff14risingstones/templates/fc-party.art +26 -0
  203. package/lib/routes/sdo/ff14risingstones/templates/novice-network-party.art +9 -0
  204. package/lib/routes/sdo/ff14risingstones/templates/rp-party.art +15 -0
  205. package/lib/routes/sdo/ff14risingstones/timeline.ts +31 -0
  206. package/lib/routes/sdo/ff14risingstones/types/dynamic.ts +50 -0
  207. package/lib/routes/sdo/ff14risingstones/types/index.ts +3 -0
  208. package/lib/routes/sdo/ff14risingstones/types/other.ts +57 -0
  209. package/lib/routes/sdo/ff14risingstones/types/party.ts +111 -0
  210. package/lib/routes/sdo/ff14risingstones/user-dynamics.ts +32 -0
  211. package/lib/routes/sdo/ff14risingstones/user-posts.ts +32 -0
  212. package/lib/routes/sdo/ff14risingstones/user-resently.ts +38 -0
  213. package/lib/routes/sdo/ff14risingstones/user-strats.ts +32 -0
  214. package/lib/routes/sdo/ff14risingstones/utils.ts +215 -0
  215. package/lib/routes/sdo/namespace.ts +7 -0
  216. package/lib/routes/secretsanfrancisco/namespace.ts +7 -0
  217. package/lib/routes/secretsanfrancisco/rss.ts +101 -0
  218. package/lib/routes/secretsanfrancisco/templates/description.art +9 -0
  219. package/lib/routes/seekingalpha/index.ts +1 -1
  220. package/lib/routes/setn/index.ts +11 -2
  221. package/lib/routes/showstart/utils.ts +1 -1
  222. package/lib/routes/shu/global.ts +6 -5
  223. package/lib/routes/shu/xxgk.ts +107 -0
  224. package/lib/routes/sketis/isabelle-dev/blog/index.ts +1 -1
  225. package/lib/routes/sohu/mp.ts +18 -7
  226. package/lib/routes/sotwe/user.ts +1 -1
  227. package/lib/routes/spglobal/ratings.ts +1 -1
  228. package/lib/routes/sustainabilitymag/articles.ts +1 -1
  229. package/lib/routes/syosetu/dev.ts +1 -1
  230. package/lib/routes/syosetu/ranking-isekai.ts +1 -1
  231. package/lib/routes/szse/disclosure/listed-notice.ts +44 -6
  232. package/lib/routes/techpowerup/index.ts +11 -11
  233. package/lib/routes/techpowerup/namespace.ts +1 -1
  234. package/lib/routes/techpowerup/review.ts +12 -12
  235. package/lib/routes/techpowerup/utils.ts +2 -2
  236. package/lib/routes/telegram/channel.ts +1 -1
  237. package/lib/routes/tesla/cx.ts +2 -2
  238. package/lib/routes/test/index.ts +5 -1
  239. package/lib/routes/thegadgetflow/namespace.ts +7 -0
  240. package/lib/routes/thegadgetflow/rss.ts +99 -0
  241. package/lib/routes/thegadgetflow/templates/description.art +9 -0
  242. package/lib/routes/theverge/index.ts +20 -6
  243. package/lib/routes/thewirehindi/category.ts +78 -0
  244. package/lib/routes/thewirehindi/index.ts +43 -0
  245. package/lib/routes/thewirehindi/namespace.ts +7 -0
  246. package/lib/routes/thewirehindi/templates/description.art +9 -0
  247. package/lib/routes/thewirehindi/utils.ts +33 -0
  248. package/lib/routes/threads/utils.ts +9 -5
  249. package/lib/routes/tidb/blog.ts +314 -0
  250. package/lib/routes/tidb/namespace.ts +9 -0
  251. package/lib/routes/toutiao/user.ts +2 -2
  252. package/lib/routes/trendforce/namespace.ts +9 -0
  253. package/lib/routes/trendforce/new.ts +113 -0
  254. package/lib/routes/twitter/api/mobile-api/api.ts +1 -1
  255. package/lib/routes/twitter/utils.ts +6 -6
  256. package/lib/routes/txrjy/fornumtopic.ts +2 -2
  257. package/lib/routes/typst/universe.ts +1 -1
  258. package/lib/routes/uber/blog.ts +87 -46
  259. package/lib/routes/weibo/utils.ts +17 -9
  260. package/lib/routes/whu/swrh.ts +1 -1
  261. package/lib/routes/xiaohongshu/user.ts +2 -2
  262. package/lib/routes/xiaohongshu/util.ts +16 -9
  263. package/lib/routes/xiaoyuzhou/pickup.ts +1 -1
  264. package/lib/routes/xjtu/ee-jzxx.ts +1 -1
  265. package/lib/routes/xwenming/index.ts +184 -0
  266. package/lib/routes/xwenming/namespace.ts +9 -0
  267. package/lib/routes/yahoo/news/utils.ts +1 -1
  268. package/lib/routes/ymgal/article.ts +1 -1
  269. package/lib/routes/yoasobi-music/media.ts +1 -1
  270. package/lib/routes/youtube/api/youtubei.ts +10 -4
  271. package/lib/routes/youtube/community.ts +4 -4
  272. package/lib/routes/youtube/utils.ts +1 -1
  273. package/lib/routes/zaker/utils.ts +1 -1
  274. package/lib/routes/zaobao/interactive.ts +18 -7
  275. package/lib/routes/zaobao/other.ts +3 -2
  276. package/lib/routes/zaobao/realtime.ts +3 -2
  277. package/lib/routes/zaobao/util.tsx +185 -0
  278. package/lib/routes/zaobao/zaobao.tsx +23 -0
  279. package/lib/routes/zaobao/znews.ts +3 -2
  280. package/lib/routes/zhizhuan100/namespace.ts +7 -0
  281. package/lib/routes/zhizhuan100/report.ts +79 -0
  282. package/lib/routes/zju/sis/index.ts +161 -0
  283. package/lib/server.ts +5 -0
  284. package/lib/utils/logger.ts +1 -1
  285. package/lib/utils/puppeteer-utils.test.ts +5 -5
  286. package/lib/utils/puppeteer.test.ts +1 -1
  287. package/lib/views/index.tsx +4 -4
  288. package/package.json +51 -50
  289. package/lib/routes/picuki/utils.ts +0 -19
  290. package/lib/routes/qweather/templates/3days.art +0 -22
  291. package/lib/routes/qweather/templates/now.art +0 -16
  292. package/lib/routes/xinhuanet/app.ts +0 -109
  293. package/lib/routes/zaobao/templates/zaobao.art +0 -17
  294. package/lib/routes/zaobao/util.ts +0 -198
@@ -0,0 +1 @@
1
+ <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>RSSHub</title><rect width="24" height="24" fill="#ffd6a6" rx="7.636"/><path fill="#ff8549" d="M.142 6.16Q.002 6.875 0 7.635v8.728A7.636 7.636 0 0 0 7.636 24h8.728a7.7 7.7 0 0 0 1.477-.142 13.26 13.26 0 0 0 1.25-5.64c0-7.35-5.959-13.309-13.31-13.309a13.25 13.25 0 0 0-5.64 1.25"/><circle cx="5.727" cy="18.273" r="4.964" fill="#ff2900"/></svg>
package/lib/config.ts CHANGED
@@ -102,6 +102,7 @@ export type Config = {
102
102
  cookies: Record<string, string | undefined>;
103
103
  dmImgList?: string;
104
104
  dmImgInter?: string;
105
+ excludeSubtitles?: boolean;
105
106
  };
106
107
  bitbucket: {
107
108
  username?: string;
@@ -186,6 +187,7 @@ export type Config = {
186
187
  };
187
188
  hefeng: {
188
189
  key?: string;
190
+ apiHost?: string;
189
191
  };
190
192
  infzm: {
191
193
  cookie?: string;
@@ -324,6 +326,10 @@ export type Config = {
324
326
  scihub: {
325
327
  host?: string;
326
328
  };
329
+ sdo: {
330
+ ff14risingstones?: string;
331
+ ua?: string;
332
+ };
327
333
  sis001: {
328
334
  baseUrl?: string;
329
335
  };
@@ -573,6 +579,7 @@ const calculateValue = () => {
573
579
  cookies: bilibili_cookies,
574
580
  dmImgList: envs.BILIBILI_DM_IMG_LIST,
575
581
  dmImgInter: envs.BILIBILI_DM_IMG_INTER,
582
+ excludeSubtitles: toBoolean(envs.BILIBILI_EXCLUDE_SUBTITLES, false),
576
583
  },
577
584
  bitbucket: {
578
585
  username: envs.BITBUCKET_USERNAME,
@@ -657,6 +664,7 @@ const calculateValue = () => {
657
664
  },
658
665
  hefeng: {
659
666
  key: envs.HEFENG_KEY,
667
+ apiHost: envs.HEFENG_API_HOST,
660
668
  },
661
669
  infzm: {
662
670
  cookie: envs.INFZM_COOKIE,
@@ -795,6 +803,10 @@ const calculateValue = () => {
795
803
  scihub: {
796
804
  host: envs.SCIHUB_HOST || 'https://sci-hub.se/',
797
805
  },
806
+ sdo: {
807
+ ff14risingstones: envs.SDO_FF14RISINGSTONES,
808
+ ua: envs.SDO_UA,
809
+ },
798
810
  sis001: {
799
811
  baseUrl: envs.SIS001_BASE_URL || 'https://sis001.com',
800
812
  },
@@ -55,6 +55,14 @@ describe('invalid-parameter-error', () => {
55
55
  }, 20000);
56
56
  });
57
57
 
58
+ describe('captcha-error', () => {
59
+ it(`captcha-error`, async () => {
60
+ const response = await request.get('/test/captcha-error');
61
+ expect(response.status).toBe(503);
62
+ expect(response.text).toMatch('CaptchaError: Test captcha error');
63
+ }, 20000);
64
+ });
65
+
58
66
  describe('route throws an error', () => {
59
67
  it('route path error should have path mounted', async () => {
60
68
  await request.get('/test/error');
@@ -67,19 +75,21 @@ describe('route throws an error', () => {
67
75
  const value = $(item).find('.debug-value').html()?.trim();
68
76
  switch (key) {
69
77
  case 'Request Amount:':
70
- expect(value).toBe('11');
78
+ expect(value).toBe('12');
71
79
  break;
72
80
  case 'Hot Routes:':
73
- expect(value).toBe('8 /test/:id/:params?<br>');
81
+ expect(value).toBe('9 /test/:id/:params?<br>');
74
82
  break;
75
83
  case 'Hot Paths:':
76
- expect(value).toBe('2 /test/error<br>2 /test/slow<br>2 /test/slow4<br>1 /test/httperror<br>1 /test/config-not-found-error<br>1 /test/invalid-parameter-error<br>1 /thisDoesNotExist<br>1 /<br>');
84
+ expect(value).toBe(
85
+ '2 /test/error<br>2 /test/slow<br>2 /test/slow4<br>1 /test/httperror<br>1 /test/config-not-found-error<br>1 /test/invalid-parameter-error<br>1 /test/captcha-error<br>1 /thisDoesNotExist<br>1 /<br>'
86
+ );
77
87
  break;
78
88
  case 'Hot Error Routes:':
79
- expect(value).toBe('5 /test/:id/:params?<br>');
89
+ expect(value).toBe('6 /test/:id/:params?<br>');
80
90
  break;
81
91
  case 'Hot Error Paths:':
82
- expect(value).toBe('2 /test/error<br>1 /test/httperror<br>1 /test/slow4<br>1 /test/config-not-found-error<br>1 /test/invalid-parameter-error<br>1 /thisDoesNotExist<br>');
92
+ expect(value).toBe('2 /test/error<br>1 /test/httperror<br>1 /test/slow4<br>1 /test/config-not-found-error<br>1 /test/invalid-parameter-error<br>1 /test/captcha-error<br>1 /thisDoesNotExist<br>');
83
93
  break;
84
94
  default:
85
95
  }
@@ -43,7 +43,7 @@ export const errorHandler: ErrorHandler = (error, ctx) => {
43
43
  });
44
44
  }
45
45
 
46
- let errorMessage = process.env.NODE_ENV === 'production' ? error.message : error.stack || error.message;
46
+ let errorMessage = (process.env.NODE_ENV || process.env.VERCEL_ENV) === 'production' ? error.message : error.stack || error.message;
47
47
  switch (error.constructor.name) {
48
48
  case 'HTTPError':
49
49
  case 'RequestError':
@@ -0,0 +1,5 @@
1
+ class CaptchaError extends Error {
2
+ name = 'CaptchaError';
3
+ }
4
+
5
+ export default CaptchaError;
@@ -80,7 +80,7 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
80
80
 
81
81
  // sort items
82
82
  if (ctx.req.query('sorted') !== 'false') {
83
- data.item = data.item.sort((a: DataItem, b: DataItem) => +new Date(b.pubDate || 0) - +new Date(a.pubDate || 0));
83
+ data.item = data.item.toSorted((a: DataItem, b: DataItem) => +new Date(b.pubDate || 0) - +new Date(a.pubDate || 0));
84
84
  }
85
85
 
86
86
  const handleItem = (item: DataItem) => {
package/lib/registry.ts CHANGED
@@ -53,7 +53,7 @@ export type NamespacesType = Record<
53
53
 
54
54
  let namespaces: NamespacesType = {};
55
55
 
56
- switch (process.env.NODE_ENV) {
56
+ switch (process.env.NODE_ENV || process.env.VERCEL_ENV) {
57
57
  case 'production':
58
58
  namespaces = (await import('../assets/build/routes.js')).default;
59
59
  break;
@@ -155,7 +155,7 @@ const sortRoutes = (
155
155
  }
156
156
  >
157
157
  ) =>
158
- Object.entries(routes).sort(([pathA], [pathB]) => {
158
+ Object.entries(routes).toSorted(([pathA], [pathB]) => {
159
159
  const segmentsA = pathA.split('/');
160
160
  const segmentsB = pathB.split('/');
161
161
  const lenA = segmentsA.length;
@@ -251,7 +251,7 @@ if (config.debugInfo) {
251
251
  app.use(
252
252
  '/*',
253
253
  serveStatic({
254
- root: './lib/assets',
254
+ root: path.join(__dirname, 'assets'),
255
255
  rewriteRequestPath: (path) => (path === '/favicon.ico' ? '/favicon.png' : path),
256
256
  })
257
257
  );
@@ -135,7 +135,7 @@ async function handler(ctx) {
135
135
  const $ = load(iconv.decode(response.data, 'gbk'));
136
136
 
137
137
  const list = $('div.tabContents')
138
- .eq(timeRange[time].index + (category === 'whole' ? (type === 'click' ? -1 : 2) : (type === 'click' ? 0 : 2)))
138
+ .eq(timeRange[time].index + (category === 'whole' ? (type === 'click' ? -1 : 2) : type === 'click' ? 0 : 2))
139
139
  .find('table tbody tr td a')
140
140
  .toArray()
141
141
  .map((item) => {
@@ -16,6 +16,6 @@ export const getToken = () =>
16
16
  export const sign = (requestPath: string, payload: Record<string, any> = {}, timestamp: number, token: string) => {
17
17
  payload.timestamp = timestamp;
18
18
  payload.token = token;
19
- const sortedParams = Object.keys(payload).sort();
19
+ const sortedParams = Object.keys(payload).toSorted();
20
20
  return md5(md5(requestPath) + md5(sortedParams + md5(token) + timestamp));
21
21
  };
@@ -32,7 +32,7 @@ async function handler(ctx) {
32
32
 
33
33
  const rootUrl = 'https://club.6parkbbs.com';
34
34
  const indexUrl = `${rootUrl}/${id}/index.php`;
35
- const currentUrl = `${indexUrl}${type === '' || keyword === '' ? '' : (type === 'gold' ? '?app=forum&act=gold' : `?action=search&act=threadsearch&app=forum&${type}=${keyword}&submit=${type === 'type' ? '查询' : '栏目搜索'}`)}`;
35
+ const currentUrl = `${indexUrl}${type === '' || keyword === '' ? '' : type === 'gold' ? '?app=forum&act=gold' : `?action=search&act=threadsearch&app=forum&${type}=${keyword}&submit=${type === 'type' ? '查询' : '栏目搜索'}`}`;
36
36
 
37
37
  const response = await got({
38
38
  method: 'get',
@@ -0,0 +1,488 @@
1
+ import { type Data, type DataItem, type Route, ViewType } from '@/types';
2
+
3
+ import cache from '@/utils/cache';
4
+ import ofetch from '@/utils/ofetch';
5
+ import { parseDate } from '@/utils/parse-date';
6
+
7
+ import { type CheerioAPI, type Cheerio, load } from 'cheerio';
8
+ import type { Element } from 'domhandler';
9
+ import { type Context } from 'hono';
10
+ import iconv from 'iconv-lite';
11
+
12
+ export const handler = async (ctx: Context): Promise<Data> => {
13
+ const { category = 'dy' } = ctx.req.param();
14
+ const limit: number = Number.parseInt(ctx.req.query('limit') ?? '25', 10);
15
+
16
+ const encoding: string = 'gb2312';
17
+
18
+ const baseUrl: string = 'https://www.hao6v.me';
19
+ const targetUrl: string = new URL(category.startsWith('gvod') ? `${category}.html` : category, baseUrl).href;
20
+
21
+ const response = await ofetch(targetUrl, {
22
+ responseType: 'arrayBuffer',
23
+ });
24
+ const $: CheerioAPI = load(iconv.decode(Buffer.from(response), encoding));
25
+ const language = $('html').attr('lang') ?? 'zh';
26
+
27
+ let items: DataItem[] = [];
28
+
29
+ items = $('ul.list li')
30
+ .slice(0, limit)
31
+ .toArray()
32
+ .map((el): Element => {
33
+ const $el: Cheerio<Element> = $(el);
34
+
35
+ const title: string = $el.find('a').text();
36
+ const pubDateStr: string | undefined = $el
37
+ .find('span')
38
+ .text()
39
+ .replaceAll(/(\[|\])/g, '');
40
+ const linkUrl: string | undefined = $el.find('a').attr('href');
41
+ const guid: string = `${linkUrl}#${title}`;
42
+ const upDatedStr: string | undefined = pubDateStr;
43
+
44
+ const processedItem: DataItem = {
45
+ title,
46
+ pubDate: pubDateStr ? parseDate(pubDateStr, ['MM-DD', 'YYYY-MM-DD']) : undefined,
47
+ link: linkUrl ? new URL(linkUrl, baseUrl).href : undefined,
48
+ guid,
49
+ id: guid,
50
+ updated: upDatedStr ? parseDate(upDatedStr, ['MM-DD', 'YYYY-MM-DD']) : undefined,
51
+ language,
52
+ };
53
+
54
+ return processedItem;
55
+ });
56
+
57
+ items = await Promise.all(
58
+ items.map((item) => {
59
+ if (!item.link) {
60
+ return item;
61
+ }
62
+
63
+ return cache.tryGet(item.link, async (): Promise<DataItem> => {
64
+ const detailResponse = await ofetch(item.link, {
65
+ responseType: 'arrayBuffer',
66
+ });
67
+ const $$: CheerioAPI = load(iconv.decode(Buffer.from(detailResponse), encoding));
68
+
69
+ $$('div#endText div.fl').remove();
70
+ $$('div#endText div.fr').remove();
71
+ $$('div#endText div.cr').remove();
72
+
73
+ $$('div#endText div.tps').remove();
74
+ $$('div#endText div.downtps').remove();
75
+
76
+ const title: string = $$('h1').text();
77
+ const description: string | undefined = $$('div#endText').html() ?? undefined;
78
+ const pubDateStr: string | undefined = item.link?.match(/\/(\d{4}-\d{2}-\d{2})\/\d+\.html/)?.[1];
79
+ const categoryEls: Element[] = $$('div#endText p a').toArray();
80
+ const categories: string[] = [...new Set(categoryEls.map((el) => $$(el).text()?.trim()).filter(Boolean))];
81
+ const image: string | undefined = $$('div#endText p img').attr('src');
82
+ const upDatedStr: string | undefined = pubDateStr;
83
+
84
+ let processedItem: DataItem = {
85
+ title,
86
+ description,
87
+ pubDate: pubDateStr ? parseDate(pubDateStr) : item.pubDate,
88
+ category: categories,
89
+ content: {
90
+ html: description,
91
+ text: description,
92
+ },
93
+ image,
94
+ banner: image,
95
+ updated: upDatedStr ? parseDate(upDatedStr) : item.updated,
96
+ language,
97
+ };
98
+
99
+ const $enclosureEl: Cheerio<Element> = $$('td a[href^="magnet"]').last();
100
+ const enclosureUrl: string | undefined = $enclosureEl.attr('href');
101
+
102
+ if (enclosureUrl) {
103
+ const enclosureType: string = 'application/x-bittorrent';
104
+ const enclosureTitle: string = $enclosureEl.text();
105
+
106
+ processedItem = {
107
+ ...processedItem,
108
+ enclosure_url: enclosureUrl,
109
+ enclosure_type: enclosureType,
110
+ enclosure_title: enclosureTitle || title,
111
+ };
112
+ }
113
+
114
+ return {
115
+ ...item,
116
+ ...processedItem,
117
+ };
118
+ });
119
+ })
120
+ );
121
+
122
+ return {
123
+ title: `${$('title').text().split(/,/).pop()} - ${$('div.t a').last().text()}`,
124
+ description: $('meta[name="description"]').attr('content'),
125
+ link: targetUrl,
126
+ item: items,
127
+ allowEmpty: true,
128
+ image: new URL('images/logo.gif', baseUrl).href,
129
+ language,
130
+ id: targetUrl,
131
+ };
132
+ };
133
+
134
+ export const route: Route = {
135
+ path: '/:category{.+}?',
136
+ name: '分类',
137
+ url: 'www.hao6v.me',
138
+ maintainers: ['nczitzk'],
139
+ handler,
140
+ example: '/6v123/dy',
141
+ parameters: {
142
+ category: {
143
+ description: '分类,默认为 `dy`,即最新电影,可在对应分类页 URL 中找到',
144
+ options: [
145
+ {
146
+ label: '最新电影',
147
+ value: 'dy',
148
+ },
149
+ {
150
+ label: '国语配音电影',
151
+ value: 'gydy',
152
+ },
153
+ {
154
+ label: '动漫新番',
155
+ value: 'zydy',
156
+ },
157
+ {
158
+ label: '经典高清',
159
+ value: 'gq',
160
+ },
161
+ {
162
+ label: '动画电影',
163
+ value: 'jddy',
164
+ },
165
+ {
166
+ label: '3D 电影',
167
+ value: '3D',
168
+ },
169
+ {
170
+ label: '真人秀',
171
+ value: 'shoujidianyingmp4',
172
+ },
173
+ {
174
+ label: '国剧',
175
+ value: 'dlz',
176
+ },
177
+ {
178
+ label: '日韩剧',
179
+ value: 'rj',
180
+ },
181
+ {
182
+ label: '欧美剧',
183
+ value: 'mj',
184
+ },
185
+ {
186
+ label: '综艺节目',
187
+ value: 'zy',
188
+ },
189
+ {
190
+ label: '港台电影',
191
+ value: 's/gangtaidianying',
192
+ },
193
+ {
194
+ label: '日韩电影',
195
+ value: 's/jingdiandianying',
196
+ },
197
+ {
198
+ label: '喜剧',
199
+ value: 's/xiju',
200
+ },
201
+ {
202
+ label: '动作',
203
+ value: 's/dongzuo',
204
+ },
205
+ {
206
+ label: '爱情',
207
+ value: 's/aiqing',
208
+ },
209
+ {
210
+ label: '科幻',
211
+ value: 's/kehuan',
212
+ },
213
+ {
214
+ label: '奇幻',
215
+ value: 's/qihuan',
216
+ },
217
+ {
218
+ label: '神秘',
219
+ value: 's/shenmi',
220
+ },
221
+ {
222
+ label: '幻想',
223
+ value: 's/huanxiang',
224
+ },
225
+ {
226
+ label: '恐怖',
227
+ value: 's/kongbu',
228
+ },
229
+ {
230
+ label: '战争',
231
+ value: 's/zhanzheng',
232
+ },
233
+ {
234
+ label: '冒险',
235
+ value: 's/maoxian',
236
+ },
237
+ {
238
+ label: '惊悚',
239
+ value: 's/jingsong',
240
+ },
241
+ {
242
+ label: '剧情',
243
+ value: 's/juqingpian',
244
+ },
245
+ {
246
+ label: '传记',
247
+ value: 's/zhuanji',
248
+ },
249
+ {
250
+ label: '历史',
251
+ value: 's/lishi',
252
+ },
253
+ {
254
+ label: '纪录',
255
+ value: 's/jilu',
256
+ },
257
+ {
258
+ label: '印度电影',
259
+ value: 's/yindudianying',
260
+ },
261
+ {
262
+ label: '国产电影',
263
+ value: 's/guochandianying',
264
+ },
265
+ {
266
+ label: '欧洲电影',
267
+ value: 's/xijudianying',
268
+ },
269
+ ],
270
+ },
271
+ },
272
+ description: `:::tip
273
+ 订阅 [最新电影](https://www.hao6v.me/dy/),其源网址为 \`https://www.hao6v.me/dy/\`,请参考该 URL 指定部分构成参数,此时路由为 [\`/6v123/dy\`](https://rsshub.app/6v123/dy)。
274
+
275
+ :::
276
+
277
+ <details>
278
+ <summary>更多分类</summary>
279
+
280
+ | 分类 | ID |
281
+ | ---------------------------------------------------- | ----------------------------------------------------------------- |
282
+ | [最新电影](https://www.hao6v.me/dy/) | [dy](https://rsshub.app/6v123/dy) |
283
+ | [国语配音电影](https://www.hao6v.me/gydy/) | [gydy](https://rsshub.app/6v123/gydy) |
284
+ | [动漫新番](https://www.hao6v.me/zydy/) | [zydy](https://rsshub.app/6v123/zydy) |
285
+ | [经典高清](https://www.hao6v.me/gq/) | [gq](https://rsshub.app/6v123/gq) |
286
+ | [动画电影](https://www.hao6v.me/jddy/) | [jddy](https://rsshub.app/6v123/jddy) |
287
+ | [3D 电影](https://www.hao6v.me/3D/) | [3D](https://rsshub.app/6v123/3D) |
288
+ | [真人秀](https://www.hao6v.me/shoujidianyingmp4/) | [shoujidianyingmp4](https://rsshub.app/6v123/shoujidianyingmp4) |
289
+ | [国剧](https://www.hao6v.me/dlz/) | [dlz](https://rsshub.app/6v123/dlz) |
290
+ | [日韩剧](https://www.hao6v.me/rj/) | [rj](https://rsshub.app/6v123/rj) |
291
+ | [欧美剧](https://www.hao6v.me/mj/) | [mj](https://rsshub.app/6v123/mj) |
292
+ | [综艺节目](https://www.hao6v.me/zy/) | [zy](https://rsshub.app/6v123/zy) |
293
+ | [港台电影](https://www.hao6v.me/s/gangtaidianying/) | [s/gangtaidianying](https://rsshub.app/6v123/s/gangtaidianying) |
294
+ | [日韩电影](https://www.hao6v.me/s/jingdiandianying/) | [s/jingdiandianying](https://rsshub.app/6v123/s/jingdiandianying) |
295
+ | [喜剧](https://www.hao6v.me/s/xiju/) | [s/xiju](https://rsshub.app/6v123/s/xiju) |
296
+ | [动作](https://www.hao6v.me/s/dongzuo/) | [s/dongzuo](https://rsshub.app/6v123/s/dongzuo) |
297
+ | [爱情](https://www.hao6v.me/s/aiqing/) | [s/aiqing](https://rsshub.app/6v123/s/aiqing) |
298
+ | [科幻](https://www.hao6v.me/s/kehuan/) | [s/kehuan](https://rsshub.app/6v123/s/kehuan) |
299
+ | [奇幻](https://www.hao6v.me/s/qihuan/) | [s/qihuan](https://rsshub.app/6v123/s/qihuan) |
300
+ | [神秘](https://www.hao6v.me/s/shenmi/) | [s/shenmi](https://rsshub.app/6v123/s/shenmi) |
301
+ | [幻想](https://www.hao6v.me/s/huanxiang/) | [s/huanxiang](https://rsshub.app/6v123/s/huanxiang) |
302
+ | [恐怖](https://www.hao6v.me/s/kongbu/) | [s/kongbu](https://rsshub.app/6v123/s/kongbu) |
303
+ | [战争](https://www.hao6v.me/s/zhanzheng/) | [s/zhanzheng](https://rsshub.app/6v123/s/zhanzheng) |
304
+ | [冒险](https://www.hao6v.me/s/maoxian/) | [s/maoxian](https://rsshub.app/6v123/s/maoxian) |
305
+ | [惊悚](https://www.hao6v.me/s/jingsong/) | [s/jingsong](https://rsshub.app/6v123/s/jingsong) |
306
+ | [剧情](https://www.hao6v.me/s/juqingpian/) | [s/juqingpian](https://rsshub.app/6v123/s/juqingpian) |
307
+ | [传记](https://www.hao6v.me/s/zhuanji/) | [s/zhuanji](https://rsshub.app/6v123/s/zhuanji) |
308
+ | [历史](https://www.hao6v.me/s/lishi/) | [s/lishi](https://rsshub.app/6v123/s/lishi) |
309
+ | [纪录](https://www.hao6v.me/s/jilu/) | [s/jilu](https://rsshub.app/6v123/s/jilu) |
310
+ | [印度电影](https://www.hao6v.me/s/yindudianying/) | [s/yindudianying](https://rsshub.app/6v123/s/yindudianying) |
311
+ | [国产电影](https://www.hao6v.me/s/guochandianying/) | [s/guochandianying](https://rsshub.app/6v123/s/guochandianying) |
312
+ | [欧洲电影](https://www.hao6v.me/s/xijudianying/) | [s/xijudianying](https://rsshub.app/6v123/s/xijudianying) |
313
+
314
+ </details>
315
+ `,
316
+ categories: ['multimedia'],
317
+ features: {
318
+ requireConfig: false,
319
+ requirePuppeteer: false,
320
+ antiCrawler: false,
321
+ supportRadar: true,
322
+ supportBT: true,
323
+ supportPodcast: false,
324
+ supportScihub: false,
325
+ },
326
+ radar: [
327
+ {
328
+ source: ['www.hao6v.me/:category'],
329
+ target: '/:category',
330
+ },
331
+ {
332
+ title: '最新电影',
333
+ source: ['www.hao6v.me/dy/'],
334
+ target: '/dy',
335
+ },
336
+ {
337
+ title: '国语配音电影',
338
+ source: ['www.hao6v.me/gydy/'],
339
+ target: '/gydy',
340
+ },
341
+ {
342
+ title: '动漫新番',
343
+ source: ['www.hao6v.me/zydy/'],
344
+ target: '/zydy',
345
+ },
346
+ {
347
+ title: '经典高清',
348
+ source: ['www.hao6v.me/gq/'],
349
+ target: '/gq',
350
+ },
351
+ {
352
+ title: '动画电影',
353
+ source: ['www.hao6v.me/jddy/'],
354
+ target: '/jddy',
355
+ },
356
+ {
357
+ title: '3D电影',
358
+ source: ['www.hao6v.me/3D/'],
359
+ target: '/3D',
360
+ },
361
+ {
362
+ title: '真人秀',
363
+ source: ['www.hao6v.me/shoujidianyingmp4/'],
364
+ target: '/shoujidianyingmp4',
365
+ },
366
+ {
367
+ title: '国剧',
368
+ source: ['www.hao6v.me/dlz/'],
369
+ target: '/dlz',
370
+ },
371
+ {
372
+ title: '日韩剧',
373
+ source: ['www.hao6v.me/rj/'],
374
+ target: '/rj',
375
+ },
376
+ {
377
+ title: '欧美剧',
378
+ source: ['www.hao6v.me/mj/'],
379
+ target: '/mj',
380
+ },
381
+ {
382
+ title: '综艺节目',
383
+ source: ['www.hao6v.me/zy/'],
384
+ target: '/zy',
385
+ },
386
+ {
387
+ title: '港台电影',
388
+ source: ['www.hao6v.me/s/gangtaidianying/'],
389
+ target: '/s/gangtaidianying',
390
+ },
391
+ {
392
+ title: '日韩电影',
393
+ source: ['www.hao6v.me/s/jingdiandianying/'],
394
+ target: '/s/jingdiandianying',
395
+ },
396
+ {
397
+ title: '喜剧',
398
+ source: ['www.hao6v.me/s/xiju/'],
399
+ target: '/s/xiju',
400
+ },
401
+ {
402
+ title: '动作',
403
+ source: ['www.hao6v.me/s/dongzuo/'],
404
+ target: '/s/dongzuo',
405
+ },
406
+ {
407
+ title: '爱情',
408
+ source: ['www.hao6v.me/s/aiqing/'],
409
+ target: '/s/aiqing',
410
+ },
411
+ {
412
+ title: '科幻',
413
+ source: ['www.hao6v.me/s/kehuan/'],
414
+ target: '/s/kehuan',
415
+ },
416
+ {
417
+ title: '奇幻',
418
+ source: ['www.hao6v.me/s/qihuan/'],
419
+ target: '/s/qihuan',
420
+ },
421
+ {
422
+ title: '神秘',
423
+ source: ['www.hao6v.me/s/shenmi/'],
424
+ target: '/s/shenmi',
425
+ },
426
+ {
427
+ title: '幻想',
428
+ source: ['www.hao6v.me/s/huanxiang/'],
429
+ target: '/s/huanxiang',
430
+ },
431
+ {
432
+ title: '恐怖',
433
+ source: ['www.hao6v.me/s/kongbu/'],
434
+ target: '/s/kongbu',
435
+ },
436
+ {
437
+ title: '战争',
438
+ source: ['www.hao6v.me/s/zhanzheng/'],
439
+ target: '/s/zhanzheng',
440
+ },
441
+ {
442
+ title: '冒险',
443
+ source: ['www.hao6v.me/s/maoxian/'],
444
+ target: '/s/maoxian',
445
+ },
446
+ {
447
+ title: '惊悚',
448
+ source: ['www.hao6v.me/s/jingsong/'],
449
+ target: '/s/jingsong',
450
+ },
451
+ {
452
+ title: '剧情',
453
+ source: ['www.hao6v.me/s/juqingpian/'],
454
+ target: '/s/juqingpian',
455
+ },
456
+ {
457
+ title: '传记',
458
+ source: ['www.hao6v.me/s/zhuanji/'],
459
+ target: '/s/zhuanji',
460
+ },
461
+ {
462
+ title: '历史',
463
+ source: ['www.hao6v.me/s/lishi/'],
464
+ target: '/s/lishi',
465
+ },
466
+ {
467
+ title: '纪录',
468
+ source: ['www.hao6v.me/s/jilu/'],
469
+ target: '/s/jilu',
470
+ },
471
+ {
472
+ title: '印度电影',
473
+ source: ['www.hao6v.me/s/yindudianying/'],
474
+ target: '/s/yindudianying',
475
+ },
476
+ {
477
+ title: '国产电影',
478
+ source: ['www.hao6v.me/s/guochandianying/'],
479
+ target: '/s/guochandianying',
480
+ },
481
+ {
482
+ title: '欧洲电影',
483
+ source: ['www.hao6v.me/s/xijudianying/'],
484
+ target: '/s/xijudianying',
485
+ },
486
+ ],
487
+ view: ViewType.Articles,
488
+ };
@@ -3,5 +3,6 @@ import type { Namespace } from '@/types';
3
3
  export const namespace: Namespace = {
4
4
  name: '6v 电影',
5
5
  url: 'hao6v.cc',
6
+ categories: ['multimedia'],
6
7
  lang: 'zh-CN',
7
8
  };