title: Retrieve files from URLs and save those with correct extension
body: <p>I want to create a simple Python based utility which can get all the download URLs from a web page and download the content. I found several methods of doing this and the best I found was "urllib". But unfortunately the problem with me is I can't save those with the proper extensions as the URLs look like below,</p>
  
  <p><code>http://example.com/2w3xa75</code></p>
  
  <p>But the content can be in different formats i.e. .mp3, .ogg etc. </p>
  
  <p>How can I identify the type and save these contents with the correct extension. </p>