docs: def parse_torrent_file(torrent):
      """parse local or remote torrent file"""
      link_re = re.compile(r'^(http?s|ftp)')
      if link_re.match(torrent):
          response = requests.get(torrent, headers=HEADERS, timeout=20)
          data = parse_torrent_buffer(response.content)
      elif os.path.isfile(torrent):
          with open(torrent, 'rb') as f:
              data = parse_torrent_buffer(f.read())
      else:
          data = None
      return data