From: Marek Marecki Date: Sat, 10 Aug 2013 12:28:13 +0000 (+0200) Subject: Fixed a bug in sensual_asa_cat.py X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=35293bc1093781f18a578caf6ca1baa93638ecbb;p=diaspy.git Fixed a bug in sensual_asa_cat.py --- diff --git a/sensual_asa_cat.py b/sensual_asa_cat.py index ec685fc..afe9ef6 100644 --- a/sensual_asa_cat.py +++ b/sensual_asa_cat.py @@ -42,14 +42,14 @@ while len(oldstream) != len(user.stream): print('Posts found:', len(user.stream)) for i, p in enumerate(oldstream): - #print(repr(p), '\n(', p.data, ')', '\n\n----\n') print(repr(p)) if p.data['photos']: print('Downloading photos...') for n, photo in enumerate(p.data['photos']): print('{0}/{1}'.format(n+1, len(p.data['photos'])), end='\t') try: - urllib.request.urlretrieve(url=photo['sizes']['large'], filename=photo['guid']) + name = photo['guid'] + photo['sizes']['large'].split('.')[-1] + urllib.request.urlretrieve(url=photo['sizes']['large'], filename=name) print('[ OK ]') except Exception as e: print('[ FAIL: {0}]'.format(e))