rsshub 1.0.0-master.b08045c → 1.0.0-master.b08abca

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 (298) hide show
  1. package/README.md +2 -2
  2. package/lib/app.js +2 -2
  3. package/lib/config.js +1 -0
  4. package/lib/radar-rules.js +0 -17
  5. package/lib/radar.js +1 -1
  6. package/lib/router.js +26 -29
  7. package/lib/utils/logger.js +14 -2
  8. package/lib/v2/8264/list.js +92 -0
  9. package/lib/v2/8264/maintainer.js +3 -0
  10. package/lib/v2/8264/radar.js +355 -0
  11. package/lib/v2/8264/router.js +3 -0
  12. package/lib/v2/8264/templates/description.art +5 -0
  13. package/lib/v2/abskoop/index.js +21 -31
  14. package/lib/v2/abskoop/nsfw.js +16 -37
  15. package/lib/v2/abskoop/radar.js +13 -2
  16. package/lib/v2/ainvest/article.js +42 -0
  17. package/lib/v2/ainvest/maintainer.js +4 -0
  18. package/lib/v2/ainvest/news.js +39 -0
  19. package/lib/v2/ainvest/radar.js +19 -0
  20. package/lib/v2/ainvest/router.js +4 -0
  21. package/lib/v2/ainvest/utils.js +73 -0
  22. package/lib/v2/alternativeto/maintainer.js +4 -0
  23. package/lib/v2/alternativeto/platform.js +32 -0
  24. package/lib/v2/alternativeto/radar.js +19 -0
  25. package/lib/v2/alternativeto/router.js +4 -0
  26. package/lib/v2/alternativeto/software.js +32 -0
  27. package/lib/v2/alternativeto/utils.js +22 -0
  28. package/lib/v2/apnews/topics.js +1 -0
  29. package/lib/v2/baidu/maintainer.js +1 -0
  30. package/lib/v2/baidu/radar.js +15 -1
  31. package/lib/v2/baidu/router.js +1 -0
  32. package/lib/v2/baidu/templates/tieba_search.art +1 -0
  33. package/lib/v2/baidu/tieba/search.js +63 -0
  34. package/lib/v2/bangumi/maintainer.js +1 -0
  35. package/lib/v2/bangumi/radar.js +9 -9
  36. package/lib/v2/bangumi/router.js +1 -2
  37. package/lib/v2/bangumi/tv/subject/ep.js +4 -3
  38. package/lib/v2/bangumi/tv/subject/index.js +18 -16
  39. package/lib/v2/bangumi/tv/subject/offcial-subject-api.js +3 -2
  40. package/lib/v2/bangumi/tv/subject/utils.js +5 -0
  41. package/lib/{routes → v2}/bbc/index.js +4 -4
  42. package/lib/v2/bbc/maintainer.js +4 -0
  43. package/lib/v2/bbc/radar.js +11 -0
  44. package/lib/v2/bbc/router.js +3 -0
  45. package/lib/v2/bilibili/dynamic.js +26 -12
  46. package/lib/v2/bilibili/followings_dynamic.js +1 -1
  47. package/lib/v2/bilibili/maintainer.js +2 -1
  48. package/lib/v2/bilibili/router.js +1 -0
  49. package/lib/v2/bilibili/utils.js +3 -1
  50. package/lib/v2/bilibili/watchlater.js +44 -0
  51. package/lib/v2/bjfu/grs.js +22 -36
  52. package/lib/v2/bjfu/it/index.js +9 -7
  53. package/lib/v2/bjfu/it/utils.js +38 -29
  54. package/lib/v2/bjfu/jwc/index.js +3 -8
  55. package/lib/v2/bjfu/jwc/utils.js +26 -29
  56. package/lib/v2/bjfu/kjc.js +25 -38
  57. package/lib/v2/bjfu/news/index.js +12 -9
  58. package/lib/v2/bjfu/news/utils.js +17 -19
  59. package/lib/v2/boc/maintainer.js +3 -0
  60. package/lib/v2/boc/radar.js +13 -0
  61. package/lib/v2/boc/router.js +3 -0
  62. package/lib/{routes → v2}/boc/whpj.js +16 -15
  63. package/lib/{routes → v2}/caus/index.js +7 -6
  64. package/lib/v2/caus/maintainer.js +3 -0
  65. package/lib/v2/caus/radar.js +13 -0
  66. package/lib/v2/caus/router.js +3 -0
  67. package/lib/v2/cbc/maintainer.js +3 -0
  68. package/lib/v2/cbc/radar.js +13 -0
  69. package/lib/v2/cbc/router.js +3 -0
  70. package/lib/{routes → v2}/cbc/topics.js +11 -26
  71. package/lib/v2/chinawriter/index.js +88 -0
  72. package/lib/v2/chinawriter/maintainer.js +3 -0
  73. package/lib/v2/chinawriter/radar.js +660 -0
  74. package/lib/v2/chinawriter/router.js +3 -0
  75. package/lib/v2/cna/index.js +63 -0
  76. package/lib/v2/cna/maintainer.js +3 -0
  77. package/lib/v2/cna/radar.js +13 -0
  78. package/lib/v2/cna/router.js +3 -0
  79. package/lib/v2/cyzone/author.js +20 -0
  80. package/lib/v2/cyzone/index.js +27 -0
  81. package/lib/v2/cyzone/label.js +20 -0
  82. package/lib/v2/cyzone/maintainer.js +7 -0
  83. package/lib/v2/cyzone/radar.js +25 -0
  84. package/lib/v2/cyzone/router.js +6 -0
  85. package/lib/v2/cyzone/util.js +125 -0
  86. package/lib/v2/deltaio/blog.js +33 -0
  87. package/lib/v2/deltaio/maintainer.js +3 -0
  88. package/lib/v2/deltaio/radar.js +13 -0
  89. package/lib/v2/deltaio/router.js +3 -0
  90. package/lib/v2/discourse/maintainer.js +1 -1
  91. package/lib/v2/discourse/notifications.js +19 -2
  92. package/lib/v2/discourse/router.js +1 -1
  93. package/lib/v2/discuz/discuz.js +156 -0
  94. package/lib/v2/discuz/maintainer.js +5 -0
  95. package/lib/v2/discuz/radar.js +0 -0
  96. package/lib/v2/discuz/router.js +5 -0
  97. package/lib/v2/dn/maintainer.js +3 -0
  98. package/lib/v2/dn/news.js +90 -0
  99. package/lib/v2/dn/radar.js +55 -0
  100. package/lib/v2/dn/router.js +3 -0
  101. package/lib/v2/dn/templates/description.art +15 -0
  102. package/lib/v2/domp4/detail.js +4 -2
  103. package/lib/v2/domp4/latest.js +7 -4
  104. package/lib/v2/domp4/utils.js +15 -2
  105. package/lib/v2/dorohedoro/news.js +3 -1
  106. package/lib/v2/douyin/live.js +45 -15
  107. package/lib/v2/dribbble/maintainer.js +5 -0
  108. package/lib/v2/dribbble/radar.js +25 -0
  109. package/lib/v2/dribbble/router.js +5 -0
  110. package/lib/v2/dribbble/templates/description.art +15 -0
  111. package/lib/v2/dribbble/utils.js +156 -0
  112. package/lib/v2/fantia/user.js +16 -0
  113. package/lib/v2/gamegene/maintainer.js +3 -0
  114. package/lib/v2/gamegene/news.js +50 -0
  115. package/lib/v2/gamegene/radar.js +13 -0
  116. package/lib/v2/gamegene/router.js +3 -0
  117. package/lib/v2/github/maintainer.js +1 -0
  118. package/lib/v2/github/pulse.js +87 -0
  119. package/lib/v2/github/radar.js +6 -0
  120. package/lib/v2/github/router.js +1 -0
  121. package/lib/v2/github/templates/pulse-description.art +24 -0
  122. package/lib/v2/gov/maintainer.js +1 -0
  123. package/lib/v2/gov/radar.js +8 -0
  124. package/lib/v2/gov/router.js +1 -0
  125. package/lib/v2/gov/shenzhen/zjj/index.js +45 -0
  126. package/lib/v2/hrbeu/radar.js +3 -3
  127. package/lib/v2/hrbeu/router.js +1 -1
  128. package/lib/v2/hrbeu/uae/news.js +66 -0
  129. package/lib/v2/icbc/maintainer.js +3 -0
  130. package/lib/v2/icbc/radar.js +13 -0
  131. package/lib/v2/icbc/router.js +3 -0
  132. package/lib/v2/icbc/whpj.js +57 -0
  133. package/lib/v2/iqiyi/maintainer.js +1 -1
  134. package/lib/v2/iqiyi/video.js +42 -33
  135. package/lib/v2/ithome/tag.js +14 -3
  136. package/lib/v2/japanpost/maintainer.js +3 -0
  137. package/lib/v2/japanpost/radar.js +22 -0
  138. package/lib/v2/japanpost/router.js +3 -0
  139. package/lib/v2/japanpost/templates/track_item_desc.art +14 -0
  140. package/lib/{routes → v2}/japanpost/track.js +32 -29
  141. package/lib/{routes → v2}/japanpost/utils.js +10 -11
  142. package/lib/v2/kamen-rider-official/maintainer.js +3 -0
  143. package/lib/v2/kamen-rider-official/news.js +110 -0
  144. package/lib/v2/kamen-rider-official/radar.js +18 -0
  145. package/lib/v2/kamen-rider-official/router.js +3 -0
  146. package/lib/v2/kamen-rider-official/templates/description.art +10 -0
  147. package/lib/v2/kantarworldpanel/index.js +96 -0
  148. package/lib/v2/kantarworldpanel/maintainer.js +3 -0
  149. package/lib/v2/kantarworldpanel/radar.js +199 -0
  150. package/lib/v2/kantarworldpanel/router.js +3 -0
  151. package/lib/v2/kantarworldpanel/templates/description.art +9 -0
  152. package/lib/v2/kunchengblog/essay.js +35 -19
  153. package/lib/v2/kunchengblog/radar.js +1 -1
  154. package/lib/v2/kunchengblog/router.js +1 -1
  155. package/lib/v2/latepost/index.js +2 -2
  156. package/lib/v2/latepost/radar.js +1 -1
  157. package/lib/v2/lemmy/index.js +61 -0
  158. package/lib/v2/lemmy/maintainer.js +3 -0
  159. package/lib/v2/lemmy/router.js +3 -0
  160. package/lib/v2/liulinblog/index.js +98 -0
  161. package/lib/v2/liulinblog/maintainer.js +6 -2
  162. package/lib/v2/liulinblog/radar.js +39 -19
  163. package/lib/v2/liulinblog/router.js +7 -3
  164. package/lib/v2/lsnu/jiaowc/tzgg.js +52 -0
  165. package/lib/v2/lsnu/maintainer.js +3 -0
  166. package/lib/v2/lsnu/radar.js +13 -0
  167. package/lib/v2/lsnu/router.js +3 -0
  168. package/lib/v2/luxiangdong/archive.js +28 -0
  169. package/lib/v2/luxiangdong/maintainer.js +3 -0
  170. package/lib/v2/luxiangdong/radar.js +13 -0
  171. package/lib/v2/luxiangdong/router.js +3 -0
  172. package/lib/v2/mail/imap.js +99 -0
  173. package/lib/v2/mail/maintainer.js +3 -0
  174. package/lib/v2/mail/router.js +3 -0
  175. package/lib/v2/mihoyo/bbs/img-ranking.js +106 -0
  176. package/lib/v2/mihoyo/{bbs.js → bbs/official.js} +1 -1
  177. package/lib/v2/mihoyo/bbs/static-data.js +137 -0
  178. package/lib/v2/mihoyo/maintainer.js +1 -0
  179. package/lib/v2/mihoyo/radar.js +7 -1
  180. package/lib/v2/mihoyo/router.js +2 -1
  181. package/lib/v2/mixcloud/index.js +5 -22
  182. package/lib/v2/mixcloud/queries.js +187 -179
  183. package/lib/v2/mydrivers/cid.js +38 -0
  184. package/lib/v2/mydrivers/index.js +40 -89
  185. package/lib/v2/mydrivers/maintainer.js +5 -1
  186. package/lib/v2/mydrivers/radar.js +205 -4
  187. package/lib/v2/mydrivers/rank.js +40 -0
  188. package/lib/v2/mydrivers/router.js +4 -1
  189. package/lib/v2/mydrivers/templates/description.art +5 -0
  190. package/lib/v2/mydrivers/util.js +125 -0
  191. package/lib/v2/news/whxw.js +1 -0
  192. package/lib/v2/nytimes/index.js +1 -4
  193. package/lib/v2/nytimes/utils.js +5 -0
  194. package/lib/v2/pornhub/category.js +44 -0
  195. package/lib/v2/pornhub/category_url.js +25 -0
  196. package/lib/v2/pornhub/maintainer.js +8 -0
  197. package/lib/v2/pornhub/model.js +29 -0
  198. package/lib/v2/pornhub/pornstar.js +29 -0
  199. package/lib/v2/pornhub/radar.js +46 -0
  200. package/lib/v2/pornhub/router.js +8 -0
  201. package/lib/v2/pornhub/search.js +23 -0
  202. package/lib/v2/pornhub/templates/description.art +11 -0
  203. package/lib/v2/pornhub/users.js +30 -0
  204. package/lib/v2/pornhub/utils.js +30 -0
  205. package/lib/v2/reuters/common.js +52 -26
  206. package/lib/v2/rfi/maintainer.js +1 -1
  207. package/lib/v2/rfi/news.js +9 -2
  208. package/lib/v2/rfi/router.js +1 -1
  209. package/lib/v2/rsc/journal.js +106 -0
  210. package/lib/v2/rsc/maintainer.js +3 -0
  211. package/lib/v2/rsc/radar.js +23 -0
  212. package/lib/v2/rsc/router.js +3 -0
  213. package/lib/v2/rsc/templates/image.art +5 -0
  214. package/lib/v2/rsshub/maintainer.js +1 -0
  215. package/lib/v2/rsshub/router.js +1 -0
  216. package/lib/v2/rsshub/routes.js +6 -4
  217. package/lib/v2/rsshub/transform/html.js +9 -0
  218. package/lib/v2/rsshub/transform/json.js +1 -0
  219. package/lib/v2/rsshub/transform/sitemap.js +52 -0
  220. package/lib/v2/scut/maintainer.js +1 -0
  221. package/lib/v2/scut/radar.js +34 -0
  222. package/lib/v2/scut/router.js +1 -0
  223. package/lib/v2/scut/smae/notice.js +54 -0
  224. package/lib/v2/sqmc/maintainer.js +3 -0
  225. package/lib/v2/sqmc/radar.js +13 -0
  226. package/lib/v2/sqmc/router.js +3 -0
  227. package/lib/v2/sqmc/www.js +49 -0
  228. package/lib/v2/stheadline/std/realtime.js +8 -6
  229. package/lib/v2/stockedge/daily-news.js +1 -1
  230. package/lib/v2/stockedge/utils.js +1 -0
  231. package/lib/v2/test/index.js +1 -1
  232. package/lib/v2/tfc-taiwan/index.js +36 -0
  233. package/lib/v2/tfc-taiwan/maintainer.js +10 -0
  234. package/lib/v2/tfc-taiwan/radar.js +31 -0
  235. package/lib/v2/tfc-taiwan/router.js +7 -0
  236. package/lib/v2/tfc-taiwan/templates/article.art +7 -0
  237. package/lib/v2/tfc-taiwan/utils.js +56 -0
  238. package/lib/v2/thepaper/utils.js +1 -1
  239. package/lib/v2/toodaylab/index.js +99 -0
  240. package/lib/v2/toodaylab/maintainer.js +7 -0
  241. package/lib/v2/toodaylab/radar.js +37 -0
  242. package/lib/v2/toodaylab/router.js +3 -0
  243. package/lib/v2/udn/breaking-news.js +10 -5
  244. package/lib/v2/ustc/eeis.js +5 -4
  245. package/lib/v2/ustc/sist.js +6 -5
  246. package/lib/v2/v2ex/maintainer.js +5 -0
  247. package/lib/v2/v2ex/post.js +35 -0
  248. package/lib/v2/v2ex/radar.js +35 -0
  249. package/lib/v2/v2ex/router.js +5 -0
  250. package/lib/{routes → v2}/v2ex/tab.js +17 -21
  251. package/lib/{routes → v2}/v2ex/topics.js +1 -1
  252. package/lib/v2/whu/cs.js +71 -0
  253. package/lib/v2/whu/gs/index.js +85 -0
  254. package/lib/v2/whu/maintainer.js +5 -0
  255. package/lib/v2/whu/news.js +102 -0
  256. package/lib/v2/whu/radar.js +27 -0
  257. package/lib/v2/whu/router.js +5 -0
  258. package/lib/v2/xinpianchang/index.js +19 -0
  259. package/lib/v2/xinpianchang/maintainer.js +4 -0
  260. package/lib/v2/xinpianchang/radar.js +28 -0
  261. package/lib/v2/xinpianchang/rank.js +33 -0
  262. package/lib/v2/xinpianchang/router.js +5 -0
  263. package/lib/v2/xinpianchang/templates/description.art +13 -0
  264. package/lib/v2/xinpianchang/util.js +110 -0
  265. package/lib/v2/xmut/jwc/bkjw.js +62 -0
  266. package/lib/v2/xmut/jwc/yjs.js +51 -0
  267. package/lib/v2/xmut/maintainer.js +3 -0
  268. package/lib/v2/xmut/radar.js +13 -0
  269. package/lib/v2/xmut/router.js +4 -0
  270. package/lib/v2/zodgame/forum.js +61 -23
  271. package/lib/v2/zodgame/templates/forum.art +1 -1
  272. package/lib/views/welcome.art +1 -1
  273. package/package.json +46 -17
  274. package/lib/routes/cna/index.js +0 -54
  275. package/lib/routes/cyzone/author.js +0 -55
  276. package/lib/routes/cyzone/label.js +0 -53
  277. package/lib/routes/discuz/discuz.js +0 -148
  278. package/lib/routes/dribbble/utils.js +0 -94
  279. package/lib/routes/kkj/news.js +0 -52
  280. package/lib/routes/mail/imap.js +0 -79
  281. package/lib/routes/pornhub/category.js +0 -22
  282. package/lib/routes/pornhub/category_url.js +0 -34
  283. package/lib/routes/pornhub/model.js +0 -35
  284. package/lib/routes/pornhub/pornstar.js +0 -35
  285. package/lib/routes/pornhub/search.js +0 -22
  286. package/lib/routes/pornhub/users.js +0 -35
  287. package/lib/routes/universities/whu/cs.js +0 -38
  288. package/lib/routes/universities/whu/news.js +0 -128
  289. package/lib/routes/v2ex/post.js +0 -39
  290. package/lib/v2/abskoop/templates/description.art +0 -3
  291. package/lib/v2/hrbeu/uae/list.js +0 -57
  292. package/lib/v2/liulinblog/itnews.js +0 -23
  293. package/lib/v2/liulinblog/kuaixun.js +0 -17
  294. package/lib/v2/liulinblog/utils.js +0 -42
  295. /package/lib/{routes → v2}/bbc/utils.js +0 -0
  296. /package/lib/{routes → v2}/dribbble/keyword.js +0 -0
  297. /package/lib/{routes → v2}/dribbble/popular.js +0 -0
  298. /package/lib/{routes → v2}/dribbble/user.js +0 -0
@@ -0,0 +1,73 @@
1
+ const crypto = require('crypto');
2
+ const CryptoJS = require('crypto-js');
3
+ const { KJUR, KEYUTIL, hextob64 } = require('jsrsasign');
4
+
5
+ const publicKey =
6
+ 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCARnxLlrhTK28bEV7s2IROjT73KLSjfqpKIvV8L+Yhe4BrF0Ut4oOH728HZlbSF0C3N0vXZjLAFesoS4v1pYOjVCPXl920Lh2seCv82m0cK78WMGuqZTfA44Nv7JsQMHC3+J6IZm8YD53ft2d8mYBFgKektduucjx8sObe7eRyoQIDAQAB';
7
+
8
+ const randomString = (length) => {
9
+ if (length > 32) {
10
+ throw Error('Max length is 32.');
11
+ }
12
+ return uuidv4().replace(/-/g, '').substring(0, length);
13
+ };
14
+
15
+ const uuidv4 = () => crypto.randomUUID();
16
+
17
+ /**
18
+ * @param {string} str
19
+ * @returns {CryptoJS.lib.WordArray}
20
+ */
21
+ const MD5 = (str) => CryptoJS.MD5(str);
22
+
23
+ const encryptAES = (data, key) => {
24
+ if (typeof key === 'string') {
25
+ key = MD5(key);
26
+ }
27
+ return CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(data), key, {
28
+ mode: CryptoJS.mode.ECB,
29
+ padding: CryptoJS.pad.Pkcs7,
30
+ }).toString();
31
+ };
32
+
33
+ const decryptAES = (data, key) => {
34
+ if (typeof key === 'string') {
35
+ key = MD5(key);
36
+ }
37
+ return CryptoJS.AES.decrypt(data, key, {
38
+ mode: CryptoJS.mode.ECB,
39
+ padding: CryptoJS.pad.Pkcs7,
40
+ }).toString(CryptoJS.enc.Utf8);
41
+ };
42
+
43
+ const encryptRSA = (data) => {
44
+ // Original code:
45
+ // var n = new JSEncrypt();
46
+ // n.setPublicKey(pubKey);
47
+ // return n.encrypt(message);
48
+ // Note: Server will reject the public key if it's encrypted using crypto.publicEncrypt().
49
+ let pubKey = `-----BEGIN PUBLIC KEY-----${publicKey}-----END PUBLIC KEY-----`;
50
+ pubKey = KEYUTIL.getKey(pubKey);
51
+ return hextob64(KJUR.crypto.Cipher.encrypt(data, pubKey));
52
+ };
53
+
54
+ const getHeaders = (key) => {
55
+ const fingerPrint = uuidv4();
56
+
57
+ return {
58
+ 'content-type': 'application/json',
59
+ 'ovse-trace': uuidv4(),
60
+ callertype: 'USER',
61
+ fingerprint: encryptAES(fingerPrint, MD5(key)),
62
+ onetimeskey: encryptRSA(key),
63
+ timestamp: encryptAES(Date.now(), key),
64
+ referer: 'https://www.ainvest.com/',
65
+ };
66
+ };
67
+
68
+ module.exports = {
69
+ randomString,
70
+ encryptAES,
71
+ decryptAES,
72
+ getHeaders,
73
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '/software/:name/:routeParams?': ['JimenezLi'],
3
+ '/platform/:name/:routeParams?': ['JimenezLi'],
4
+ };
@@ -0,0 +1,32 @@
1
+ const { baseURL, puppeteerGet } = require('./utils');
2
+ const cheerio = require('cheerio');
3
+
4
+ module.exports = async (ctx) => {
5
+ const name = ctx.params.name;
6
+ const query = new URLSearchParams(ctx.params.routeParams);
7
+ const link = `https://alternativeto.net/platform/${name}/?${query.toString()}`;
8
+
9
+ // use Puppeteer due to the obstacle by cloudflare challenge
10
+ const html = await puppeteerGet(link, ctx.cache);
11
+ const $ = cheerio.load(html);
12
+
13
+ ctx.state.data = {
14
+ title: $('.Heading_h1___Cf5Y').text().trim(),
15
+ description: $('.intro-text').text().trim(),
16
+ link,
17
+ item: $('.AppListItem_appInfo__h9cWP')
18
+ .toArray()
19
+ .map((element) => {
20
+ const item = $(element);
21
+ const title = item.find('.Heading_h2___LwQD').text().trim();
22
+ const link = `${baseURL}${item.find('.Heading_h2___LwQD a').attr('href')}`;
23
+ const description = item.find('.AppListItem_description__wtODK').text().trim();
24
+
25
+ return {
26
+ title,
27
+ link,
28
+ description,
29
+ };
30
+ }),
31
+ };
32
+ };
@@ -0,0 +1,19 @@
1
+ module.exports = {
2
+ 'alternativeto.net': {
3
+ _name: 'AlternativeTo',
4
+ www: [
5
+ {
6
+ title: 'Software Alternatives',
7
+ docs: 'https://docs.rsshub.app/routes/programming#alternativeto-software-alternatives',
8
+ source: '/software/:name',
9
+ target: '/software/:name',
10
+ },
11
+ {
12
+ title: 'Platform Software',
13
+ docs: 'https://docs.rsshub.app/routes/programming#alternativeto-platform-software',
14
+ source: '/platform/:name',
15
+ target: '/platform/:name',
16
+ },
17
+ ],
18
+ },
19
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = (router) => {
2
+ router.get('/software/:name/:routeParams?', require('./software'));
3
+ router.get('/platform/:name/:routeParams?', require('./platform'));
4
+ };
@@ -0,0 +1,32 @@
1
+ const { baseURL, puppeteerGet } = require('./utils');
2
+ const cheerio = require('cheerio');
3
+
4
+ module.exports = async (ctx) => {
5
+ const name = ctx.params.name;
6
+ const query = new URLSearchParams(ctx.params.routeParams);
7
+ const link = `https://alternativeto.net/software/${name}/?${query.toString()}`;
8
+
9
+ // use Puppeteer due to the obstacle by cloudflare challenge
10
+ const html = await puppeteerGet(link, ctx.cache);
11
+ const $ = cheerio.load(html);
12
+
13
+ ctx.state.data = {
14
+ title: $('.Heading_h1___Cf5Y').text().trim(),
15
+ description: $('.intro-text').text().trim(),
16
+ link,
17
+ item: $('.AppListItem_appInfo__h9cWP')
18
+ .toArray()
19
+ .map((element) => {
20
+ const item = $(element);
21
+ const title = item.find('.Heading_h2___LwQD').text().trim();
22
+ const link = `${baseURL}${item.find('.Heading_h2___LwQD a').attr('href')}`;
23
+ const description = item.find('.AppListItem_description__wtODK').text().trim();
24
+
25
+ return {
26
+ title,
27
+ link,
28
+ description,
29
+ };
30
+ }),
31
+ };
32
+ };
@@ -0,0 +1,22 @@
1
+ const baseURL = 'https://alternativeto.net';
2
+
3
+ const puppeteerGet = (url, cache) =>
4
+ cache.tryGet(url, async () => {
5
+ const browser = await require('@/utils/puppeteer')();
6
+ const page = await browser.newPage();
7
+ await page.setRequestInterception(true);
8
+ page.on('request', (request) => {
9
+ request.resourceType() === 'document' ? request.continue() : request.abort();
10
+ });
11
+ await page.goto(url, {
12
+ waitUntil: 'domcontentloaded',
13
+ });
14
+ const html = await page.evaluate(() => document.documentElement.innerHTML);
15
+ browser.close();
16
+ return html;
17
+ });
18
+
19
+ module.exports = {
20
+ baseURL,
21
+ puppeteerGet,
22
+ };
@@ -12,6 +12,7 @@ module.exports = async (ctx) => {
12
12
  const items = await Promise.all(
13
13
  $('.PagePromo-content')
14
14
  .get()
15
+ .slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : Infinity)
15
16
  .map((e) => ({
16
17
  title: $(e).find('span.PagePromoContentIcons-text').text(),
17
18
  link: $(e).find('a').attr('href'),
@@ -4,6 +4,7 @@ module.exports = {
4
4
  '/tieba/forum/:kw/:sortBy?': ['u3u'],
5
5
  '/tieba/post/:id': ['u3u'],
6
6
  '/tieba/post/lz/:id': ['u3u'],
7
+ '/tieba/search/:qw/:routeParams?': ['JimenezLi'],
7
8
  '/tieba/user/:uid': ['igxlin', 'nczitzk'],
8
9
  '/top/:board?': ['xyqfer'],
9
10
  };
@@ -46,7 +46,7 @@ module.exports = {
46
46
  },
47
47
  {
48
48
  title: '用户帖子',
49
- docs: 'https://docs.rsshub.app/routes/bbs#tie-ba',
49
+ docs: 'https://docs.rsshub.app/routes/bbs#bai-du-tie-ba',
50
50
  source: '/home/main',
51
51
  target: (params, url) => {
52
52
  const uid = new URL(url).searchParams.get('un');
@@ -55,6 +55,20 @@ module.exports = {
55
55
  }
56
56
  },
57
57
  },
58
+ {
59
+ title: '贴吧搜索',
60
+ docs: 'https://docs.rsshub.app/routes/bbs#bai-du-tie-ba',
61
+ source: '/f/search/res',
62
+ target: (params, url) => {
63
+ const searchParams = new URL(url).searchParams;
64
+ const qw = searchParams.get('qw');
65
+ const kw = searchParams.get('kw');
66
+ if (qw) {
67
+ const route = `/baidu/tieba/user/${qw}`;
68
+ return kw ? `${route}/kw=${kw}` : route;
69
+ }
70
+ },
71
+ },
58
72
  ],
59
73
  top: [
60
74
  {
@@ -4,6 +4,7 @@ module.exports = (router) => {
4
4
  router.get('/tieba/forum/:kw/:sortBy?', require('./tieba/forum'));
5
5
  router.get('/tieba/post/:id', require('./tieba/post'));
6
6
  router.get('/tieba/post/lz/:id', require('./tieba/post'));
7
+ router.get('/tieba/search/:qw/:routeParams?', require('./tieba/search'));
7
8
  router.get('/tieba/user/:uid', require('./tieba/user'));
8
9
  router.get('/top/:board?', require('./top'));
9
10
  };
@@ -0,0 +1 @@
1
+ <p>{{ details }}</p><p>{{@ medias }}</p><p>贴吧:{{ tieba }}<br/>作者:{{ author }}</p>
@@ -0,0 +1,63 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const iconv = require('iconv-lite');
4
+ const timezone = require('@/utils/timezone');
5
+ const { parseDate } = require('@/utils/parse-date');
6
+ const { art } = require('@/utils/render');
7
+ const path = require('path');
8
+
9
+ module.exports = async (ctx) => {
10
+ const qw = ctx.params.qw;
11
+ const query = new URLSearchParams(ctx.params.routeParams);
12
+ query.set('ie', 'utf-8');
13
+ query.set('qw', qw);
14
+ query.set('rn', query.get('rn') || 20); // Number of returned items
15
+ const link = `https://tieba.baidu.com/f/search/res?${query.toString()}`;
16
+
17
+ const response = await got.get(link, {
18
+ headers: {
19
+ Referer: 'https://tieba.baidu.com',
20
+ },
21
+ responseType: 'buffer',
22
+ });
23
+ const data = iconv.decode(response.data, 'gbk');
24
+
25
+ const $ = cheerio.load(data);
26
+ const resultList = $('div.s_post');
27
+
28
+ ctx.state.data = {
29
+ title: `${qw} - ${query.get('kw') || '百度贴'}吧搜索`,
30
+ link,
31
+ item: resultList.toArray().map((element) => {
32
+ const item = $(element);
33
+ const titleItem = item.find('.p_title a');
34
+ const title = titleItem.text().trim();
35
+ const link = titleItem.attr('href');
36
+ const time = item.find('.p_date').text().trim();
37
+ const details = item.find('.p_content').text().trim();
38
+ const medias = item
39
+ .find('.p_mediaCont img')
40
+ .toArray()
41
+ .map((element) => {
42
+ const item = $(element);
43
+ return `<img src="${item.attr('original')}">`;
44
+ })
45
+ .join('');
46
+ const tieba = item.find('a.p_forum').text().trim();
47
+ const author = item.find('a').last().text().trim();
48
+
49
+ return {
50
+ title,
51
+ description: art(path.join(__dirname, '../templates/tieba_search.art'), {
52
+ details,
53
+ medias,
54
+ tieba,
55
+ author,
56
+ }),
57
+ author,
58
+ pubDate: timezone(parseDate(time, 'YYYY-MM-DD HH:mm'), +8),
59
+ link,
60
+ };
61
+ }),
62
+ };
63
+ };
@@ -12,6 +12,7 @@ module.exports = {
12
12
  '/tv/subject/:id/blogs': ['ylc395'],
13
13
  '/tv/subject/:id/comments': ['ylc395'],
14
14
  '/tv/subject/:id/topics': ['ylc395'],
15
+ '/tv/subject/:id/:type?/:showOriginalName?': ['JimenezLi'],
15
16
  '/tv/topic/:id': ['ylc395'],
16
17
  '/tv/user/blog/:id': ['nczitzk'],
17
18
  };
@@ -3,55 +3,55 @@ const bangumiTV = {
3
3
  '.': [
4
4
  {
5
5
  title: '小组话题',
6
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
6
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
7
7
  source: '/group/:id',
8
8
  target: '/bangumi/tv/group/:id',
9
9
  },
10
10
  {
11
11
  title: '小组话题的新回复',
12
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
12
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
13
13
  source: '/group/topic/:id',
14
14
  target: '/bangumi/tv/topic/:id',
15
15
  },
16
16
  {
17
17
  title: '现实人物的新作品',
18
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
18
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
19
19
  source: '/person/:id',
20
20
  target: '/bangumi/tv/person/:id',
21
21
  },
22
22
  {
23
23
  title: '用户日志',
24
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
24
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
25
25
  source: '/user/:id',
26
26
  target: '/bangumi/tv/user/blog/:id',
27
27
  },
28
28
  {
29
29
  title: '条目的讨论',
30
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
30
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
31
31
  source: '/subject/:id',
32
32
  target: '/bangumi/tv/subject/:id/topics',
33
33
  },
34
34
  {
35
35
  title: '条目的评论',
36
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
36
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
37
37
  source: '/subject/:id',
38
38
  target: '/bangumi/tv/subject/:id/blogs',
39
39
  },
40
40
  {
41
41
  title: '条目的章节',
42
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
42
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
43
43
  source: '/subject/:id',
44
44
  target: '/bangumi/tv/subject/:id',
45
45
  },
46
46
  {
47
47
  title: '条目的吐槽箱',
48
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
48
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
49
49
  source: '/subject/:id',
50
50
  target: '/bangumi/tv/subject/:id/comments',
51
51
  },
52
52
  {
53
53
  title: '放送列表',
54
- docs: 'https://docs.rsshub.app/routes/anime#bangumi',
54
+ docs: 'https://docs.rsshub.app/routes/anime#bangumi-fan-zu-ji-hua',
55
55
  source: '/calendar',
56
56
  target: '/bangumi/tv/calendar/today',
57
57
  },
@@ -7,8 +7,7 @@ module.exports = function (router) {
7
7
  router.get('/tv/calendar/today', require('./tv/calendar/today'));
8
8
  router.get('/tv/group/:id', require('./tv/group/topic'));
9
9
  router.get('/tv/person/:id', require('./tv/person'));
10
- router.get('/tv/subject/:id', require('./tv/subject'));
11
- router.get('/tv/subject/:id/:type', require('./tv/subject'));
10
+ router.get('/tv/subject/:id/:type?/:showOriginalName?', require('./tv/subject'));
12
11
  router.get('/tv/topic/:id', require('./tv/group/reply'));
13
12
  router.get('/tv/user/blog/:id', require('./tv/user/blog'));
14
13
  };
@@ -2,8 +2,9 @@ const got = require('@/utils/got');
2
2
  const { parseDate } = require('@/utils/parse-date');
3
3
  const { art } = require('@/utils/render');
4
4
  const path = require('path');
5
+ const { getLocalName } = require('./utils');
5
6
 
6
- module.exports = async (subjectID) => {
7
+ module.exports = async (subjectID, showOriginalName) => {
7
8
  const url = `https://api.bgm.tv/subject/${subjectID}?responseGroup=large`;
8
9
  const { data: epsInfo } = await got(url);
9
10
  const activeEps = [];
@@ -15,11 +16,11 @@ module.exports = async (subjectID) => {
15
16
  });
16
17
 
17
18
  return {
18
- title: epsInfo.name_cn || epsInfo.name,
19
+ title: getLocalName(epsInfo, showOriginalName),
19
20
  link: `https://bgm.tv/subject/${subjectID}`,
20
21
  description: epsInfo.summary,
21
22
  item: activeEps.map((e) => ({
22
- title: `ep.${e.sort} ${e.name_cn || e.name}`,
23
+ title: `ep.${e.sort} ${getLocalName(e, showOriginalName)}`,
23
24
  description: art(path.resolve(__dirname, '../../templates/tv/ep.art'), {
24
25
  e,
25
26
  epsInfo,
@@ -1,26 +1,28 @@
1
1
  const getComments = require('./comments.js');
2
2
  const getFromAPI = require('./offcial-subject-api.js');
3
3
  const getEps = require('./ep.js');
4
+ const { queryToBoolean } = require('@/utils/readable-social');
4
5
 
5
6
  module.exports = async (ctx) => {
6
7
  const id = ctx.params.id;
8
+ const type = ctx.params.type || 'ep';
9
+ const showOriginalName = queryToBoolean(ctx.params.showOriginalName);
7
10
  let response;
8
- if (ctx.params.type) {
9
- switch (ctx.params.type) {
10
- case 'comments':
11
- response = await getComments(id, Number(ctx.query.minLength) || 0);
12
- break;
13
- case 'blogs':
14
- response = await getFromAPI('blog')(id);
15
- break;
16
- case 'topics':
17
- response = await getFromAPI('topic')(id);
18
- break;
19
- default:
20
- throw Error(`暂不支持对${ctx.params.type}的订阅`);
21
- }
22
- } else {
23
- response = await getEps(id);
11
+ switch (type) {
12
+ case 'ep':
13
+ response = await getEps(id, showOriginalName);
14
+ break;
15
+ case 'comments':
16
+ response = await getComments(id, Number(ctx.query.minLength) || 0);
17
+ break;
18
+ case 'blogs':
19
+ response = await getFromAPI('blog')(id, showOriginalName);
20
+ break;
21
+ case 'topics':
22
+ response = await getFromAPI('topic')(id, showOriginalName);
23
+ break;
24
+ default:
25
+ throw Error(`暂不支持对${type}的订阅`);
24
26
  }
25
27
  ctx.state.data = response;
26
28
  };
@@ -1,5 +1,6 @@
1
1
  const got = require('@/utils/got');
2
2
  const { parseDate } = require('@/utils/parse-date');
3
+ const { getLocalName } = require('./utils');
3
4
 
4
5
  module.exports = (type) => {
5
6
  const mapping = {
@@ -13,12 +14,12 @@ module.exports = (type) => {
13
14
  },
14
15
  };
15
16
 
16
- return async (subjectID) => {
17
+ return async (subjectID, showOriginalName) => {
17
18
  // 官方提供的条目API文档见 https://github.com/bangumi/api/blob/3f3fa6390c468816f9883d24be488e41f8946159/docs-raw/Subject-API.md
18
19
  const url = `https://api.bgm.tv/subject/${subjectID}?responseGroup=large`;
19
20
  const { data: subjectInfo } = await got(url);
20
21
  return {
21
- title: `${subjectInfo.name_cn || subjectInfo.name}的 Bangumi ${mapping[type].cn}`,
22
+ title: `${getLocalName(subjectInfo, showOriginalName)}的 Bangumi ${mapping[type].cn}`,
22
23
  link: `https://bgm.tv/subject/${subjectInfo.id}/${mapping[type].en}`,
23
24
  item: subjectInfo[type].map((article) => ({
24
25
  title: `${article.user.nickname}:${article.title}`,
@@ -0,0 +1,5 @@
1
+ const getLocalName = (obj, showOriginalName) => (showOriginalName ? obj.name || obj.name_cn : obj.name_cn || obj.name);
2
+
3
+ module.exports = {
4
+ getLocalName,
5
+ };
@@ -16,9 +16,9 @@ module.exports = async (ctx) => {
16
16
  title = 'BBC News 中文网';
17
17
 
18
18
  if (!channel) {
19
- feed = await parser.parseURL('http://www.bbc.co.uk/zhongwen/simp/index.xml');
19
+ feed = await parser.parseURL('https://www.bbc.co.uk/zhongwen/simp/index.xml');
20
20
  } else {
21
- feed = await parser.parseURL(`http://www.bbc.co.uk/zhongwen/simp/${channel}/index.xml`);
21
+ feed = await parser.parseURL(`https://www.bbc.co.uk/zhongwen/simp/${channel}/index.xml`);
22
22
  }
23
23
  break;
24
24
 
@@ -26,9 +26,9 @@ module.exports = async (ctx) => {
26
26
  title = 'BBC News 中文網';
27
27
 
28
28
  if (!channel) {
29
- feed = await parser.parseURL('http://www.bbc.co.uk/zhongwen/trad/index.xml');
29
+ feed = await parser.parseURL('https://www.bbc.co.uk/zhongwen/trad/index.xml');
30
30
  } else {
31
- feed = await parser.parseURL(`http://www.bbc.co.uk/zhongwen/trad/${channel}/index.xml`);
31
+ feed = await parser.parseURL(`https://www.bbc.co.uk/zhongwen/trad/${channel}/index.xml`);
32
32
  }
33
33
  link = 'https://www.bbc.com/zhongwen/trad';
34
34
  break;
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '/:channel': ['HenryQW', 'DIYgod'],
3
+ '/:lang/:channel?': ['HenryQW'],
4
+ };
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ 'bbc.com': {
3
+ _name: 'BBC',
4
+ '.': [
5
+ {
6
+ title: 'News',
7
+ docs: 'https://docs.rsshub.app/routes/traditional-media#bbc',
8
+ },
9
+ ],
10
+ },
11
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = (router) => {
2
+ router.get('/:site?/:channel?', require('./index'));
3
+ };