Hi,
spotify stores album covers on the localhost. I’m able to retrieve the URL by using a sensor. Now I want to use Node-RED to retrieve the image and save it to the local storage to use espHOME to display the picture on an epaper.
Currently the “trigger: state”-node send the URL to the “http request” node within the msg.payload. The “debug” node shows it without base64 encoding. But the “http request” cannont use the url - its invalid. And the Url starts with 2x http.
[node: dbgSpotify]
“http://homeassistant.local:8123/api/media_player_proxy/media_player.sonos?token=***&cache=3e374221731ddb45.jpg”
[node: localhost] - msg : error
“TypeError: Invalid URL:
http://http://homeassistant.local:8123/api/media_player_proxy/media_player.sonos?token=***&cache=3e374221731ddb45.jpg”
[
{
"id": "49133e8f8a330893",
"type": "tab",
"label": "SaveAlbumArt",
"disabled": false,
"info": ""
},
{
"id": "579cdc752b2948a2",
"type": "trigger-state",
"z": "49133e8f8a330893",
"name": "Spotify",
"server": "37ca2604.2a94ea",
"version": 0,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityid": "sensor.album_art",
"entityidfiltertype": "exact",
"debugenabled": false,
"constraints": [],
"outputs": 2,
"customoutputs": [],
"outputinitially": false,
"state_type": "str",
"x": 170,
"y": 80,
"wires": [
[
"08bc9cf38db69974",
"d6c79fc42bb02d8f"
],
[]
]
},
{
"id": "08bc9cf38db69974",
"type": "debug",
"z": "49133e8f8a330893",
"name": "dbgSpotify",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 310,
"y": 180,
"wires": []
},
{
"id": "d6c79fc42bb02d8f",
"type": "http request",
"z": "49133e8f8a330893",
"name": "localhost",
"method": "GET",
"ret": "bin",
"paytoqs": "ignore",
"url": "{{payload}}",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 460,
"y": 40,
"wires": [
[]
]
},
{
"id": "37ca2604.2a94ea",
"type": "server",
"name": "Home Assistant",
"version": 1,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": false,
"cacheJson": true
}
]
What I can do to retrieve the URL without base64-encoding and just one http?
Thank you
Matthias