Skip to content

Instantly share code, notes, and snippets.

@brazen-paradox
Last active August 4, 2020 14:10
Show Gist options
  • Save brazen-paradox/5a021f0283814b959e7453b341f9f2dc to your computer and use it in GitHub Desktop.
Save brazen-paradox/5a021f0283814b959e7453b341f9f2dc to your computer and use it in GitHub Desktop.
Script to download the visual media files from iphone that are hosted via Wifi photos application
#!/bin/bash
start_index=$1
end_index=$2
if [ -z $start_index ] || [ -z $end_index ] ; then
echo "Kindly provide starting and ending index"
exit 1
fi
for i in $( seq $start_index $end_index );
do
html_url="192.168.31.184:15555/0/im_$i.html";
is_video=$(curl -s $html_url | grep --only-matching video)
if [ ! -z $is_video ];
then
url="192.168.31.184:15555/0/fs_$i.mov"
echo "Downloading video $url"
else
url="192.168.31.184:15555/0/fr_$i.jpg"
echo "Downloading image $url"
fi
wget $url
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment