node-red-contrib-hik-media-buffer 1.1.136 → 1.1.138

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.
@@ -202,7 +202,6 @@ module.exports = function(RED) {
202
202
 
203
203
  // 2. 🎥 GENERAZIONE DINAMICA E DIRETTA PLAYBACK URI (Niente più ricerca XML!)
204
204
  if (targetEvento.startTime && targetEvento.endTime) {
205
- // Funzione interna per ripulire i dati temporali (es. 2026-07-03T13:41:25+02:00 -> 20260703T134125Z)
206
205
  const pulisciDataHik = (dataStr) => {
207
206
  let pulita = dataStr.replace(/[-:]/g, '').split('+')[0];
208
207
  return pulita;
@@ -218,17 +217,24 @@ module.exports = function(RED) {
218
217
 
219
218
  // 3. 💾 EFFETTUIAMO LA GET DI DOWNLOAD SE ABBIAMO GENERATO L'URI
220
219
  if (playbackURIGrezzo) {
220
+ const playbackURIXml = playbackURIGrezzo.replace(/&/g, '&');
221
+
221
222
  const payloadDownload = `<?xml version="1.0" encoding="UTF-8"?>
222
223
  <downloadRequest>
223
- <playbackURI>${playbackURIGrezzo}</playbackURI>
224
+ <playbackURI>${playbackURIXml}</playbackURI>
224
225
  </downloadRequest>`;
225
226
 
227
+ node.warn(`[HIK DOWNLOAD] Invio Body XML:\n${payloadDownload}`);
228
+
226
229
  const resDownVideo = await nvrAuth.request({
227
230
  method: 'GET',
228
231
  url: `${node.protocol}://${node.host}:${node.port}/ISAPI/ContentMgmt/download`,
229
232
  data: payloadDownload,
230
233
  headers: { "Content-Type": "application/xml" },
231
234
  responseType: 'arraybuffer',
235
+ maxContentLength: Infinity,
236
+ maxBodyLength: Infinity,
237
+ insecureHTTPParser: true,
232
238
  httpsAgent: node.protocol === "https" ? httpsAgent : undefined
233
239
  });
234
240
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-hik-media-buffer",
3
- "version": "1.1.136",
3
+ "version": "1.1.138",
4
4
  "description": "Ottiene buffer video e immagine da camere Hikvision via ISAPI",
5
5
  "keywords": [
6
6
  "node-red",