Skip to content

Instantly share code, notes, and snippets.

@Epithumia
Created June 14, 2014 10:45
Show Gist options
  • Save Epithumia/a35b2fc19654a7d19a8a to your computer and use it in GitHub Desktop.
Save Epithumia/a35b2fc19654a7d19a8a to your computer and use it in GitHub Desktop.
Simple script to download images wirelessly from the Olympus E-M1 to the computer
# -*- coding: utf-8 -*-
from urllib import urlretrieve
from urllib2 import urlopen
import re
page = urlopen('http://192.168.0.10/DCIM').read()
#print page
m = re.findall('(wlansd.*DCIM.*;)',page)
for entry in m:
folder = entry.split(',')[1]
#print folder
page = urlopen('http://192.168.0.10/DCIM/'+folder).read()
#print page
sub = re.findall('wlansd.*DCIM.*;',page)
for f in sub:
img = f.split(',')[1]
url = 'http://192.168.0.10/DCIM/' + folder + '/' + img
print 'Retrieving ' + url
urlretrieve(url,img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment