Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Rename to Bartkira.py
- # python Bartkira.py
- # python v2 needed
- # Wait ...
- import urllib2
- import time
- images = []
- base_url = "http://www.bartkira.com/uploads/"
- source = urllib2.urlopen("http://www.bartkira.com/volume-3.html")
- for line in source.readlines():
- if "wSlideshow.render" in line:
- loc = -1
- while True:
- loc = line.find("1/0", loc + 1)
- print loc
- if loc != -1:
- end = line.find(".", loc) + 5
- #print end
- #image_url2 = base_url + line[loc:end].replace(".", "_orig.")
- image_url2 = base_url + line[loc:end].replace(".", "_orig.").replace("\\","").replace("\"", "")
- print image_url2
- #image_url3 = image_url2.replace("'\'", "")
- #print image_url3
- images.append(image_url2)
- else:
- break
- index = 0
- for image in images:
- print image
- image_type = ".jpg"
- if ".jpg" in image:
- image_type = ".jpg"
- if ".png" in image:
- image_type = ".png"
- if ".jpeg" in image:
- image_type = ".jpg"
- if ".jpe" in image:
- image_type = ".jpg"
- imagefile = urllib2.urlopen(image)
- page_name = "Bartkira3_" + str(index+1).zfill(3) + image_type
- output = open(page_name,'wb')
- output.write(imagefile.read())
- output.close()
- time.sleep(1)
- index += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement