#!/usr/bin/python # download google picassa images from rss channel album # written specifically for velo.nsk.ru by Citibiker import sys import re import os user = sys.argv[1] rss = os.path.join(user,'rss.xml') directory = os.path.join(user,'photo') outlist = os.path.join(user,'wgetlist.txt') a = open(rss,'r') b = a.readlines() a.close() chunks = b[0].split("'") chk = re.compile('\/s(72|144|288)\/') jpeg = re.compile('\.(jpg|JPG|jpeg|JPEG)$') dupe = None os.system ('mkdir %s' % (directory) ) wget = open(outlist,'w') for c in chunks: if c[:5]=='https' and jpeg.search (c, re.IGNORECASE) and not chk.search (c, re.IGNORECASE) and not dupe==c: os.system ('cd %s; wget -c %s' % (directory,c) ) wget.write("%s\n"%(c)) print c dupe = c wget.close() os.system ('./generate_list.py %s' % (user) )