Initial version, not so dynamic

This commit is contained in:
2021-12-22 12:33:52 +01:00
parent 96e466e35a
commit 212a058819
3 changed files with 57 additions and 0 deletions

17
PictureFetcher.ps1 Normal file
View File

@@ -0,0 +1,17 @@
# PictureFetcher.ps1
# Connects to the cameras and downloads the current picture
$storageDir = "\\Megabyte.home.zyrex.org\Vault\Vault\Upload\Webcam\Timelapse\"
$urlTunet = "http://172.17.50.221/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=snapshot&password=snapshot"
$urlGaardsplass = "http://172.17.50.220/ISAPI/Streaming/channels/101/picture"
$fileTunet = "$storageDir\Tunet_$(Get-Date -Format "yyyyMMdd_HH-mm-ss").jpg"
$fileGaardsplass = "$storageDir\Gaardsplass_$(Get-Date -Format "yyyyMMdd_HH-mm-ss").jpg"
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile($urlTunet,$fileTunet)
$webclient.Credentials = new-object System.Net.NetworkCredential('snapshot', 'Snapshot')
$webclient.DownloadFile($urlGaardsplass,$fileGaardsplass)