Telegram - How to send image from MotioneyeOS

Hello,
I have a active MotioneyeOS camera in my network.
How can I send a image using “sendTelegramPhoto”? I tried it several times, but now I have no clue.

Thanks
Tobus

It’s documented here.

I’m aware of this description, but it doesnt help in my case.
The MotionEye provides me two links:
Streaming URL
Embed URL

But what I want is only a jpg or png so the two links doesnt work for me.

This is my solution to send the last photo in telegram

import time

import datetime

import os

import glob

ts = time.time()

stfolder = datetime.datetime.fromtimestamp(ts).strftime(‘%Y-%m-%d’)

print(stfolder)

list_of_files = glob.glob(‘/data/output/Camera1/’ + stfolder + ‘/*’)

latest_file = max(list_of_files, key=os.path.getmtime)

final_path = “@”+latest_file

print(final_path)

final = “curl -s -X POST ‘https://api.telegram.org/botXXXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYY/sendPhoto’ -F chat_id=-XXXXXXXXXXXXX -F photo=” + final_path + " -F caption=‘Alarm/Carefull!!!’"

os.system(final)

Captura de Pantalla 2021-11-21 a la(s) 1.17.23