Created
May 12, 2014 00:59
-
-
Save ihercowitz/31e9fea7e011e19e3372 to your computer and use it in GitHub Desktop.
downloading the disney photopass files like a boss (for free)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import shutil | |
from lxml.html import fromstring | |
DPP='http://www.disneyphotopass.com' | |
html = fromstring(open('photopassinfos.html', 'r').read()) | |
imgs = html.cssselect('img') | |
for index, img in enumerate(imgs): | |
tmp = img.get('src').replace('=36', '=3096').replace('=70', '=300') + '&aspectRatio=EightByTen' | |
response = requests.get(DPP+tmp, stream=True) | |
with open('disney/'+str(index)+'.jpg', 'wb') as outf: | |
shutil.copyfileobj(response.raw, outf) | |
del response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment