alexwbaule / telegramopenwrt

Telegram Scripts for OpenWrt/Lede Project
Apache License 2.0
115 stars 42 forks source link

cam plugins variables #32

Open nikkymen opened 2 months ago

nikkymen commented 2 months ago

I think there's a bug in the camera plugins - there's not enough variable query in them:

header_auth=$(uci -q get telegramopenwrt.ipcam.header_auth)
ipaddr=$(uci -q get telegramopenwrt.ipcam.ipaddr)
user=$(uci -q get telegramopenwrt.ipcam.user)
passwd=$(uci -q get telegramopenwrt.ipcam.passwd)
alexwbaule commented 2 months ago

Hi, @nikkymen

Depends on the camera that you use. If the authentication is a Basic, is just the "user: password" in base64.

alexwbaule commented 2 months ago

What type of authentication your camera has ?

The code to call the camera is this:

curl -s -k -H "Authorization:Basic ${header_auth}" "http://${ipaddr}/videostream.asf?user=${user}&pwd=${passwd}" -m 25 -o /tmp/movie.asf -D /tmp/header
nikkymen commented 1 month ago

What type of authentication your camera has ?

The code to call the camera is this:

curl -s -k -H "Authorization:Basic ${header_auth}" "http://${ipaddr}/videostream.asf?user=${user}&pwd=${passwd}" -m 25 -o /tmp/movie.asf -D /tmp/header

You use variables like {ipaddr}, but not define them in the camera plugins examples