title: How to download .torrent files with no ['content-disposition']?
body: <p>I'm trying to quickly download kali-linux live-amd64.iso.torrent file from kali.org/downloads using requests, and bs4, but in the headers of the torrent response, there is no: <code>response.headers['content-disposition']</code> My reference was from: <a href="https://stackoverflow.com/questions/57618936/how-to-download-a-file-with-torrent-extension-from-link-with-python">How to download a file with .torrent extension from link with Python</a>. I looked into the headers of the torrent_response, and this is what came up:</p>
  <p><code>{'Server': 'nginx/1.14.2', 'Date': 'Thu, 08 Apr 2021 07:46:17 GMT', 'Content-Type': 'application/octet-stream', 'Content-Length': '274612', 'Connection': 'keep-alive', 'Last-Modified': 'Wed, 24 Feb 2021 17:39:18 GMT', 'ETag': '&quot;60368f46-430b4&quot;', 'X-Cache-Status': 'HIT', 'Accept-Ranges': 'bytes'}</code></p>
  <pre><code>class Download_Kali:
      
      def __init__(self, locator):
          self.locator = locator
  
      def locate_torrent(self):
          torrent_links = [torrent['href'] for torrent in self.locator.findAll('a', string='Torrent')]
          for live_iso in torrent_links:
              if 'live-amd64' in live_iso:
                  print('[*] Downloading iso Torrent')
                  return live_iso
  
      def install(self):
          import re, traceback
          try:
              with requests.get(Download_Kali(self.locator).locate_torrent()) as torrent_response:
                  torrent_response.raise_for_status()
                  
                  disposition = torrent_response.headers
                  print(disposition)
                  #torrent_file = re.findall('filename=&quot;(.+)&quot;', disposition)
                  #if torrent_file:
                  #    with open(torrent_file[0], 'wb') as f_torrent:
                  #        f_torrent.write(torrent_response.content)
          except requests.HTTPError as err:
              print(traceback.format_exc())
  </code></pre>