Skip to content

Instantly share code, notes, and snippets.

@SpaceBison
Created September 23, 2017 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpaceBison/7aadc7ca80a9251489a13a68b11e772a to your computer and use it in GitHub Desktop.
Save SpaceBison/7aadc7ca80a9251489a13a68b11e772a to your computer and use it in GitHub Desktop.
Find live view stream URLs for Sony cameras
#!/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