title: Python download without supplying a filename
body: <p>How do I download a file with progress report using python but without supplying a filename.</p>
  
  <p>I have tried urllib.urlretrieve but I seem to have to supply a filename for the downloaded file to save as.</p>
  
  <p>So for example:</p>
  
  <p>I don't want to supply this:</p>
  
  <pre><code>urllib.urlretrieve("http://www.mozilla.com/products/download.html?product=firefox-3.6.3&amp;os=win&amp;lang=en-US", "/tmp/firefox.exe")
  </code></pre>
  
  <p>just this:</p>
  
  <pre><code>urllib.urlretrieve("http://www.mozilla.com/products/download.html?product=firefox-3.6.3&amp;os=win&amp;lang=en-US", "/tmp/")
  </code></pre>
  
  <p>but if I do I get this error:</p>
  
  <pre><code>IOError: [Errno 21] Is a directory: '/tmp'
  </code></pre>
  
  <p>Also unable to get the filename from some URL 
  Example:</p>
  
  <p><a href="http://www.mozilla.com/products/download.html?product=firefox-3.6.3&amp;os=win&amp;lang=en-US" rel="noreferrer">http://www.mozilla.com/products/download.html?product=firefox-3.6.3&amp;os=win&amp;lang=en-US</a></p>