title: Python get s3 file from download link
body: <p>I have a download link like such:</p>
  
  <pre><code>url = https://api.some.service:443/v2/encodedreport/13402/custom/7378/2019/05/30/MTA4Nzk2X1RlYWRzJTIwLSUyMERTVyUyMFJlcG9ydF8yMDE5MDUzMDEzMDU1OC54bHN4
  </code></pre>
  
  <p>When i click on the link or open in a browser it starts the download manager and I can click download to download the (xlsx) file. I'd like to automate this download with python.</p>
  
  <p>I tried using requests:</p>
  
  <pre><code>&gt;&gt;&gt; r = requests.get(url)
  # long string of binary looking data
  &gt;&gt;&gt; r.content
  b'PK\x03\x04\x14\x00\x08\x08\x08\x00\xbdh\xbeN\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00_rels/.rels\xad\x92MK\x031\x10\x86\xffJ\x98{7\xdb*"\xd2\xb4\x17\x11z\x13\xa9?`Lf?\xd8M&amp;$S]\xff\xbdA\x0f\xda\xb2\x85\n=\x0e3\xef\xf3&gt;\x87Yo\'?\xaawJ\xb9\xe7``Y\xd5\xa0(Xv}h\r\xbc\xee\x9f\x16\xf7\xa0\xb2`p8r \x03\x81a\xbbY\xbf\xd0\x8...
  # seems to involve aws s3
  &gt;&gt;&gt; r.headers
  {'x-amz-id-2': 'lI0SDLtoaJHSJF4Ekn6uq81aFNn...f5rGbREk3iEKzZSq2Hyr1ykFwOYq2kpw=', 'x-amz-request-id': 'C01C13...C19B3C', 'Date': 'Mon, 01 Jul 2019 13:59:45 GMT', 'Last-Modified': 'Thu, 30 May 2019 13:05:59 GMT', 'x-amz-expiration': 'expiry-date="Sun, 30 May 2021 00:00:00 GMT", rule-id="outdated-reports-after-2years"', 'ETag': '"3924c5ba183c...88bf658db37dc"', 'x-amz-server-side-encryption': 'AES256', 'Accept-Ranges': 'bytes', 'Content-Type': 'application/octet-stream', 'Content-Length': '8261', 'Server': 'AmazonS3'}
  </code></pre>
  
  <p>How can i download this file programmatically?</p>