How to get image from data url?

i get image in this format how to convert it to usual photo and post in telegram? pls help

This is a base64 string URL

There are 2 options -

Option 1 - Use the code node to convert to binary file

Sample code would look like this -

const base64String = $input.first().json.image_url.url;

// Strip the data:image/png;base64, prefix
const base64Data = base64String.replace(/^data:image\/\w+;base64,/, '');

return [{
  json: {},
  binary: {
    data: {
      data: base64Data,
      mimeType: 'image/png',
      fileName: 'image.png'
    }
  }
}];

Option 2 - Extract the base64 text and convert to Binary

There’s a native node on n8n for this.