#!/usr/local/bin/python # vim:fileencoding= # -*- coding: -*- # Sankakucomplex.com gallery articles mass downloader script # You'll need python 2.5+ installed. # Usage: Sankaku.py articleaddress1 [articleaddress2 ...] # # Uses wget (has to be in paths or same dir as the script), # which allows to skip what has already been downloaded and # to (resume)download what hasn't. import os.path import subprocess import sys import re import urllib __author__="Kaens Bard" __date__ ="$Apr 2, 2009 4:54:30 PM$" #preprocessing the link(s) for name in sys.argv[1:]: toget = name if toget[-1:] != '/': toget += '/' print toget, p1 = re.match('http://www\.sankakucomplex\.com/(\d{4})/(\d{2})/(\d{2})/(.*)/',toget) if p1: print '- retrieving...' p1dir = p1.group(1)+'-'+p1.group(2)+'-'+p1.group(3)+' '+p1.group(4) if not os.path.exists(p1dir): os.mkdir(p1dir) finished = False if not os.path.exists(p1dir+'.html'): urllib.urlretrieve(toget,p1dir+'.html') with open(p1dir+'.html','r') as f: for l in f: if re.search("Toggle Visibility of Mature Content",l): finished = True break p2 = re.search('