Send MQTT raw image to Telegram automation

I’m getting a raw JPEG image in MQTT in a topic like this:
“b’\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C…”

How could I get this to send to Telegram?
Telegram images integration only supports file or URL location, however, I’m getting this via image.

Any idea of how to send it?

I’d prefer not to use this integration: MQTT Camera - Home Assistant
As I may miss some images if they come too quickly.

You would need to write the raw bytes to a file and then send the file.

If you use Nabu Casa for remote access the service comes with a secure URL redirection link.

That way you store the image locally on HASS, then send the EXTERNAL https URL to Nabu Casa which redirects back to your local HASS instance.

Nabu Casa notifications also work well, and support images. My doorbell automation sends a notification with an attachment, and also links back to the file URL.

I guess so, but… how to write from MQTT topic to a file in a automation?