Created
September 23, 2017 14:44
-
-
Save SpaceBison/7aadc7ca80a9251489a13a68b11e772a to your computer and use it in GitHub Desktop.
Find live view stream URLs for Sony cameras
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOCATIONS=$(gssdp-discover -t urn:schemas-sony-com:service:DigitalImaging -n 10 | grep -oh "http.*xml") | |
URLS=() | |
function get_live_view_url_from_xml() { | |
xmlstarlet sel -N x="urn:schemas-upnp-org:device-1-0" -t -v "string(/x:root/x:device/av:X_ScalarWebAPI_DeviceInfo/av:X_ScalarWebAPI_ImagingDevice/av:X_ScalarWebAPI_LiveView_URL)" | |
} | |
for line in $LOCATIONS; do | |
echo $(curl -s $line | get_live_view_url_from_xml) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment