title: Need urllib.urlretrieve and urllib2.OpenerDirector together
body: <p>I'm writing a script in Python 2.7 which uses a <code>urllib2.OpenerDirector</code> instance via <code>urllib2.build_opener()</code> to take advantage of the <code>urllib2.HTTPCookieProcessor</code> class, because I need to store and re-send the cookies I get:</p>
  
  <pre><code>opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookielib.CookieJar()))
  </code></pre>
  
  <p>However, after making several requests and moving the cookies around, eventually I need to retrieve a list of URLs. I wanted to use <code>urllib.urlretrieve()</code> because I read it downloads the file in chunks, but I cannot because I need to carry my cookies on the request and
  <code>urllib.urlretrieve()</code> uses a <code>urllib.URLOpener</code>, which doesn't have support for cookie handlers like <code>OpenerDirector</code> has.</p>
  
  <p>What's the reason of this strange way of splitting functionality, and how can I achieve my goal?</p>