node-red-contrib-hik-media-buffer 1.1.13 → 1.1.14

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.
@@ -48,17 +48,17 @@ module.exports = function(RED) {
48
48
  });
49
49
 
50
50
  try {
51
- // Interroghiamo il CANALE specifico (es. /channels/2)
51
+ // Interroghiamo l'overlay del nome del canale specifico
52
52
  const res = await camAuth.request({
53
53
  method: 'GET',
54
- url: `${node.protocol}://${cam.ip}:${node.port}/ISAPI/System/Video/inputs/channels/${cam.channel}`,
54
+ url: `${node.protocol}://${cam.ip}:${node.port}/ISAPI/System/Video/inputs/channels/${cam.channel}/overlays/channelNameOverlay`,
55
55
  timeout: 5000,
56
56
  httpsAgent: node.protocol === "https" ? httpsAgent : undefined
57
57
  });
58
58
 
59
59
  const data = res.data.toString();
60
60
 
61
- // In questo XML il tag è solitamente <name>
61
+ // Il manuale specifica che il nome è nel tag <name>
62
62
  const match = data.match(/<name>([^<]+)<\/name>/i);
63
63
 
64
64
  if (match && match[1]) {
@@ -68,19 +68,8 @@ module.exports = function(RED) {
68
68
  }
69
69
 
70
70
  } catch (e) {
71
- // Se l'URL sopra fallisce (alcuni modelli vecchi), proviamo questo URL alternativo
72
- try {
73
- const resAlt = await camAuth.request({
74
- method: 'GET',
75
- url: `${node.protocol}://${cam.ip}:${node.port}/ISAPI/ContentMgmt/InputProxy/channels/${cam.channel}`,
76
- timeout: 3000
77
- });
78
- const dataAlt = resAlt.data.toString();
79
- const matchAlt = dataAlt.match(/<name>([^<]+)<\/name>/i);
80
- return matchAlt ? matchAlt[1].trim() : `Cam_${cam.channel}`;
81
- } catch (err) {
82
- return `Camera_${cam.ip}`;
83
- }
71
+ // Fallback: se non risponde, usiamo l'IP
72
+ return `Camera_${cam.ip}`;
84
73
  }
85
74
  }
86
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-hik-media-buffer",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "description": "Ottiene buffer video e immagine da camere Hikvision via ISAPI",
5
5
  "keywords": [
6
6
  "node-red",