Problem with image data stream to pushbullet

I have written the below script to send a pushbullet when my Dafang security cam have identified movement.

The “camera.dafang_motion_snapshot” seems to be raw data of some kind:

data:image/jpeg;base64, /9j/2wBDAAgGBgcGBQgHBwcJC…

When the script is executed I get data error. Do I need to export the raw data to a file before I send it to pushbullet?

alias: ‘security_cam_alert’
- service: notify.pushbullet
title: Security cam have identified movement
message: Security cam have identified movement!
file: camera.dafang_motion_snapshot

I finally solved this by adding the following to the script and then using the same filename to send to pushbullet.

  • service: camera.snapshot
    entity_id: camera.dafang_motion_snapshot
    filename: “/config/www/cam_captures/snapshot.jpg”