karin-plugin-kkk 2.27.6 → 2.28.0

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 (83) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +10 -0
  3. package/lib/apps/__ready.js +1 -1
  4. package/lib/apps/admin.js +1 -1
  5. package/lib/apps/help.js +1 -1
  6. package/lib/apps/push.js +1 -1
  7. package/lib/apps/qrlogin.js +1 -1
  8. package/lib/apps/statistics.js +1 -1
  9. package/lib/apps/tools.js +1 -1
  10. package/lib/apps/update.js +1 -1
  11. package/lib/build-metadata.json +5 -5
  12. package/lib/core_chunk/ArticleWork-Cf2wg9Q_.js +2 -0
  13. package/lib/core_chunk/Comment-BEabtQCx.js +2 -0
  14. package/lib/core_chunk/Comment-BKNxGmvx.js +2 -0
  15. package/lib/core_chunk/{Comment-vmLpukdO.js → Comment-Dw8SoTxB.js} +1 -1
  16. package/lib/core_chunk/Comment-dJPgOsHg.js +2 -0
  17. package/lib/core_chunk/{DYNAMIC_TYPE_ARTICLE-RG5B0GYl.js → DYNAMIC_TYPE_ARTICLE-Bo-JumZT.js} +1 -1
  18. package/lib/core_chunk/{DYNAMIC_TYPE_AV-BFmgJoig.js → DYNAMIC_TYPE_AV-CBybyWZh.js} +1 -1
  19. package/lib/core_chunk/{DYNAMIC_TYPE_DRAW-Be8d7lCg.js → DYNAMIC_TYPE_DRAW-BUAkJ1bE.js} +1 -1
  20. package/lib/core_chunk/{DYNAMIC_TYPE_FORWARD-SRgseEdb.js → DYNAMIC_TYPE_FORWARD-CSYK27d2.js} +1 -1
  21. package/lib/core_chunk/{DYNAMIC_TYPE_LIVE_RCMD-CDBDKK4u.js → DYNAMIC_TYPE_LIVE_RCMD-C8K6WYKF.js} +1 -1
  22. package/lib/core_chunk/{DYNAMIC_TYPE_WORD-D_qb-nmj.js → DYNAMIC_TYPE_WORD-BuNbnDzf.js} +1 -1
  23. package/lib/core_chunk/Dynamic-BWX_To7C.js +2 -0
  24. package/lib/core_chunk/FavoriteList-DaQFF0RD.js +2 -0
  25. package/lib/core_chunk/GlobalStatistics-Bbm3ena3.js +2 -0
  26. package/lib/core_chunk/GroupStatistics-C8m4Kamg.js +2 -0
  27. package/lib/core_chunk/Help-C2Cty5bZ.js +2 -0
  28. package/lib/core_chunk/ImageWork-D-rNxAZ-.js +2 -0
  29. package/lib/core_chunk/Live-RwbN5-Pa.js +2 -0
  30. package/lib/core_chunk/MusicInfo-vIO3Dk72.js +2 -0
  31. package/lib/core_chunk/RecommendList-CfL3NObV.js +2 -0
  32. package/lib/core_chunk/UserList-BnkvIKGk.js +2 -0
  33. package/lib/core_chunk/UserList-C-xAqgdb.js +2 -0
  34. package/lib/core_chunk/UserVideoList-Bv57ruL6.js +2 -0
  35. package/lib/core_chunk/VersionWarning-AS6hvDl-.js +2 -0
  36. package/lib/core_chunk/VideoWork-DlYMb7Rg.js +2 -0
  37. package/lib/core_chunk/amagiClient-SgOj0Cnj.js +2 -0
  38. package/lib/core_chunk/bangumi-D0FPqxGs.js +2 -0
  39. package/lib/core_chunk/changelog-C-q414my.js +2 -0
  40. package/lib/core_chunk/db-DZJ-S_3-.js +2 -0
  41. package/lib/core_chunk/handlerError-Dq1bZgpj.js +2 -0
  42. package/lib/core_chunk/{main-CH1PySBD.js → main-BJbcEr2g.js} +973 -100
  43. package/lib/core_chunk/{noteInfo-Cc0CdOh6.js → noteInfo-Yj8--L6W.js} +1 -1
  44. package/lib/core_chunk/qrcodeImg-E84au8P-.js +2 -0
  45. package/lib/core_chunk/qrcodeImg-_PrtNVpy.js +2 -0
  46. package/lib/core_chunk/qrlogin-B1QlI5rQ.js +2 -0
  47. package/lib/core_chunk/setup-q0rQSX1D.js +2 -0
  48. package/lib/core_chunk/template.js +1 -1
  49. package/lib/core_chunk/videoInfo-BYOWM8o4.js +2 -0
  50. package/lib/core_chunk/videoInfo-CzlHwaaV.js +2 -0
  51. package/lib/index.js +1 -1
  52. package/lib/root.js +1 -1
  53. package/lib/web.config.js +1 -1
  54. package/package.json +2 -2
  55. package/lib/core_chunk/ArticleWork-DM-2P7yk.js +0 -2
  56. package/lib/core_chunk/Comment-C7DipcGk.js +0 -2
  57. package/lib/core_chunk/Comment-DyzgsNH4.js +0 -2
  58. package/lib/core_chunk/Comment-_ehzzbCT.js +0 -2
  59. package/lib/core_chunk/Dynamic-C7sZ7_VA.js +0 -2
  60. package/lib/core_chunk/FavoriteList-BKRXkpgr.js +0 -2
  61. package/lib/core_chunk/GlobalStatistics-D5SYUMFx.js +0 -2
  62. package/lib/core_chunk/GroupStatistics-Mkeip-kD.js +0 -2
  63. package/lib/core_chunk/Help-CSQsl-iG.js +0 -2
  64. package/lib/core_chunk/ImageWork-BjlkvEZl.js +0 -2
  65. package/lib/core_chunk/Live-CBi-Jg5R.js +0 -2
  66. package/lib/core_chunk/MusicInfo-CgN5WBVO.js +0 -2
  67. package/lib/core_chunk/RecommendList-CVmqCepV.js +0 -2
  68. package/lib/core_chunk/UserList-BvG2QasY.js +0 -2
  69. package/lib/core_chunk/UserList-CTZhILez.js +0 -2
  70. package/lib/core_chunk/UserVideoList-B7KG12MD.js +0 -2
  71. package/lib/core_chunk/VersionWarning--dZBxhCO.js +0 -2
  72. package/lib/core_chunk/VideoWork-CLCN8U6n.js +0 -2
  73. package/lib/core_chunk/amagiClient-DutWjgMV.js +0 -2
  74. package/lib/core_chunk/bangumi-U94Tg-9H.js +0 -2
  75. package/lib/core_chunk/changelog-COLIz9yq.js +0 -2
  76. package/lib/core_chunk/db-DQ021gxp.js +0 -2
  77. package/lib/core_chunk/handlerError-CZimBCI0.js +0 -2
  78. package/lib/core_chunk/qrcodeImg-Cwm5rWx0.js +0 -2
  79. package/lib/core_chunk/qrcodeImg-DLK0ebMK.js +0 -2
  80. package/lib/core_chunk/qrlogin-V7NbxsLi.js +0 -2
  81. package/lib/core_chunk/setup-R3MsfOHe.js +0 -2
  82. package/lib/core_chunk/videoInfo-BsvVR1g1.js +0 -2
  83. package/lib/core_chunk/videoInfo-CZIF1cOh.js +0 -2
@@ -21,7 +21,7 @@ import { snapka } from "@snapka/puppeteer";
21
21
  import { newInjectedPage } from "fingerprint-injector";
22
22
  import express from "node-karin/express";
23
23
  globalThis.__kkkLoadStart ??= process.hrtime.bigint();
24
- import("./setup-R3MsfOHe.js");
24
+ import("./setup-q0rQSX1D.js");
25
25
  var resolvePluginRoot = (startUrl) => {
26
26
  let dir = path.dirname(startUrl);
27
27
  for (let i = 0; i < 8; i++) {
@@ -4822,7 +4822,764 @@ var createKuaishouRoutes = (cookie, requestConfig = getKuaishouDefaultConfig(coo
4822
4822
  for (const [method, path] of Object.entries(KuaishouMethodRoutes)) router.get(path, createKuaishouValidationMiddleware(method), createKuaishouRouteHandler(method, cookie, requestConfig));
4823
4823
  return router;
4824
4824
  };
4825
+ var KUAISHOU_HUDR_PREFIX = "HUDR_";
4826
+ var KUAISHOU_HUDR_MASK_BYTE = 35;
4827
+ var KUAISHOU_HUDR_BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
4828
+ var KUAISHOU_HUDR_CHACHA_KEY = [
4829
+ 4183807412,
4830
+ 394484062,
4831
+ 1106561997,
4832
+ 2378328696,
4833
+ 630790222,
4834
+ 2546784104,
4835
+ 2891127470,
4836
+ 1922531795
4837
+ ];
4838
+ var KUAISHOU_HUDR_CHACHA_NONCE = [
4839
+ 2215853858,
4840
+ 1643070585,
4841
+ 1849059804
4842
+ ];
4843
+ var toCodePointArray = (value) => Array.from(value).map((char) => char.codePointAt(0) ?? 0);
4844
+ var toLittleEndianBytes = (value, size = 4) => {
4845
+ if (size >= 4 && value >= Math.pow(2, 32)) return [
4846
+ 255,
4847
+ 255,
4848
+ 255,
4849
+ 255
4850
+ ];
4851
+ const result = [];
4852
+ for (let index = 0; index <= size - 1; index++) result[index] = value >>> 8 * index & 255;
4853
+ return result;
4854
+ };
4855
+ var encodeBase64Slice = (bytes, start, end) => {
4856
+ const result = [];
4857
+ for (let index = start; index < end; index += 3) {
4858
+ const value = (bytes[index] << 16 & 16711680) + (bytes[index + 1] << 8 & 65280) + (bytes[index + 2] & 255);
4859
+ result.push(KUAISHOU_HUDR_BASE64_ALPHABET[value >> 18 & 63], KUAISHOU_HUDR_BASE64_ALPHABET[value >> 12 & 63], KUAISHOU_HUDR_BASE64_ALPHABET[value >> 6 & 63], KUAISHOU_HUDR_BASE64_ALPHABET[value & 63]);
4860
+ }
4861
+ return result.join("");
4862
+ };
4863
+ var encodeBase64Url = (bytes) => {
4864
+ const result = [];
4865
+ const remainder = bytes.length % 3;
4866
+ const tripletLength = bytes.length - remainder;
4867
+ for (let index = 0; index < tripletLength; index += 16383) {
4868
+ const end = tripletLength < index + 16383 ? tripletLength : index + 16383;
4869
+ result.push(encodeBase64Slice(bytes, index, end));
4870
+ }
4871
+ if (remainder === 1) {
4872
+ const value = bytes[bytes.length - 1];
4873
+ result.push(KUAISHOU_HUDR_BASE64_ALPHABET[value >> 2], KUAISHOU_HUDR_BASE64_ALPHABET[value << 4 & 63], "==");
4874
+ } else if (remainder === 2) {
4875
+ const value = (bytes[bytes.length - 2] << 8) + bytes[bytes.length - 1];
4876
+ result.push(KUAISHOU_HUDR_BASE64_ALPHABET[value >> 10], KUAISHOU_HUDR_BASE64_ALPHABET[value >> 4 & 63], KUAISHOU_HUDR_BASE64_ALPHABET[value << 2 & 63], "=");
4877
+ }
4878
+ return result.join("").replace(/[+/=]/g, (char) => {
4879
+ if (char === "+") return "-";
4880
+ if (char === "/") return "_";
4881
+ return ".";
4882
+ });
4883
+ };
4884
+ var KuaishouChaChaCipher = class {
4885
+ wordIndex = 0;
4886
+ state = new Array(16).fill(0);
4887
+ constructor(key, nonce) {
4888
+ this.key = key;
4889
+ this.nonce = nonce;
4890
+ }
4891
+ rotateLeft(value, shift) {
4892
+ return (value << shift | value >>> 32 - shift) >>> 0;
4893
+ }
4894
+ quarterRound(target, a, b, c, d) {
4895
+ target[a] = target[a] + target[b] >>> 0;
4896
+ target[d] ^= target[a];
4897
+ target[d] = this.rotateLeft(target[d], 16);
4898
+ target[c] = target[c] + target[d] >>> 0;
4899
+ target[b] ^= target[c];
4900
+ target[b] = this.rotateLeft(target[b], 12);
4901
+ target[a] = target[a] + target[b] >>> 0;
4902
+ target[d] ^= target[a];
4903
+ target[d] = this.rotateLeft(target[d], 8);
4904
+ target[c] = target[c] + target[d] >>> 0;
4905
+ target[b] ^= target[c];
4906
+ target[b] = this.rotateLeft(target[b], 7);
4907
+ }
4908
+ refillBlock() {
4909
+ const working = this.state.slice();
4910
+ for (let round = 0; round < 20; round += 2) {
4911
+ this.quarterRound(working, 0, 4, 8, 12);
4912
+ this.quarterRound(working, 1, 5, 9, 13);
4913
+ this.quarterRound(working, 2, 6, 10, 14);
4914
+ this.quarterRound(working, 3, 7, 11, 15);
4915
+ this.quarterRound(working, 0, 5, 10, 15);
4916
+ this.quarterRound(working, 1, 6, 11, 12);
4917
+ this.quarterRound(working, 2, 7, 8, 13);
4918
+ this.quarterRound(working, 3, 4, 9, 14);
4919
+ }
4920
+ const mixedState = new Array(16).fill(0);
4921
+ for (let index = 0; index < 16; index++) mixedState[index] = working[index] + this.state[index] >>> 0;
4922
+ return mixedState;
4923
+ }
4924
+ encrypt(input) {
4925
+ this.wordIndex = 0;
4926
+ this.state[0] = 394484062;
4927
+ this.state[1] = 2378328696;
4928
+ this.state[2] = 630790222;
4929
+ this.state[3] = 1922531795;
4930
+ for (let index = 0; index < 8; index++) this.state[index + 4] = this.key[index] >>> 0;
4931
+ this.state[12] = 1;
4932
+ this.state[13] = this.nonce[0] >>> 0;
4933
+ this.state[14] = this.nonce[1] >>> 0;
4934
+ this.state[15] = this.nonce[2] >>> 0;
4935
+ let mixedState = this.refillBlock();
4936
+ const output = new Uint8Array(input.length);
4937
+ for (let index = 0; index < input.length; index++) {
4938
+ if (this.wordIndex === 64) {
4939
+ this.state[12] = this.state[12] + 1 >>> 0;
4940
+ mixedState = this.refillBlock();
4941
+ this.wordIndex = 0;
4942
+ }
4943
+ const keystreamByte = mixedState[this.wordIndex >> 2] >>> ((this.wordIndex & 3) << 3) & 255;
4944
+ this.wordIndex += 1;
4945
+ output[index] = input[index] ^ keystreamByte;
4946
+ }
4947
+ return output;
4948
+ }
4949
+ };
4950
+ var buildKuaishouHudrInfoCache = (scriptCount = 0) => [68, 0].concat(toLittleEndianBytes(scriptCount, 4));
4951
+ var buildKuaishouHudrPayload = (context) => {
4952
+ const stackTail = context.secs?.s ?? "";
4953
+ const secsCount = context.secs?.c ?? 0;
4954
+ const count = context.count || 0;
4955
+ return [
4956
+ 45,
4957
+ 61,
4958
+ 0,
4959
+ 2
4960
+ ].concat(buildKuaishouHudrInfoCache(context.scriptCount)).concat([112, 0], toLittleEndianBytes(count, 4)).concat([114, 1], toLittleEndianBytes(stackTail.length, 2), toCodePointArray(stackTail)).concat([115, 0], toLittleEndianBytes(secsCount, 4));
4961
+ };
4962
+ var maskKuaishouHudrPayload = (payload) => {
4963
+ const masked = new Uint8Array(payload.length);
4964
+ for (let index = 0; index < payload.length; index++) masked[index] = KUAISHOU_HUDR_MASK_BYTE ^ payload[index];
4965
+ return masked;
4966
+ };
4967
+ var deriveKuaishouHudrBody = (context) => {
4968
+ const maskedPayload = maskKuaishouHudrPayload(buildKuaishouHudrPayload(context));
4969
+ const body = encodeBase64Url(new KuaishouChaChaCipher(KUAISHOU_HUDR_CHACHA_KEY, KUAISHOU_HUDR_CHACHA_NONCE).encrypt(maskedPayload));
4970
+ return {
4971
+ body,
4972
+ full: `${KUAISHOU_HUDR_PREFIX}${body}`,
4973
+ infoCache: buildKuaishouHudrInfoCache(context.scriptCount),
4974
+ maskedPayload,
4975
+ nextCount: context.count + 1
4976
+ };
4977
+ };
4978
+ var KUAISHOU_BLAKE2S_IV = [
4979
+ 2837534710,
4980
+ 2845986804,
4981
+ 2436420605,
4982
+ 706843635,
4983
+ 719254516,
4984
+ 2557931286,
4985
+ 2596197199,
4986
+ 2432949778
4987
+ ];
4988
+ var KUAISHOU_BLAKE2S_SIGMA = [
4989
+ [
4990
+ 0,
4991
+ 1,
4992
+ 2,
4993
+ 3,
4994
+ 4,
4995
+ 5,
4996
+ 6,
4997
+ 7,
4998
+ 8,
4999
+ 9,
5000
+ 10,
5001
+ 11,
5002
+ 12,
5003
+ 13,
5004
+ 14,
5005
+ 15
5006
+ ],
5007
+ [
5008
+ 14,
5009
+ 10,
5010
+ 4,
5011
+ 8,
5012
+ 9,
5013
+ 15,
5014
+ 13,
5015
+ 6,
5016
+ 1,
5017
+ 12,
5018
+ 0,
5019
+ 2,
5020
+ 11,
5021
+ 7,
5022
+ 5,
5023
+ 3
5024
+ ],
5025
+ [
5026
+ 11,
5027
+ 8,
5028
+ 12,
5029
+ 0,
5030
+ 5,
5031
+ 2,
5032
+ 15,
5033
+ 13,
5034
+ 10,
5035
+ 14,
5036
+ 3,
5037
+ 6,
5038
+ 7,
5039
+ 1,
5040
+ 9,
5041
+ 4
5042
+ ],
5043
+ [
5044
+ 7,
5045
+ 9,
5046
+ 3,
5047
+ 1,
5048
+ 13,
5049
+ 12,
5050
+ 11,
5051
+ 14,
5052
+ 2,
5053
+ 6,
5054
+ 5,
5055
+ 10,
5056
+ 4,
5057
+ 0,
5058
+ 15,
5059
+ 8
5060
+ ],
5061
+ [
5062
+ 9,
5063
+ 0,
5064
+ 5,
5065
+ 7,
5066
+ 2,
5067
+ 4,
5068
+ 10,
5069
+ 15,
5070
+ 14,
5071
+ 1,
5072
+ 11,
5073
+ 12,
5074
+ 6,
5075
+ 8,
5076
+ 3,
5077
+ 13
5078
+ ],
5079
+ [
5080
+ 2,
5081
+ 12,
5082
+ 6,
5083
+ 10,
5084
+ 0,
5085
+ 11,
5086
+ 8,
5087
+ 3,
5088
+ 4,
5089
+ 13,
5090
+ 7,
5091
+ 5,
5092
+ 15,
5093
+ 14,
5094
+ 1,
5095
+ 9
5096
+ ],
5097
+ [
5098
+ 12,
5099
+ 5,
5100
+ 1,
5101
+ 15,
5102
+ 14,
5103
+ 13,
5104
+ 4,
5105
+ 10,
5106
+ 0,
5107
+ 7,
5108
+ 6,
5109
+ 3,
5110
+ 9,
5111
+ 2,
5112
+ 8,
5113
+ 11
5114
+ ],
5115
+ [
5116
+ 13,
5117
+ 11,
5118
+ 7,
5119
+ 14,
5120
+ 12,
5121
+ 1,
5122
+ 3,
5123
+ 9,
5124
+ 5,
5125
+ 0,
5126
+ 15,
5127
+ 4,
5128
+ 8,
5129
+ 6,
5130
+ 2,
5131
+ 10
5132
+ ],
5133
+ [
5134
+ 6,
5135
+ 15,
5136
+ 14,
5137
+ 9,
5138
+ 11,
5139
+ 3,
5140
+ 0,
5141
+ 8,
5142
+ 12,
5143
+ 2,
5144
+ 13,
5145
+ 7,
5146
+ 1,
5147
+ 4,
5148
+ 10,
5149
+ 5
5150
+ ],
5151
+ [
5152
+ 10,
5153
+ 2,
5154
+ 8,
5155
+ 4,
5156
+ 7,
5157
+ 6,
5158
+ 1,
5159
+ 5,
5160
+ 15,
5161
+ 11,
5162
+ 9,
5163
+ 14,
5164
+ 3,
5165
+ 12,
5166
+ 13,
5167
+ 0
5168
+ ]
5169
+ ];
5170
+ var KUAISHOU_CTS_STATE_VECTOR = new Int8Array([
5171
+ 98,
5172
+ 0,
5173
+ 0,
5174
+ 128,
5175
+ 49,
5176
+ 117,
5177
+ 185,
5178
+ 253,
5179
+ 224,
5180
+ 172,
5181
+ 104,
5182
+ 36,
5183
+ 223,
5184
+ 155,
5185
+ 87,
5186
+ 19,
5187
+ 32,
5188
+ 0,
5189
+ 0,
5190
+ 64,
5191
+ 2,
5192
+ 0,
5193
+ 0,
5194
+ 16,
5195
+ 255,
5196
+ 255,
5197
+ 255,
5198
+ 127,
5199
+ 255,
5200
+ 255,
5201
+ 255,
5202
+ 63,
5203
+ 0,
5204
+ 0,
5205
+ 0,
5206
+ 240,
5207
+ 0,
5208
+ 0,
5209
+ 0,
5210
+ 192,
5211
+ 0,
5212
+ 0,
5213
+ 0,
5214
+ 128,
5215
+ 255,
5216
+ 255,
5217
+ 255,
5218
+ 15
5219
+ ]);
5220
+ var rotateRight = (value, shift) => (value >>> shift | value << 32 - shift) >>> 0;
5221
+ var toUtf8Int8Array = (value) => new Int8Array(unescape(encodeURIComponent(value)).split("").map((char) => char.charCodeAt(0) || 0));
5222
+ var toHex32 = (value) => (value >>> 0).toString(16).padStart(8, "0");
5223
+ var blake2sQuarterRound = (state, a, b, c, d, x, y) => {
5224
+ state[a] = state[a] + state[b] + x >>> 0;
5225
+ state[d] = rotateRight(state[d] ^ state[a], 16);
5226
+ state[c] = state[c] + state[d] >>> 0;
5227
+ state[b] = rotateRight(state[b] ^ state[c], 12);
5228
+ state[a] = state[a] + state[b] + y >>> 0;
5229
+ state[d] = rotateRight(state[d] ^ state[a], 8);
5230
+ state[c] = state[c] + state[d] >>> 0;
5231
+ state[b] = rotateRight(state[b] ^ state[c], 7);
5232
+ };
5233
+ var blake2sCompress = (hash, words, offset, counter, length, isLastBlock) => {
5234
+ const work = new Array(16).fill(0);
5235
+ const block = new Array(16).fill(0);
5236
+ for (let index = 0; index < 8; index++) {
5237
+ work[index] = hash[index] >>> 0;
5238
+ work[index + 8] = KUAISHOU_BLAKE2S_IV[index] >>> 0;
5239
+ }
5240
+ work[12] ^= counter >>> 0;
5241
+ if (isLastBlock) work[14] ^= 4294967295;
5242
+ for (let index = 0; index < length; index++) block[index % 16] ^= words[offset + index] >>> 0;
5243
+ for (const sigma of KUAISHOU_BLAKE2S_SIGMA) {
5244
+ blake2sQuarterRound(work, 0, 4, 8, 12, block[sigma[0]], block[sigma[1]]);
5245
+ blake2sQuarterRound(work, 1, 5, 9, 13, block[sigma[2]], block[sigma[3]]);
5246
+ blake2sQuarterRound(work, 2, 6, 10, 14, block[sigma[4]], block[sigma[5]]);
5247
+ blake2sQuarterRound(work, 3, 7, 11, 15, block[sigma[6]], block[sigma[7]]);
5248
+ blake2sQuarterRound(work, 0, 5, 10, 15, block[sigma[8]], block[sigma[9]]);
5249
+ blake2sQuarterRound(work, 1, 6, 11, 12, block[sigma[10]], block[sigma[11]]);
5250
+ blake2sQuarterRound(work, 2, 7, 8, 13, block[sigma[12]], block[sigma[13]]);
5251
+ blake2sQuarterRound(work, 3, 4, 9, 14, block[sigma[14]], block[sigma[15]]);
5252
+ }
5253
+ for (let index = 0; index < 8; index++) hash[index] = (hash[index] ^ work[index] ^ work[index + 8]) >>> 0;
5254
+ return hash;
5255
+ };
5256
+ var deriveB2hasWords = (value) => {
5257
+ const utf8 = toUtf8Int8Array(value);
5258
+ const padding = utf8.length % 4 === 0 ? 0 : 4 - utf8.length % 4;
5259
+ const padded = new Int8Array(utf8.length + padding);
5260
+ for (let index = 0; index < utf8.length; index++) padded[index] = utf8[index];
5261
+ const words = new Array(padded.length / 4);
5262
+ for (let index = 0; index < padded.length; index += 4) words[index / 4] = new Int32Array(padded.slice(index, index + 4).buffer)[0];
5263
+ return words;
5264
+ };
5265
+ var deriveB2hasHash = (words) => {
5266
+ const hash = KUAISHOU_BLAKE2S_IV.slice();
5267
+ hash[0] ^= 16842784;
5268
+ let offset = 0;
5269
+ let length = words.length;
5270
+ let counter = 0;
5271
+ while (length > 64) {
5272
+ length -= 64;
5273
+ counter += 64;
5274
+ blake2sCompress(hash, words, offset, counter, 64, false);
5275
+ offset += 64;
5276
+ }
5277
+ return blake2sCompress(hash, words, offset, counter + length, length, true);
5278
+ };
5279
+ var deriveKuaishouB2has = (value) => deriveB2hasHash(deriveB2hasWords(value)).map(toHex32).join("");
5280
+ var deriveKuaishouB2sa = (value) => toUtf8Int8Array(deriveKuaishouB2has(value));
5281
+ var createKuaishouCtsState = () => ({
5282
+ s: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(12, 16).buffer)[0],
5283
+ u: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(8, 12).buffer)[0],
5284
+ c: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(4, 8).buffer)[0],
5285
+ l: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(0, 4).buffer)[0],
5286
+ p: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(16, 20).buffer)[0],
5287
+ f: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(20, 24).buffer)[0],
5288
+ d: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(24, 28).buffer)[0],
5289
+ y: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(28, 32).buffer)[0],
5290
+ h: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(44, 48).buffer)[0],
5291
+ E: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(40, 44).buffer)[0],
5292
+ m: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(36, 40).buffer)[0],
5293
+ b: new Int32Array(KUAISHOU_CTS_STATE_VECTOR.slice(32, 36).buffer)[0]
5294
+ });
5295
+ var seedKuaishouCtsState = (state, seed) => {
5296
+ const chars = new Int8Array(seed.split("").map((char) => char.codePointAt(0) ?? 0)).slice(0, seed.length);
5297
+ for (let index = 0; index < 4; index++) {
5298
+ state.s = (state.s <<= 8) | chars[index + 4];
5299
+ state.u = (state.u <<= 8) | chars[index + 4];
5300
+ state.c = (state.c <<= 8) | chars[index + 4];
5301
+ }
5302
+ if (state.s === 0) state.s = 324508639;
5303
+ if (state.u === 0) state.u = 610839776;
5304
+ if (state.c === 0) state.c = 4256789809;
5305
+ };
5306
+ var deriveKuaishouCtsByte = (state, value) => {
5307
+ let result = 0;
5308
+ let rightBit = 1 & state.u;
5309
+ let leftBit = 1 & state.c;
5310
+ for (let index = 0; index < 8; index++) {
5311
+ if (1 & state.s) {
5312
+ state.s = state.s ^ state.l >> 1 & 4294967295 | state.E;
5313
+ rightBit = 1 & state.u ? (state.u = state.u ^ state.p >> 1 & 4294967295 | state.m, 1) : (state.u = state.u >> 1 & 4294967295 & state.y, 0);
5314
+ } else {
5315
+ state.s = state.s >> 1 & 4294967295 & state.d;
5316
+ leftBit = 1 & state.c ? (state.c = state.c ^ state.f >> 1 & 4294967295 | state.b, 1) : (state.c = state.c >> 1 & 4294967295 & state.h, 0);
5317
+ }
5318
+ const mixed = result << 1 & 4294967295 | rightBit ^ leftBit;
5319
+ result = mixed > 127 ? mixed - 256 : mixed < -128 ? mixed + 256 : mixed;
5320
+ }
5321
+ return value ^ result + 3;
5322
+ };
5323
+ var deriveKuaishouCts = (input) => {
5324
+ const state = createKuaishouCtsState();
5325
+ seedKuaishouCtsState(state, "Vuz4fCHxn1CO");
5326
+ const result = new Int8Array(input.length);
5327
+ for (let index = 0; index < input.length; index++) result[index] = deriveKuaishouCtsByte(state, input[index]);
5328
+ return result;
5329
+ };
5330
+ var bytesToLowerHex = (bytes) => {
5331
+ let result = "";
5332
+ for (const byte of Array.from(bytes)) {
5333
+ const value = byte & 255;
5334
+ result += value === 0 ? "00" : `${value < 16 ? "0" : ""}${value.toString(16)}`;
5335
+ }
5336
+ return result;
5337
+ };
5338
+ var hexToSignedBytes = (value) => {
5339
+ const result = [];
5340
+ for (let index = 0; index < value.length; index += 2) {
5341
+ const parsed = parseInt(value.slice(index, index + 2), 16);
5342
+ const range = Math.pow(2, value.slice(index, index + 2).length / 2 * 8);
5343
+ result.push(parsed > range / 2 - 1 ? parsed - range : parsed);
5344
+ }
5345
+ return result;
5346
+ };
5347
+ var xorByteArrays = (left, right) => {
5348
+ let index = 0;
5349
+ const result = new Int8Array(left.length);
5350
+ while (index < left.length) for (let rightIndex = 0; rightIndex < right.length && index < left.length; rightIndex++) {
5351
+ result[index] = left[index] ^ 255 & right[rightIndex];
5352
+ index += 1;
5353
+ }
5354
+ return result;
5355
+ };
5356
+ var toLittleEndianHex = (value, size) => {
5357
+ const normalized = BigInt.asUintN(size * 8, typeof value === "bigint" ? value : BigInt(Math.trunc(value)));
5358
+ let result = "";
5359
+ for (let index = 0; index < size; index++) {
5360
+ const byte = Number(normalized >> BigInt(8 * index) & 255n);
5361
+ result += byte.toString(16).padStart(2, "0");
5362
+ }
5363
+ return result;
5364
+ };
5365
+ var computeKuaishouLrcHex = (sourceHex) => (-hexToSignedBytes(sourceHex).reduce((total, value) => total + (value & 255), 0) & 255).toString(16).padStart(2, "0");
5366
+ var transformKuaishouHeHex = (prefixHex, checksumHex) => {
5367
+ const input = hexToSignedBytes(`${prefixHex}${checksumHex}`);
5368
+ const output = new Int8Array(input.length);
5369
+ const xorKey = input[input.length - 1];
5370
+ for (let index = 0; index < input.length - 1; index++) output[index] = input[index] ^ xorKey;
5371
+ output[input.length - 1] = xorKey;
5372
+ return bytesToLowerHex(output);
5373
+ };
5374
+ var KUAISHOU_HE_HEADER_HEX = "4B54";
5375
+ var KUAISHOU_HE_VERSION_HEX = "cda9";
5376
+ var KUAISHOU_HE_STARTUP_MARKER_HEX = "ab";
5377
+ var KUAISHOU_HE_FIXED_BODY_HEX = "0100000001";
5378
+ var KUAISHOU_HE_INPUT_XOR_MASK = [
5379
+ 45,
5380
+ 211,
5381
+ 69,
5382
+ 192
5383
+ ];
5384
+ var KUAISHOU_HE_COUNTER_XOR_MASK = 3131873467;
5385
+ var KUAISHOU_HE_TIME_XOR_MASK = 3360347992n;
5386
+ var KUAISHOU_HE_TAIL_HEX = "9b563eda7b563e";
5387
+ var KUAISHOU_HE_RANDOM_MAX = 0xffffffffffff;
5388
+ var deriveKuaishouHeHashFieldHex = (signInput, hudrBody) => bytesToLowerHex(xorByteArrays(hexToSignedBytes(bytesToLowerHex(deriveKuaishouCts(deriveKuaishouB2sa(`${signInput}HUDR_${hudrBody}`))).slice(0, 8)), KUAISHOU_HE_INPUT_XOR_MASK));
5389
+ var deriveKuaishouHeHex = (context) => {
5390
+ const random48 = Math.floor(context.randomValue * KUAISHOU_HE_RANDOM_MAX);
5391
+ const hashFieldHex = deriveKuaishouHeHashFieldHex(context.signInput, context.hudrBody);
5392
+ const timeXor = BigInt(context.timestamp) ^ KUAISHOU_HE_TIME_XOR_MASK;
5393
+ const preHex = [
5394
+ KUAISHOU_HE_HEADER_HEX,
5395
+ KUAISHOU_HE_VERSION_HEX,
5396
+ KUAISHOU_HE_STARTUP_MARKER_HEX,
5397
+ toLittleEndianHex(context.startupRandom, 6),
5398
+ toLittleEndianHex(random48, 6),
5399
+ KUAISHOU_HE_FIXED_BODY_HEX,
5400
+ toLittleEndianHex(context.count ^ KUAISHOU_HE_COUNTER_XOR_MASK, 4),
5401
+ hashFieldHex,
5402
+ toLittleEndianHex(timeXor, 6),
5403
+ KUAISHOU_HE_TAIL_HEX,
5404
+ computeKuaishouLrcHex(KUAISHOU_HE_TAIL_HEX)
5405
+ ].join("");
5406
+ return {
5407
+ finalHex: transformKuaishouHeHex(preHex, computeKuaishouLrcHex(preHex)),
5408
+ hashFieldHex,
5409
+ preHex
5410
+ };
5411
+ };
5412
+ var deriveKuaishouPureSignature = (context) => {
5413
+ const hudr = deriveKuaishouHudrBody(context);
5414
+ const he = deriveKuaishouHeHex({
5415
+ count: context.count,
5416
+ hudrBody: hudr.body,
5417
+ randomValue: context.randomValue,
5418
+ signInput: context.signInput,
5419
+ startupRandom: context.startupRandom,
5420
+ timestamp: context.timestamp
5421
+ });
5422
+ return {
5423
+ ...hudr,
5424
+ he,
5425
+ signResult: `${hudr.full}$HE_${he.finalHex}`
5426
+ };
5427
+ };
5428
+ var SIGN_INPUT_SKIP_KEYWORD = "__NS";
5429
+ var KUAISHOU_ANONYMOUS_KWW_KEY = "K8wm5PvY9nX7qJc2";
5430
+ var KUAISHOU_ANONYMOUS_KWW_SUFFIX = "###ssrd";
5431
+ var KUAISHOU_ANONYMOUS_KWW_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
5432
+ var kuaishouAnonymousKwwCache = "";
5433
+ var compareLexicographically = (left, right) => {
5434
+ if (left === right) return 0;
5435
+ return left < right ? -1 : 1;
5436
+ };
5437
+ var toComparableEntry = (key, value) => {
5438
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) return `${key}=[object Object]`;
5439
+ return `${key}=${String(value)}`;
5440
+ };
5441
+ var normalizePathname = (urlOrPath) => {
5442
+ try {
5443
+ return new URL(urlOrPath).pathname;
5444
+ } catch {
5445
+ return urlOrPath.split("?")[0] ?? urlOrPath;
5446
+ }
5447
+ };
5448
+ var sortSearchParams = (searchParams) => [...searchParams.entries()].sort(([leftKey], [rightKey]) => compareLexicographically(leftKey, rightKey)).reduce((result, [key, value]) => {
5449
+ result[key] = value;
5450
+ return result;
5451
+ }, {});
5452
+ var resolveKuaishouHxfalconSignPath = (urlOrPath, signPath) => {
5453
+ const pathname = normalizePathname(signPath ?? urlOrPath);
5454
+ if (!pathname.startsWith("/")) throw new Error(`Invalid Kuaishou signing path: ${pathname}`);
5455
+ return pathname;
5456
+ };
5457
+ var buildKuaishouHxfalconPayload = (url, signPath) => {
5458
+ const parsedUrl = new URL(url);
5459
+ const realPath = resolveKuaishouHxfalconSignPath(parsedUrl.pathname, signPath);
5460
+ const query = sortSearchParams(parsedUrl.searchParams);
5461
+ if (!query.caver) throw new Error(`Missing caver query parameter for Kuaishou signing: ${url}`);
5462
+ return {
5463
+ url: realPath,
5464
+ query,
5465
+ form: {},
5466
+ requestBody: {}
5467
+ };
5468
+ };
5469
+ var buildKuaishouHxfalconSignInput = (payload) => {
5470
+ const combinedParams = {
5471
+ ...payload.query,
5472
+ ...payload.form
5473
+ };
5474
+ const serializedParams = Object.keys(combinedParams).filter((key) => !key.includes(SIGN_INPUT_SKIP_KEYWORD)).map((key) => toComparableEntry(key, combinedParams[key])).sort(compareLexicographically).join("");
5475
+ const requestBody = Object.keys(payload.requestBody).length > 0 ? JSON.stringify(payload.requestBody) : "";
5476
+ return `${normalizePathname(payload.url)}${serializedParams}${requestBody}`;
5477
+ };
5478
+ var extractCookieValue = (cookie, key) => {
5479
+ if (!cookie?.trim()) return "";
5480
+ const pattern = new RegExp(`(?:^|;\\s*)${key}=([^;]*)`);
5481
+ return cookie.match(pattern)?.[1] ?? "";
5482
+ };
5483
+ var generateKuaishouAnonymousKwwSeed = () => {
5484
+ let randomPart = "";
5485
+ for (let index = 0; index < 8; index++) {
5486
+ const randomIndex = Math.floor(Math.random() * 62);
5487
+ randomPart += KUAISHOU_ANONYMOUS_KWW_ALPHABET[randomIndex];
5488
+ }
5489
+ return `${Date.now()}|${randomPart}`;
5490
+ };
5491
+ var encryptKuaishouAnonymousKwwSeed = (seed) => {
5492
+ const key = Buffer.from(KUAISHOU_ANONYMOUS_KWW_KEY, "utf8");
5493
+ const cipher = crypto.createCipheriv("aes-128-cbc", key, key);
5494
+ return Buffer.concat([cipher.update(seed, "utf8"), cipher.final()]).toString("base64");
5495
+ };
5496
+ var deriveKuaishouAnonymousKww = () => {
5497
+ if (!kuaishouAnonymousKwwCache) kuaishouAnonymousKwwCache = `${encryptKuaishouAnonymousKwwSeed(generateKuaishouAnonymousKwwSeed())}${KUAISHOU_ANONYMOUS_KWW_SUFFIX}`;
5498
+ return kuaishouAnonymousKwwCache;
5499
+ };
5500
+ var deriveKuaishouKww = (cookie) => {
5501
+ const kwfv1 = extractCookieValue(cookie, "kwfv1");
5502
+ if (kwfv1) return kwfv1;
5503
+ return deriveKuaishouAnonymousKww();
5504
+ };
5505
+ var KUAISHOU_DEFAULT_CAT_VERSION = "2";
5506
+ var KUAISHOU_DEFAULT_COUNT = 100;
5507
+ var KUAISHOU_SECS_STACK_LIMIT = 100;
5508
+ var pureRuntimeState = null;
5509
+ var captureKuaishouEncodeStack = () => {
5510
+ try {
5511
+ throw new Error();
5512
+ } catch (error) {
5513
+ return error instanceof Error ? error.stack ?? "" : "";
5514
+ }
5515
+ };
5516
+ var deriveKuaishouSecsStackTail = (stack = captureKuaishouEncodeStack()) => stack.length > KUAISHOU_SECS_STACK_LIMIT ? stack.slice(-KUAISHOU_SECS_STACK_LIMIT) : stack;
5517
+ var deriveKuaishouSecsState = (count, stack) => ({
5518
+ s: deriveKuaishouSecsStackTail(stack),
5519
+ c: count
5520
+ });
5521
+ var getKuaishouPureRuntimeState = () => {
5522
+ if (pureRuntimeState) return pureRuntimeState;
5523
+ pureRuntimeState = {
5524
+ catVersion: KUAISHOU_DEFAULT_CAT_VERSION,
5525
+ count: KUAISHOU_DEFAULT_COUNT,
5526
+ startupRandom: Date.now()
5527
+ };
5528
+ return pureRuntimeState;
5529
+ };
5530
+ var kuaishouSign = class {
5531
+ static getCatVersion() {
5532
+ return getKuaishouPureRuntimeState().catVersion;
5533
+ }
5534
+ static generateKww(cookie) {
5535
+ return deriveKuaishouKww(cookie);
5536
+ }
5537
+ static generateHxfalconFromPayload(payload) {
5538
+ const signInput = buildKuaishouHxfalconSignInput(payload);
5539
+ const runtimeState = getKuaishouPureRuntimeState();
5540
+ const count = runtimeState.count;
5541
+ const secs = deriveKuaishouSecsState(count);
5542
+ const scriptCount = globalThis.document?.scripts?.length ?? 0;
5543
+ const catVersion = runtimeState.catVersion;
5544
+ const signResult = deriveKuaishouPureSignature({
5545
+ count,
5546
+ randomValue: Math.random(),
5547
+ scriptCount,
5548
+ secs,
5549
+ signInput,
5550
+ startupRandom: runtimeState.startupRandom,
5551
+ timestamp: Date.now()
5552
+ }).signResult;
5553
+ runtimeState.count += 1;
5554
+ return {
5555
+ signResult,
5556
+ signInput,
5557
+ catVersion
5558
+ };
5559
+ }
5560
+ static signLiveApiUrl(url, cookie, signPath) {
5561
+ const payload = buildKuaishouHxfalconPayload(url, signPath);
5562
+ const { signResult, signInput, catVersion } = this.generateHxfalconFromPayload(payload);
5563
+ const signedUrl = new URL(url);
5564
+ const headers = {};
5565
+ const kww = deriveKuaishouKww(cookie);
5566
+ signedUrl.searchParams.set("__NS_hxfalcon", signResult);
5567
+ signedUrl.searchParams.set("caver", catVersion);
5568
+ if (kww) headers.kww = kww;
5569
+ return {
5570
+ url: signedUrl.toString(),
5571
+ headers,
5572
+ signResult,
5573
+ signInput,
5574
+ catVersion
5575
+ };
5576
+ }
5577
+ static signLiveApiRequest(request, cookie) {
5578
+ return this.signLiveApiUrl(request.url, cookie, request.signPath);
5579
+ }
5580
+ };
4825
5581
  var kuaishouUtils = {
5582
+ sign: kuaishouSign,
4826
5583
  kuaishouApiUrls,
4827
5584
  api: kuaishou$1
4828
5585
  };
@@ -5213,7 +5970,7 @@ var Cfg = class {
5213
5970
  const fileName = path.basename(file, ".yaml");
5214
5971
  if (fileName === "cookies" || fileName === "request") {
5215
5972
  logger.debug(`[Config] 检测到 ${fileName} 配置变化,正在重载 Amagi Client...`);
5216
- import("./amagiClient-DutWjgMV.js").then(({ reloadAmagiConfig }) => {
5973
+ import("./amagiClient-SgOj0Cnj.js").then(({ reloadAmagiConfig }) => {
5217
5974
  reloadAmagiConfig();
5218
5975
  }).catch((error) => {
5219
5976
  logger.error(`[Config] 重载 Amagi Client 失败: ${error}`);
@@ -5232,7 +5989,7 @@ var Cfg = class {
5232
5989
  };
5233
5990
  }
5234
5991
  async All() {
5235
- const { getDouyinDB, getBilibiliDB } = await import("./db-DQ021gxp.js");
5992
+ const { getDouyinDB, getBilibiliDB } = await import("./db-DZJ-S_3-.js");
5236
5993
  const douyinDB = await getDouyinDB();
5237
5994
  const bilibiliDB = await getBilibiliDB();
5238
5995
  const allConfig = {};
@@ -5274,7 +6031,7 @@ var Cfg = class {
5274
6031
  fs.writeFileSync(path, yamlData.toString({ lineWidth: -1 }), "utf8");
5275
6032
  }
5276
6033
  async ModifyPro(name, config, type = "config") {
5277
- const { getDouyinDB, getBilibiliDB } = await import("./db-DQ021gxp.js");
6034
+ const { getDouyinDB, getBilibiliDB } = await import("./db-DZJ-S_3-.js");
5278
6035
  const douyinDB = await getDouyinDB();
5279
6036
  const bilibiliDB = await getBilibiliDB();
5280
6037
  const filePath = type === "config" ? `${this.dirCfgPath}/${name}.yaml` : `${this.defCfgPath}/${name}.yaml`;
@@ -5379,7 +6136,7 @@ var Cfg = class {
5379
6136
  }
5380
6137
  async syncConfigToDatabase() {
5381
6138
  try {
5382
- const { getDouyinDB, getBilibiliDB } = await import("./db-DQ021gxp.js");
6139
+ const { getDouyinDB, getBilibiliDB } = await import("./db-DZJ-S_3-.js");
5383
6140
  const douyinDB = await getDouyinDB();
5384
6141
  const bilibiliDB = await getBilibiliDB();
5385
6142
  const pushCfg = this.getYaml("config", "pushlist");
@@ -5494,6 +6251,21 @@ var AmagiBase = class {
5494
6251
  return createProxy(client);
5495
6252
  };
5496
6253
  };
6254
+ var SOFT_ERROR_CODES = { BILIBILI_COMMENTS_DISABLED: 12061 };
6255
+ var softFetch = async (fn, allowedCodes) => {
6256
+ try {
6257
+ return await fn();
6258
+ } catch (err) {
6259
+ if (err instanceof AmagiError && allowedCodes.includes(err.code)) return {
6260
+ success: false,
6261
+ code: err.code,
6262
+ data: err.data,
6263
+ message: err.message,
6264
+ error: err.rawError
6265
+ };
6266
+ throw err;
6267
+ }
6268
+ };
5497
6269
  var createLiveProxy = (getter) => new Proxy({}, { get(_target, prop) {
5498
6270
  const current = getter();
5499
6271
  const value = Reflect.get(current, prop);
@@ -8030,47 +8802,47 @@ var componentConfigs = baseComponentConfigs.map((basePlatform) => {
8030
8802
  switch (baseComponent.id) {
8031
8803
  case "comment": return createComponentConfig(baseComponent, {
8032
8804
  validateData: (data) => data && typeof data.share_url === "string",
8033
- lazyComponent: () => import("./Comment-C7DipcGk.js").then((module) => ({ default: module.DouyinComment }))
8805
+ lazyComponent: () => import("./Comment-BKNxGmvx.js").then((module) => ({ default: module.DouyinComment }))
8034
8806
  });
8035
8807
  case "dynamic": return createComponentConfig(baseComponent, {
8036
8808
  validateData: (data) => data && typeof data.share_url === "string",
8037
- lazyComponent: () => import("./Dynamic-C7sZ7_VA.js").then((module) => ({ default: module.DouyinDynamic }))
8809
+ lazyComponent: () => import("./Dynamic-BWX_To7C.js").then((module) => ({ default: module.DouyinDynamic }))
8038
8810
  });
8039
8811
  case "video-work": return createComponentConfig(baseComponent, {
8040
8812
  validateData: (data) => data && typeof data.share_url === "string",
8041
- lazyComponent: () => import("./VideoWork-CLCN8U6n.js").then((module) => ({ default: module.DouyinVideoWork }))
8813
+ lazyComponent: () => import("./VideoWork-DlYMb7Rg.js").then((module) => ({ default: module.DouyinVideoWork }))
8042
8814
  });
8043
8815
  case "image-work": return createComponentConfig(baseComponent, {
8044
8816
  validateData: (data) => data && typeof data.share_url === "string",
8045
- lazyComponent: () => import("./ImageWork-BjlkvEZl.js").then((module) => ({ default: module.DouyinImageWork }))
8817
+ lazyComponent: () => import("./ImageWork-D-rNxAZ-.js").then((module) => ({ default: module.DouyinImageWork }))
8046
8818
  });
8047
8819
  case "article-work": return createComponentConfig(baseComponent, {
8048
8820
  validateData: (data) => data && typeof data.share_url === "string",
8049
- lazyComponent: () => import("./ArticleWork-DM-2P7yk.js").then((module) => ({ default: module.DouyinArticleWork }))
8821
+ lazyComponent: () => import("./ArticleWork-Cf2wg9Q_.js").then((module) => ({ default: module.DouyinArticleWork }))
8050
8822
  });
8051
8823
  case "favorite-list": return createComponentConfig(baseComponent, {
8052
8824
  validateData: (data) => data && typeof data.share_url === "string",
8053
- lazyComponent: () => import("./FavoriteList-BKRXkpgr.js").then((module) => ({ default: module.DouyinFavoriteList }))
8825
+ lazyComponent: () => import("./FavoriteList-DaQFF0RD.js").then((module) => ({ default: module.DouyinFavoriteList }))
8054
8826
  });
8055
8827
  case "recommend-list": return createComponentConfig(baseComponent, {
8056
8828
  validateData: (data) => data && typeof data.share_url === "string",
8057
- lazyComponent: () => import("./RecommendList-CVmqCepV.js").then((module) => ({ default: module.DouyinRecommendList }))
8829
+ lazyComponent: () => import("./RecommendList-CfL3NObV.js").then((module) => ({ default: module.DouyinRecommendList }))
8058
8830
  });
8059
8831
  case "live": return createComponentConfig(baseComponent, {
8060
8832
  validateData: (data) => data && typeof data.share_url === "string",
8061
- lazyComponent: () => import("./Live-CBi-Jg5R.js").then((module) => ({ default: module.DouyinLive }))
8833
+ lazyComponent: () => import("./Live-RwbN5-Pa.js").then((module) => ({ default: module.DouyinLive }))
8062
8834
  });
8063
8835
  case "musicinfo": return createComponentConfig(baseComponent, {
8064
8836
  validateData: (data) => data && typeof data.share_url === "string",
8065
- lazyComponent: () => import("./MusicInfo-CgN5WBVO.js").then((module) => ({ default: module.DouyinMusicInfo }))
8837
+ lazyComponent: () => import("./MusicInfo-vIO3Dk72.js").then((module) => ({ default: module.DouyinMusicInfo }))
8066
8838
  });
8067
- case "user_profile": return createComponentConfig(baseComponent, { lazyComponent: () => import("./UserVideoList-B7KG12MD.js").then((module) => ({ default: module.DouyinUserVideoList })) });
8839
+ case "user_profile": return createComponentConfig(baseComponent, { lazyComponent: () => import("./UserVideoList-Bv57ruL6.js").then((module) => ({ default: module.DouyinUserVideoList })) });
8068
8840
  case "userlist": return createComponentConfig(baseComponent, {
8069
8841
  validateData: (data) => data && Array.isArray(data.renderOpt),
8070
- lazyComponent: () => import("./UserList-CTZhILez.js").then((module) => ({ default: module.default }))
8842
+ lazyComponent: () => import("./UserList-C-xAqgdb.js").then((module) => ({ default: module.default }))
8071
8843
  });
8072
- case "videoInfo": return createComponentConfig(baseComponent, { lazyComponent: () => import("./videoInfo-BsvVR1g1.js").then((module) => ({ default: module.DouyinVideoInfo })) });
8073
- case "qrcodeImg": return createComponentConfig(baseComponent, { lazyComponent: () => import("./qrcodeImg-Cwm5rWx0.js").then((module) => ({ default: module.DouyinQrcodeImg })) });
8844
+ case "videoInfo": return createComponentConfig(baseComponent, { lazyComponent: () => import("./videoInfo-CzlHwaaV.js").then((module) => ({ default: module.DouyinVideoInfo })) });
8845
+ case "qrcodeImg": return createComponentConfig(baseComponent, { lazyComponent: () => import("./qrcodeImg-E84au8P-.js").then((module) => ({ default: module.DouyinQrcodeImg })) });
8074
8846
  default: return createComponentConfig(baseComponent);
8075
8847
  }
8076
8848
  });
@@ -8080,42 +8852,42 @@ var componentConfigs = baseComponentConfigs.map((basePlatform) => {
8080
8852
  switch (baseComponent.id) {
8081
8853
  case "comment": return createComponentConfig(baseComponent, {
8082
8854
  validateData: (data) => data && typeof data.share_url === "string",
8083
- lazyComponent: () => import("./Comment-_ehzzbCT.js").then((module) => ({ default: module.BilibiliComment }))
8855
+ lazyComponent: () => import("./Comment-BEabtQCx.js").then((module) => ({ default: module.BilibiliComment }))
8084
8856
  });
8085
8857
  case "userlist": return createComponentConfig(baseComponent, {
8086
8858
  validateData: (data) => data && Array.isArray(data.renderOpt),
8087
- lazyComponent: () => import("./UserList-BvG2QasY.js").then((module) => ({ default: module.default }))
8859
+ lazyComponent: () => import("./UserList-BnkvIKGk.js").then((module) => ({ default: module.default }))
8088
8860
  });
8089
- case "bangumi": return createComponentConfig(baseComponent, { lazyComponent: () => import("./bangumi-U94Tg-9H.js").then((module) => ({ default: module.default })) });
8861
+ case "bangumi": return createComponentConfig(baseComponent, { lazyComponent: () => import("./bangumi-D0FPqxGs.js").then((module) => ({ default: module.default })) });
8090
8862
  case "dynamic/DYNAMIC_TYPE_DRAW": return createComponentConfig(baseComponent, {
8091
8863
  validateData: (data) => data && typeof data.share_url === "string",
8092
- lazyComponent: () => import("./DYNAMIC_TYPE_DRAW-Be8d7lCg.js").then((module) => ({ default: module.BilibiliDrawDynamic }))
8864
+ lazyComponent: () => import("./DYNAMIC_TYPE_DRAW-BUAkJ1bE.js").then((module) => ({ default: module.BilibiliDrawDynamic }))
8093
8865
  });
8094
8866
  case "dynamic/DYNAMIC_TYPE_WORD": return createComponentConfig(baseComponent, {
8095
8867
  validateData: (data) => data && typeof data.share_url === "string",
8096
- lazyComponent: () => import("./DYNAMIC_TYPE_WORD-D_qb-nmj.js").then((module) => ({ default: module.BilibiliWordDynamic }))
8868
+ lazyComponent: () => import("./DYNAMIC_TYPE_WORD-BuNbnDzf.js").then((module) => ({ default: module.BilibiliWordDynamic }))
8097
8869
  });
8098
8870
  case "dynamic/DYNAMIC_TYPE_AV": return createComponentConfig(baseComponent, {
8099
8871
  validateData: (data) => data && typeof data.share_url === "string",
8100
- lazyComponent: () => import("./DYNAMIC_TYPE_AV-BFmgJoig.js").then((module) => ({ default: module.BilibiliVideoDynamic }))
8872
+ lazyComponent: () => import("./DYNAMIC_TYPE_AV-CBybyWZh.js").then((module) => ({ default: module.BilibiliVideoDynamic }))
8101
8873
  });
8102
8874
  case "dynamic/DYNAMIC_TYPE_FORWARD": return createComponentConfig(baseComponent, {
8103
8875
  validateData: (data) => data && typeof data.share_url === "string",
8104
- lazyComponent: () => import("./DYNAMIC_TYPE_FORWARD-SRgseEdb.js").then((module) => ({ default: module.BilibiliForwardDynamic }))
8876
+ lazyComponent: () => import("./DYNAMIC_TYPE_FORWARD-CSYK27d2.js").then((module) => ({ default: module.BilibiliForwardDynamic }))
8105
8877
  });
8106
8878
  case "dynamic/DYNAMIC_TYPE_LIVE_RCMD": return createComponentConfig(baseComponent, {
8107
8879
  validateData: (data) => data && typeof data.share_url === "string",
8108
- lazyComponent: () => import("./DYNAMIC_TYPE_LIVE_RCMD-CDBDKK4u.js").then((module) => ({ default: module.BilibiliLiveDynamic }))
8880
+ lazyComponent: () => import("./DYNAMIC_TYPE_LIVE_RCMD-C8K6WYKF.js").then((module) => ({ default: module.BilibiliLiveDynamic }))
8109
8881
  });
8110
8882
  case "dynamic/DYNAMIC_TYPE_WORD": return createComponentConfig(baseComponent, { validateData: (data) => data && typeof data.share_url === "string" });
8111
- case "dynamic/DYNAMIC_TYPE_ARTICLE": return createComponentConfig(baseComponent, { lazyComponent: () => import("./DYNAMIC_TYPE_ARTICLE-RG5B0GYl.js").then((module) => ({ default: module.BilibiliArticleDynamic })) });
8883
+ case "dynamic/DYNAMIC_TYPE_ARTICLE": return createComponentConfig(baseComponent, { lazyComponent: () => import("./DYNAMIC_TYPE_ARTICLE-Bo-JumZT.js").then((module) => ({ default: module.BilibiliArticleDynamic })) });
8112
8884
  case "videoInfo": return createComponentConfig(baseComponent, {
8113
8885
  validateData: (data) => data && typeof data.share_url === "string",
8114
- lazyComponent: () => import("./videoInfo-CZIF1cOh.js").then((module) => ({ default: module.BilibiliVideoInfo }))
8886
+ lazyComponent: () => import("./videoInfo-BYOWM8o4.js").then((module) => ({ default: module.BilibiliVideoInfo }))
8115
8887
  });
8116
8888
  case "qrcodeImg": return createComponentConfig(baseComponent, {
8117
8889
  validateData: (data) => data && typeof data.share_url === "string",
8118
- lazyComponent: () => import("./qrcodeImg-DLK0ebMK.js").then((module) => ({ default: module.BilibiliQrcodeImg }))
8890
+ lazyComponent: () => import("./qrcodeImg-_PrtNVpy.js").then((module) => ({ default: module.BilibiliQrcodeImg }))
8119
8891
  });
8120
8892
  default: return createComponentConfig(baseComponent);
8121
8893
  }
@@ -8126,7 +8898,7 @@ var componentConfigs = baseComponentConfigs.map((basePlatform) => {
8126
8898
  switch (baseComponent.id) {
8127
8899
  case "comment": return createComponentConfig(baseComponent, {
8128
8900
  validateData: (data) => data && typeof data.share_url === "string",
8129
- lazyComponent: () => import("./Comment-DyzgsNH4.js").then((module) => ({ default: module.KuaishouComment }))
8901
+ lazyComponent: () => import("./Comment-dJPgOsHg.js").then((module) => ({ default: module.KuaishouComment }))
8130
8902
  });
8131
8903
  default: return createComponentConfig(baseComponent);
8132
8904
  }
@@ -8135,8 +8907,8 @@ var componentConfigs = baseComponentConfigs.map((basePlatform) => {
8135
8907
  case PlatformType.XIAOHONGSHU:
8136
8908
  platform.components = basePlatform.components.map((baseComponent) => {
8137
8909
  switch (baseComponent.id) {
8138
- case "noteInfo": return createComponentConfig(baseComponent, { lazyComponent: () => import("./noteInfo-Cc0CdOh6.js").then((module) => ({ default: module.XiaohongshuNoteInfo })) });
8139
- case "comment": return createComponentConfig(baseComponent, { lazyComponent: () => import("./Comment-vmLpukdO.js").then((module) => ({ default: module.XiaohongshuComment })) });
8910
+ case "noteInfo": return createComponentConfig(baseComponent, { lazyComponent: () => import("./noteInfo-Yj8--L6W.js").then((module) => ({ default: module.XiaohongshuNoteInfo })) });
8911
+ case "comment": return createComponentConfig(baseComponent, { lazyComponent: () => import("./Comment-Dw8SoTxB.js").then((module) => ({ default: module.XiaohongshuComment })) });
8140
8912
  default: return createComponentConfig(baseComponent);
8141
8913
  }
8142
8914
  });
@@ -8144,11 +8916,11 @@ var componentConfigs = baseComponentConfigs.map((basePlatform) => {
8144
8916
  case PlatformType.OTHER:
8145
8917
  platform.components = basePlatform.components.map((baseComponent) => {
8146
8918
  switch (baseComponent.id) {
8147
- case "help": return createComponentConfig(baseComponent, { lazyComponent: () => import("./Help-CSQsl-iG.js").then((module) => ({ default: module.default })) });
8148
- case "handlerError": return createComponentConfig(baseComponent, { lazyComponent: () => import("./handlerError-CZimBCI0.js").then((module) => ({ default: module.handlerError })) });
8149
- case "changelog": return createComponentConfig(baseComponent, { lazyComponent: () => import("./changelog-COLIz9yq.js").then((module) => ({ default: module.Changelog })) });
8150
- case "version_warning": return createComponentConfig(baseComponent, { lazyComponent: () => import("./VersionWarning--dZBxhCO.js").then((module) => ({ default: module.VersionWarning })) });
8151
- case "qrlogin": return createComponentConfig(baseComponent, { lazyComponent: () => import("./qrlogin-V7NbxsLi.js").then((module) => ({ default: module.QrLogin })) });
8919
+ case "help": return createComponentConfig(baseComponent, { lazyComponent: () => import("./Help-C2Cty5bZ.js").then((module) => ({ default: module.default })) });
8920
+ case "handlerError": return createComponentConfig(baseComponent, { lazyComponent: () => import("./handlerError-Dq1bZgpj.js").then((module) => ({ default: module.handlerError })) });
8921
+ case "changelog": return createComponentConfig(baseComponent, { lazyComponent: () => import("./changelog-C-q414my.js").then((module) => ({ default: module.Changelog })) });
8922
+ case "version_warning": return createComponentConfig(baseComponent, { lazyComponent: () => import("./VersionWarning-AS6hvDl-.js").then((module) => ({ default: module.VersionWarning })) });
8923
+ case "qrlogin": return createComponentConfig(baseComponent, { lazyComponent: () => import("./qrlogin-B1QlI5rQ.js").then((module) => ({ default: module.QrLogin })) });
8152
8924
  default: return createComponentConfig(baseComponent);
8153
8925
  }
8154
8926
  });
@@ -8156,8 +8928,8 @@ var componentConfigs = baseComponentConfigs.map((basePlatform) => {
8156
8928
  case PlatformType.STATISTICS:
8157
8929
  platform.components = basePlatform.components.map((baseComponent) => {
8158
8930
  switch (baseComponent.id) {
8159
- case "group": return createComponentConfig(baseComponent, { lazyComponent: () => import("./GroupStatistics-Mkeip-kD.js").then((module) => ({ default: module.GroupStatistics })) });
8160
- case "global": return createComponentConfig(baseComponent, { lazyComponent: () => import("./GlobalStatistics-D5SYUMFx.js").then((module) => ({ default: module.GlobalStatistics })) });
8931
+ case "group": return createComponentConfig(baseComponent, { lazyComponent: () => import("./GroupStatistics-C8m4Kamg.js").then((module) => ({ default: module.GroupStatistics })) });
8932
+ case "global": return createComponentConfig(baseComponent, { lazyComponent: () => import("./GlobalStatistics-Bbm3ena3.js").then((module) => ({ default: module.GlobalStatistics })) });
8161
8933
  default: return createComponentConfig(baseComponent);
8162
8934
  }
8163
8935
  });
@@ -12202,6 +12974,52 @@ var webConfig = defineConfig({
12202
12974
  isRequired: false,
12203
12975
  description: "UP主的昵称"
12204
12976
  }),
12977
+ components.divider.create("push:bilibili:divider-pushTypes", {
12978
+ description: "推送类型配置",
12979
+ descPosition: 20
12980
+ }),
12981
+ components.checkbox.group("pushTypes", {
12982
+ label: "推送类型",
12983
+ description: "选择要推送的动态类型,可多选",
12984
+ orientation: "horizontal",
12985
+ color: "warning",
12986
+ checkbox: [
12987
+ components.checkbox.create("pushTypes:checkbox:video", {
12988
+ label: "投稿视频",
12989
+ description: "推送UP主投稿的视频",
12990
+ value: "video"
12991
+ }),
12992
+ components.checkbox.create("pushTypes:checkbox:draw", {
12993
+ label: "图文动态",
12994
+ description: "推送UP主发布的图文动态",
12995
+ value: "draw"
12996
+ }),
12997
+ components.checkbox.create("pushTypes:checkbox:word", {
12998
+ label: "纯文动态",
12999
+ description: "推送UP主发布的纯文字动态",
13000
+ value: "word"
13001
+ }),
13002
+ components.checkbox.create("pushTypes:checkbox:live", {
13003
+ label: "直播动态",
13004
+ description: "推送UP主的直播通知",
13005
+ value: "live"
13006
+ }),
13007
+ components.checkbox.create("pushTypes:checkbox:forward", {
13008
+ label: "转发动态",
13009
+ description: "推送UP主的转发动态",
13010
+ value: "forward"
13011
+ }),
13012
+ components.checkbox.create("pushTypes:checkbox:article", {
13013
+ label: "投稿专栏",
13014
+ description: "推送UP主投稿的专栏文章",
13015
+ value: "article"
13016
+ })
13017
+ ]
13018
+ }),
13019
+ components.divider.create("push:bilibili:divider-filter", {
13020
+ description: "过滤系统",
13021
+ descPosition: 20
13022
+ }),
12205
13023
  components.radio.group("filterMode", {
12206
13024
  label: "过滤模式",
12207
13025
  orientation: "horizontal",
@@ -13131,40 +13949,44 @@ var Bilibili = class extends Base {
13131
13949
  videoSize = await getvideosize(correctList.videoList[0].base_url, playUrlData.data.data.dash.audio[0].base_url, infoData.data.data.bvid);
13132
13950
  } else videoSize = (nockData.data.durl[0].size / (1024 * 1024)).toFixed(2);
13133
13951
  if (Config.bilibili.sendContent.some((content) => content === "comment")) {
13134
- const { comments: commentsdata, image_urls } = bilibiliComments((await this.amagi.bilibili.fetcher.fetchComments({
13952
+ const commentsData = await softFetch(() => this.amagi.bilibili.fetcher.fetchComments({
13135
13953
  number: Config.bilibili.numcomment,
13136
13954
  type: 1,
13137
13955
  oid: infoData.data.data.aid.toString(),
13138
13956
  typeMode: "strict"
13139
- })).data, infoData.data.data.owner.mid.toString());
13140
- if (!commentsdata?.length) this.e.reply("这个视频没有评论 ~");
13957
+ }), [SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED]);
13958
+ if (commentsData.code === SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED) this.e.reply("UP主已关闭评论区,无法获取评论");
13141
13959
  else {
13142
- const messageElements = [];
13143
- if (Config.bilibili.commentImageCollection && image_urls.length > 0) {
13144
- for (const [index, v] of image_urls.entries()) {
13145
- const imageUrl = await processImageUrl(v, infoData.data.data.title, index);
13146
- messageElements.push(segment.image(imageUrl));
13960
+ const { comments: commentsdata, image_urls } = bilibiliComments(commentsData.data, infoData.data.data.owner.mid.toString());
13961
+ if (!commentsdata?.length) this.e.reply("这个视频没有评论 ~");
13962
+ else {
13963
+ const messageElements = [];
13964
+ if (Config.bilibili.commentImageCollection && image_urls.length > 0) {
13965
+ for (const [index, v] of image_urls.entries()) {
13966
+ const imageUrl = await processImageUrl(v, infoData.data.data.title, index);
13967
+ messageElements.push(segment.image(imageUrl));
13968
+ }
13969
+ const res = common.makeForward(messageElements, Config.app.fakeForward ? this.e.sender.userId : this.e.bot.account.selfId, Config.app.fakeForward ? this.e.sender.nick : this.e.bot.account.name);
13970
+ await this.e.bot.sendForwardMsg(this.e.contact, res, {
13971
+ source: "评论图片收集",
13972
+ summary: `查看${messageElements.length}张图片`,
13973
+ prompt: "B站评论解析结果",
13974
+ news: [{ text: "点击查看解析结果" }]
13975
+ });
13147
13976
  }
13148
- const res = common.makeForward(messageElements, Config.app.fakeForward ? this.e.sender.userId : this.e.bot.account.selfId, Config.app.fakeForward ? this.e.sender.nick : this.e.bot.account.name);
13149
- await this.e.bot.sendForwardMsg(this.e.contact, res, {
13150
- source: "评论图片收集",
13151
- summary: `查看${messageElements.length}张图片`,
13152
- prompt: "B站评论解析结果",
13153
- news: [{ text: "点击查看解析结果" }]
13977
+ img$1 = await Render(this.e, "bilibili/comment", {
13978
+ Type: "视频",
13979
+ CommentsData: commentsdata,
13980
+ CommentLength: Config.bilibili.realCommentCount ? Count(infoData.data.data.stat.reply) : String(commentsdata.length),
13981
+ share_url: "https://b23.tv/" + infoData.data.data.bvid,
13982
+ Clarity: Config.bilibili.videoQuality !== 0 && Config.bilibili.videoQuality < 64 ? nockData.data.accept_description[nockData.data.accept_description.length - 1] : playUrlData.data.data.accept_description[0],
13983
+ VideoSize: Config.bilibili.videoQuality !== 0 && Config.bilibili.videoQuality < 64 ? Common.formatFileSize((nockData.data.durl[0].size / (1024 * 1024)).toFixed(2)) : Common.formatFileSize(videoSize),
13984
+ ImageLength: 0,
13985
+ shareurl: "https://b23.tv/" + infoData.data.data.bvid,
13986
+ Resolution: Config.bilibili.videoQuality !== 0 && Config.bilibili.videoQuality < 64 ? null : `${playUrlData.data.data.dash.video[0].width} x ${playUrlData.data.data.dash.video[0].height}`
13154
13987
  });
13988
+ this.e.reply(img$1);
13155
13989
  }
13156
- img$1 = await Render(this.e, "bilibili/comment", {
13157
- Type: "视频",
13158
- CommentsData: commentsdata,
13159
- CommentLength: Config.bilibili.realCommentCount ? Count(infoData.data.data.stat.reply) : String(commentsdata.length),
13160
- share_url: "https://b23.tv/" + infoData.data.data.bvid,
13161
- Clarity: Config.bilibili.videoQuality !== 0 && Config.bilibili.videoQuality < 64 ? nockData.data.accept_description[nockData.data.accept_description.length - 1] : playUrlData.data.data.accept_description[0],
13162
- VideoSize: Config.bilibili.videoQuality !== 0 && Config.bilibili.videoQuality < 64 ? Common.formatFileSize((nockData.data.durl[0].size / (1024 * 1024)).toFixed(2)) : Common.formatFileSize(videoSize),
13163
- ImageLength: 0,
13164
- shareurl: "https://b23.tv/" + infoData.data.data.bvid,
13165
- Resolution: Config.bilibili.videoQuality !== 0 && Config.bilibili.videoQuality < 64 ? null : `${playUrlData.data.data.dash.video[0].width} x ${playUrlData.data.data.dash.video[0].height}`
13166
- });
13167
- this.e.reply(img$1);
13168
13990
  }
13169
13991
  }
13170
13992
  if (Config.bilibili.sendContent.some((content) => content === "video")) if (Config.upload.usefilelimit && Number(videoSize) > Number(Config.upload.filelimit) && !Config.upload.compress) this.e.reply(`设定的最大上传大小为 ${Config.upload.filelimit}MB\n当前解析到的视频大小为 ${Number(videoSize)}MB\n视频太大了,还是去B站看吧~`, { reply: true });
@@ -13231,7 +14053,11 @@ var Bilibili = class extends Base {
13231
14053
  length: videoInfo.data.result.episodes.length
13232
14054
  });
13233
14055
  this.e.reply([...img$1, segment.text("请在120秒内输入 第?集 选择集数")]);
13234
- const context = await karin$1.ctx(this.e, { reply: true });
14056
+ const context = await karin$1.ctx(this.e, {
14057
+ reply: true,
14058
+ throwOnTimeout: false
14059
+ });
14060
+ if (!context) return true;
13235
14061
  const regex = /第([一二三四五六七八九十百千万0-9]+)集/.exec(context.msg);
13236
14062
  let Episode;
13237
14063
  if (regex && regex[1]) {
@@ -13683,41 +14509,45 @@ var Bilibili = class extends Base {
13683
14509
  }
13684
14510
  }
13685
14511
  if (Config.bilibili.sendContent.some((content) => content === "comment") && dynamicInfo.data.data.item.type !== DynamicType.LIVE_RCMD) {
13686
- const { comments: commentsdata, image_urls } = bilibiliComments((await this.amagi.bilibili.fetcher.fetchComments({
14512
+ const commentsData = await softFetch(() => this.amagi.bilibili.fetcher.fetchComments({
13687
14513
  type: mapping_table(dynamicInfo.data.data.item.type),
13688
14514
  oid: oid(dynamicInfo.data, dynamicInfoCard.data),
13689
14515
  number: Config.bilibili.numcomment,
13690
14516
  typeMode: "strict"
13691
- })).data, dynamicInfo.data.data.item.modules.module_author.mid.toString());
13692
- if (commentsdata && commentsdata.length > 0) {
13693
- if (Config.bilibili.commentImageCollection && image_urls.length > 0) {
13694
- const messageElements = [];
13695
- let title = "bilibili_dynamic";
13696
- if (dynamicInfo.data.data.item.type === DynamicType.DRAW) title = dynamicInfo.data.data.item.modules.module_dynamic.major.opus.title || "bilibili_dynamic";
13697
- else if (dynamicInfo.data.data.item.type === DynamicType.AV) title = dynamicInfo.data.data.item.modules.module_dynamic.major.archive.title || "bilibili_dynamic";
13698
- for (const [index, v] of image_urls.entries()) {
13699
- const imageUrl = await processImageUrl(v, title, index);
13700
- messageElements.push(segment.image(imageUrl));
14517
+ }), [SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED]);
14518
+ if (commentsData.code === SOFT_ERROR_CODES.BILIBILI_COMMENTS_DISABLED) this.e.reply("UP主已关闭评论区,无法获取评论");
14519
+ else {
14520
+ const { comments: commentsdata, image_urls } = bilibiliComments(commentsData.data, dynamicInfo.data.data.item.modules.module_author.mid.toString());
14521
+ if (commentsdata && commentsdata.length > 0) {
14522
+ if (Config.bilibili.commentImageCollection && image_urls.length > 0) {
14523
+ const messageElements = [];
14524
+ let title = "bilibili_dynamic";
14525
+ if (dynamicInfo.data.data.item.type === DynamicType.DRAW) title = dynamicInfo.data.data.item.modules.module_dynamic.major.opus.title || "bilibili_dynamic";
14526
+ else if (dynamicInfo.data.data.item.type === DynamicType.AV) title = dynamicInfo.data.data.item.modules.module_dynamic.major.archive.title || "bilibili_dynamic";
14527
+ for (const [index, v] of image_urls.entries()) {
14528
+ const imageUrl = await processImageUrl(v, title, index);
14529
+ messageElements.push(segment.image(imageUrl));
14530
+ }
14531
+ const res = common.makeForward(messageElements, Config.app.fakeForward ? this.e.sender.userId : this.e.bot.account.selfId, Config.app.fakeForward ? this.e.sender.nick : this.e.bot.account.name);
14532
+ await this.e.bot.sendForwardMsg(this.e.contact, res, {
14533
+ source: "评论图片收集",
14534
+ summary: `查看${messageElements.length}张图片`,
14535
+ prompt: "B站评论解析结果",
14536
+ news: [{ text: "点击查看解析结果" }]
14537
+ });
13701
14538
  }
13702
- const res = common.makeForward(messageElements, Config.app.fakeForward ? this.e.sender.userId : this.e.bot.account.selfId, Config.app.fakeForward ? this.e.sender.nick : this.e.bot.account.name);
13703
- await this.e.bot.sendForwardMsg(this.e.contact, res, {
13704
- source: "评论图片收集",
13705
- summary: `查看${messageElements.length}张图片`,
13706
- prompt: "B站评论解析结果",
13707
- news: [{ text: "点击查看解析结果" }]
14539
+ const img = await Render(this.e, "bilibili/comment", {
14540
+ Type: "动态",
14541
+ CommentsData: commentsdata,
14542
+ CommentLength: String(commentsdata.length),
14543
+ share_url: dynamicInfo.data.data.item.type === DynamicType.AV ? `https://www.bilibili.com/video/${dynamicInfo.data.data.item.modules.module_dynamic.major.archive.bvid}` : `https://t.bilibili.com/${dynamicInfo.data.data.item.id_str}`,
14544
+ ImageLength: dynamicInfo.data.data.item.modules?.module_dynamic?.major?.draw?.items?.length ?? 0,
14545
+ shareurl: "动态分享链接",
14546
+ Resolution: null
13708
14547
  });
13709
- }
13710
- const img = await Render(this.e, "bilibili/comment", {
13711
- Type: "动态",
13712
- CommentsData: commentsdata,
13713
- CommentLength: String(commentsdata.length),
13714
- share_url: dynamicInfo.data.data.item.type === DynamicType.AV ? `https://www.bilibili.com/video/${dynamicInfo.data.data.item.modules.module_dynamic.major.archive.bvid}` : `https://t.bilibili.com/${dynamicInfo.data.data.item.id_str}`,
13715
- ImageLength: dynamicInfo.data.data.item.modules?.module_dynamic?.major?.draw?.items?.length ?? 0,
13716
- shareurl: "动态分享链接",
13717
- Resolution: null
13718
- });
13719
- this.e.reply(img);
13720
- } else this.e.reply("这条动态暂时还没有评论~");
14548
+ this.e.reply(img);
14549
+ } else this.e.reply("这条动态暂时还没有评论~");
14550
+ }
13721
14551
  }
13722
14552
  break;
13723
14553
  }
@@ -14697,6 +15527,22 @@ var bilibiliLogin = async (e) => {
14697
15527
  return;
14698
15528
  }
14699
15529
  };
15530
+ var pushTypeToDynamicType = {
15531
+ video: DynamicType.AV,
15532
+ draw: DynamicType.DRAW,
15533
+ word: DynamicType.WORD,
15534
+ live: DynamicType.LIVE_RCMD,
15535
+ forward: DynamicType.FORWARD,
15536
+ article: DynamicType.ARTICLE
15537
+ };
15538
+ var allBilibiliPushTypes = [
15539
+ "video",
15540
+ "draw",
15541
+ "word",
15542
+ "live",
15543
+ "forward",
15544
+ "article"
15545
+ ];
14700
15546
  var bilibiliBaseHeaders = {
14701
15547
  ...BASE_HEADERS,
14702
15548
  Referer: "https://www.bilibili.com",
@@ -14717,8 +15563,28 @@ var Bilibilipush = class extends Base {
14717
15563
  eventWithBot.bot = bot;
14718
15564
  eventWithBot.selfId = eventWithBot.selfId ?? targetBotId;
14719
15565
  }
15566
+ ensureConfigFields(pushList) {
15567
+ if (!pushList || pushList.length === 0) return;
15568
+ let hasChanges = false;
15569
+ for (const item of pushList) {
15570
+ if (!item.pushTypes?.length) {
15571
+ item.pushTypes = [...allBilibiliPushTypes];
15572
+ hasChanges = true;
15573
+ logger.info(`[karin-plugin-kkk][v2.28.0] 为UP主 ${item.remark ?? item.host_mid} 自动补全推送类型:投稿视频、图文动态、纯文动态、直播动态、转发动态、投稿专栏`);
15574
+ }
15575
+ if (item.switch === void 0) {
15576
+ item.switch = true;
15577
+ hasChanges = true;
15578
+ }
15579
+ }
15580
+ if (hasChanges) {
15581
+ Config.Modify("pushlist", "bilibili", pushList);
15582
+ logger.info("已自动补全B站推送配置文件中缺失的字段并保存");
15583
+ }
15584
+ }
14720
15585
  async action() {
14721
15586
  await this.syncConfigToDatabase();
15587
+ this.ensureConfigFields(Config.pushlist.bilibili);
14722
15588
  const deletedCount = await cleanOldDynamicCache("bilibili");
14723
15589
  if (deletedCount > 0) logger.info(`已清理 ${deletedCount} 条过期的B站动态缓存记录`);
14724
15590
  const registeredBotIds = karin$1.getAllBotID();
@@ -15274,6 +16140,8 @@ var Bilibilipush = class extends Base {
15274
16140
  for (const item of filteredUserList) {
15275
16141
  await common.sleep(2e3);
15276
16142
  logger.debug(`[Bilibili 推送] 开始获取UP: ${item.remark}(${item.host_mid}) 的动态列表`);
16143
+ const pushTypes = item.pushTypes || allBilibiliPushTypes;
16144
+ const allowedDynamicTypes = new Set(pushTypes.map((pt) => pushTypeToDynamicType[pt]));
15277
16145
  const dynamic_list = await this.amagi.bilibili.fetcher.fetchUserDynamicList({
15278
16146
  host_mid: item.host_mid,
15279
16147
  typeMode: "strict"
@@ -15291,6 +16159,10 @@ var Bilibilipush = class extends Base {
15291
16159
  logger.trace(logger.green(`根据以上判断,shoulPush 为 true,将对该动态纳入当天推送列表:https://t.bilibili.com/${dynamic.id_str}\n`));
15292
16160
  } else logger.trace(logger.yellow(`根据以上判断,shoulPush 为 false,跳过该动态:https://t.bilibili.com/${dynamic.id_str}\n`));
15293
16161
  if (timeDifference < 86400 || shouldPush) {
16162
+ if (!allowedDynamicTypes.has(dynamic.type)) {
16163
+ logger.debug(`UP主 ${item.remark}(${item.host_mid})的动态 ${dynamic.id_str} 类型为「${dynamic.type}」,不在推送类型配置中,跳过`);
16164
+ continue;
16165
+ }
15294
16166
  const targets = item.group_id.map((groupWithBot) => {
15295
16167
  const [groupId, botId] = groupWithBot.split(":");
15296
16168
  return {
@@ -19925,11 +20797,12 @@ var handleUpdateHook = wrapWithErrorHandler(async (e) => {
19925
20797
  if (upd.status === "yes") {
19926
20798
  const result = await updatePkg(Root.pluginName);
19927
20799
  if (result.status === "ok") {
19928
- if ((await e.reply(`${Root.pluginName} 更新成功!\n${result.local} -> ${result.remote}\n开始执行重启......`)).messageId) try {
20800
+ const msgResult = await e.reply(`${Root.pluginName} 更新成功!\n${result.local} -> ${result.remote}\n开始执行重启......`);
20801
+ if (msgResult.messageId) try {
19929
20802
  await db.del(UPDATE_MSGID_KEY);
19930
20803
  await db.del(UPDATE_LOCK_KEY);
19931
20804
  } catch {}
19932
- await restart(e.selfId, e.contact, e.messageId);
20805
+ await restart(e.selfId, e.contact, msgResult.messageId);
19933
20806
  } else e.reply(`${Root.pluginName} 更新失败: ${result.data ?? "更新执行失败"}`);
19934
20807
  } else if (upd.status === "no") e.reply("未检测到可更新版本。");
19935
20808
  else e.reply(`${Root.pluginName} 更新失败: ${upd.error?.message ?? String(upd.error)}`);
@@ -33944,7 +34817,7 @@ var Changelog = import_react.memo((props) => {
33944
34817
  className: "text-default-500 text-[1.2em]",
33945
34818
  children: "•"
33946
34819
  }),
33947
- (0, import_jsx_runtime.jsx)("span", { children: "回复" }),
34820
+ (0, import_jsx_runtime.jsx)("span", { children: "引用回复" }),
33948
34821
  (0, import_jsx_runtime.jsx)("span", {
33949
34822
  className: "inline-block text-[1.15em] font-bold text-default-900",
33950
34823
  children: "更新"
@@ -35203,7 +36076,7 @@ var handlerError = (props) => {
35203
36076
  }), (0, import_jsx_runtime.jsx)("p", {
35204
36077
  className: "text-xl",
35205
36078
  style: { color: secondaryColor },
35206
- children: "此图片 + 触发命令"
36079
+ children: "此图片 + 触发命令 + 对应配置(自行脱敏处理)"
35207
36080
  })] })
35208
36081
  ]
35209
36082
  }),
@@ -36031,4 +36904,4 @@ var XiaohongshuNoteInfo = import_react.memo((props) => {
36031
36904
  });
36032
36905
  });
36033
36906
  XiaohongshuNoteInfo.displayName = "XiaohongshuNoteInfo";
36034
- export { setdyPush as $, BilibiliVideoDynamic as A, kuaishouAPP as B, DouyinArticleWork as C, amagiClient as Ct, BilibiliLiveDynamic as D, reloadAmagiConfig as Dt, BilibiliWordDynamic as E, kuaishouFetcher as Et, kkkUpdate as F, qrLogin as G, xiaohongshuAPP as H, kkkUpdateCommand as I, changeBotID as J, bilibiliPush as K, update as L, BangumiBilibili as M, BilibiliUserList as N, BilibiliForwardDynamic as O, Root as Ot, BilibiliComment as P, setbiliPush as Q, bilibiliAPP as R, DouyinComment as S, AmagiError as St, BilibiliQrcodeImg as T, douyinFetcher as Tt, globalStatistics as U, prefix as V, groupStatistics as W, douyinPushList as X, douyinPush as Y, forcePush as Z, DouyinMusicInfo as _, DouyinDBBase as _t, Changelog as a, removeOldFiles as at, DouyinFavoriteList as b, renderVideoPreviewPage as bt, GroupStatistics as c, webConfig as ct, DouyinVideoInfo as d, douyinDBInstance as dt, testDouyinPush as et, DouyinQrcodeImg as f, getBilibiliDB as ft, DouyinRecommendList as g, StatisticsDBBase as gt, DouyinUserList as h, initAllDatabases as ht, handlerError as i, dylogin as it, BilibiliArticleDynamic as j, BilibiliDrawDynamic as k, GlobalStatistics as l, bilibiliDBInstance as lt, DouyinUserVideoList as m, getStatisticsDB as mt, XiaohongshuComment as n, version as nt, VersionWarning as o, task as ot, DouyinVideoWork as p, getDouyinDB as pt, bilibiliPushList as q, QrLogin as r, biLogin as rt, Help as s, template_default as st, XiaohongshuNoteInfo as t, help as tt, KuaishouComment as u, cleanOldDynamicCache as ut, DouyinLive as v, BilibiliDBBase as vt, BilibiliVideoInfo as w, bilibiliFetcher as wt, DouyinDynamic as x, AmagiBase as xt, DouyinImageWork as y, reactServerRender as yt, douyinAPP as z };
36907
+ export { setdyPush as $, BilibiliVideoDynamic as A, Root as At, kuaishouAPP as B, DouyinArticleWork as C, SOFT_ERROR_CODES as Ct, BilibiliLiveDynamic as D, kuaishouFetcher as Dt, BilibiliWordDynamic as E, douyinFetcher as Et, kkkUpdate as F, qrLogin as G, xiaohongshuAPP as H, kkkUpdateCommand as I, changeBotID as J, bilibiliPush as K, update as L, BangumiBilibili as M, BilibiliUserList as N, BilibiliForwardDynamic as O, reloadAmagiConfig as Ot, BilibiliComment as P, setbiliPush as Q, bilibiliAPP as R, DouyinComment as S, AmagiError as St, BilibiliQrcodeImg as T, bilibiliFetcher as Tt, globalStatistics as U, prefix as V, groupStatistics as W, douyinPushList as X, douyinPush as Y, forcePush as Z, DouyinMusicInfo as _, DouyinDBBase as _t, Changelog as a, removeOldFiles as at, DouyinFavoriteList as b, renderVideoPreviewPage as bt, GroupStatistics as c, webConfig as ct, DouyinVideoInfo as d, douyinDBInstance as dt, testDouyinPush as et, DouyinQrcodeImg as f, getBilibiliDB as ft, DouyinRecommendList as g, StatisticsDBBase as gt, DouyinUserList as h, initAllDatabases as ht, handlerError as i, dylogin as it, BilibiliArticleDynamic as j, BilibiliDrawDynamic as k, softFetch as kt, GlobalStatistics as l, bilibiliDBInstance as lt, DouyinUserVideoList as m, getStatisticsDB as mt, XiaohongshuComment as n, version as nt, VersionWarning as o, task as ot, DouyinVideoWork as p, getDouyinDB as pt, bilibiliPushList as q, QrLogin as r, biLogin as rt, Help as s, template_default as st, XiaohongshuNoteInfo as t, help as tt, KuaishouComment as u, cleanOldDynamicCache as ut, DouyinLive as v, BilibiliDBBase as vt, BilibiliVideoInfo as w, amagiClient as wt, DouyinDynamic as x, AmagiBase as xt, DouyinImageWork as y, reactServerRender as yt, douyinAPP as z };