title: How to get python to successfully download large images from the internet
body: <p>So I've been using</p>
  
  <pre><code>urllib.request.urlretrieve(URL, FILENAME)
  </code></pre>
  
  <p>to download images of the internet. It works great, but fails on some images. The ones it fails on seem to be the larger images- eg. <a href="http://i.imgur.com/DEKdmba.jpg" rel="nofollow">http://i.imgur.com/DEKdmba.jpg</a>. It downloads them fine, but when I try to open these files photo viewer gives me the error "windows photo viewer cant open this picture because the file appears to be damaged corrupted or too large".</p>
  
  <p>What might be the reason it can't download these, and how can I fix this?</p>
  
  <p>EDIT: after looking further, I dont think the problem is large images- it manages to download larger ones. It just seems to be some random ones that it can never download whenever I run the script again. Now I'm even more confused</p>