/ Published in: Python
untested and will probably destroy your computer
coded for python3.1
coded for python3.1
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# fetches first site of deviantart, extracts info and fetches fullsize images ~ 26 pieces # © Patrik Plihal; patrik.plihal gmx at # license: GPL import urllib.request import re savefile = 'aria2c_job' #target = "http://www.deviantart.com" #main site target = "http://browse.deviantart.com/traditional/?order=24" # category 'traditional' # query html response = urllib.request.urlopen(target,timeout=5) content = response.read() # calculate fullscreen content = content.replace(b'http://th',b'http://fc') content = content.replace(b'/150/',b'/') # filter images imgs = re.findall(b"src=\"(http:\/\/fc[^\"]*\.jpg)\"",content) # save print("fetching %s image links from deviantart..." % len(imgs)) with open(savefile, mode='wb') as job: for img in imgs: job.write(img + b"\n") print('saving to "' + savefile + '"') print('done')