title: download image from url using python urllib but receiving HTTP Error 403: Forbidden
body: <p>I want to download image file from a url using python module "urllib.request", which works for some website (e.g. mangastream.com), but does not work for another (mangadoom.co) receiving error "HTTP Error 403: Forbidden". What could be the problem for the latter case and how to fix it?</p>
  
  <p>I am using python3.4 on OSX. </p>
  
  <pre><code>import urllib.request
  
  # does not work
  img_url = 'http://mangadoom.co/wp-content/manga/5170/886/005.png'
  img_filename = 'my_img.png'
  urllib.request.urlretrieve(img_url, img_filename)
  </code></pre>
  
  <p>At the end of error message it said:</p>
  
  <pre><code>... 
  HTTPError: HTTP Error 403: Forbidden
  </code></pre>
  
  <p>However, it works for another website</p>
  
  <pre><code># work
  img_url = 'http://img.mangastream.com/cdn/manga/51/3140/006.png'
  img_filename = 'my_img.png'
  urllib.request.urlretrieve(img_url, img_filename)
  </code></pre>
  
  <p>I have tried the solutions from the post below, but none of them works on mangadoom.co.</p>
  
  <p><a href="https://stackoverflow.com/questions/3042757/downloading-a-picture-via-urllib-and-python">Downloading a picture via urllib and python</a></p>
  
  <p><a href="https://stackoverflow.com/questions/1394721/how-do-i-copy-a-remote-image-in-python">How do I copy a remote image in python?</a></p>
  
  <p>The solution here also does not fit because my case is to download image.
  <a href="https://stackoverflow.com/questions/13303449/urllib2-httperror-http-error-403-forbidden">urllib2.HTTPError: HTTP Error 403: Forbidden</a></p>
  
  <p>Non-python solution is also welcome. Your suggestion will be very appreciated. </p>