Created
June 14, 2014 10:45
-
-
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
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
# -*- 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