equal
deleted
inserted
replaced
155 chunk = response.read(CHUNK) |
155 chunk = response.read(CHUNK) |
156 if not chunk: break |
156 if not chunk: break |
157 if first_chunk and chunk.find('<div id="sign_in_box">') != -1: |
157 if first_chunk and chunk.find('<div id="sign_in_box">') != -1: |
158 # our urllib2 cookies have gone awol - login again |
158 # our urllib2 cookies have gone awol - login again |
159 login(False) |
159 login(False) |
160 req = urllib2.Request(downloadurl) |
160 req = urllib2.Request(downloadurl, None, headers) |
161 response = urllib2.urlopen(req) |
161 response = urllib2.urlopen(req) |
162 chunk = response.read(CHUNK) |
162 chunk = response.read(CHUNK) |
163 fp.write(chunk) |
163 fp.write(chunk) |
164 first_chunk = False |
164 first_chunk = False |
165 fp.close() |
165 fp.close() |