title: Getting mp4 file size before downloading with python requests
body: <p>I am writing little script to download video files from some websites for my friend and i want to add progress bar to this but the problem is that there is no "content-length" in headers. I have got this.</p>
  
  <pre><code>size = requests.head(link["link"], headers={'Accept-Encoding': 'identity'})
  </code></pre>
  
  <p>And i got this in return:</p>
  
  <pre><code>'X-Varnish': 'HV116W137',
  'Age': '84',
  'Vary': 'Accept-Encoding',
  'Server': 'Apache',
  'Connection': 'keep-alive', 
  'Via': '1.1 varnish', 
  'cache-control': 'max-age=60, public, 
  's-maxage=300', 
  'Date': 'Tue, 22 Dec 2015 17:31:05 GMT', 
  'x-frame-options': 'deny', 
  'Content-Type': 'text/html; charset=UTF-8'
  </code></pre>
  
  <p>link: <a href="http://n-4-15.dcs.redcdn.pl/dcs/o2/tvn/web-content/m/p1/v/4e6cd95227cb0c280e99a195be5f6615/6398d4db-c842-49c7-8d1f-d1018cd0c95b-480p.mp4" rel="nofollow">http://n-4-15.dcs.redcdn.pl/dcs/o2/tvn/web-content/m/p1/v/4e6cd95227cb0c280e99a195be5f6615/6398d4db-c842-49c7-8d1f-d1018cd0c95b-480p.mp4</a></p>
  
  <p>I suppose that this is possible as browser can tell how big is file before downloading this.</p>