docs: def chrome_cookies(
          url: str,
          cookie_file: str = None,
          browser: str = "Chrome",
          curl_cookie_file: str = None,
          ) -> dict:
      """Retrieve cookies from Chrome/Chromium on OSX or Linux.
  
      Args:
          url: Domain from which to retrieve cookies, starting with http(s)
          cookie_file: Path to alternate file to search for cookies
          browser: Name of the browser's cookies to read ('Chrome' or 'Chromium')
          curl_cookie_file: Path to save the cookie file to be used with cURL
      Returns:
          Dictionary of cookie values for URL
  
      """
      # If running Chrome on OSX
      if sys.platform == 'darwin':
          config = get_osx_config(browser)
      elif sys.platform.startswith('linux'):
          config = get_linux_config(browser)
      else:
          raise OSError("This script only works on OSX or Linux.")
  
      config.update({
          'init_vector': b' ' * 16,
          'length': 16,
          'salt': b'saltysalt',
      })
  
      if cookie_file:
          cookie_file = str(pathlib.Path(cookie_file).expanduser())
      else:
          cookie_file = str(pathlib.Path(config['cookie_file']).expanduser())
  
      enc_key = pbkdf2_hmac(hash_name='sha1',
                            password=config['my_pass'].encode('utf8'),
                            salt=config['salt'],
                            iterations=config['iterations'],
                            dklen=config['length'])
  
      parsed_url = urllib.parse.urlparse(url)
      if parsed_url.scheme:
          domain = parsed_url.netloc
      else:
          raise urllib.error.URLError("You must include a scheme with your URL.")
  
      try:
          conn = sqlite3.connect(cookie_file)
      except sqlite3.OperationalError:
          print("Unable to connect to cookie_file at: {}\n".format(cookie_file))
          raise
  
      # Check whether the column name is `secure` or `is_secure`
      secure_column_name = 'is_secure'
      for sl_no, column_name, data_type, is_null, default_val, pk \
              in conn.execute('PRAGMA table_info(cookies)'):
          if column_name == 'secure':
              secure_column_name = 'secure'
              break
  
      sql = ('select host_key, path, ' + secure_column_name +
             ', expires_utc, name, value, encrypted_value '
             'from cookies where host_key like ?')
  
      cookies = dict()
      curl_cookies = []
  
      for host_key in generate_host_keys(domain):
          for hk, path, is_secure, expires_utc, cookie_key, val, enc_val \
                  in conn.execute(sql, (host_key,)):
              # if there is a not encrypted value or if the encrypted value
              # doesn't start with the 'v1[01]' prefix, return v
              if val or (enc_val[:3] not in (b'v10', b'v11')):
                  pass
              else:
                  val = chrome_decrypt(enc_val, key=enc_key,
                                       init_vector=config['init_vector'])
              cookies[cookie_key] = val
              if curl_cookie_file:
                  # http://www.cookiecentral.com/faq/#3.5
                  curl_cookies.append('\t'.join(
                      [hk, 'TRUE', path, 'TRUE' if is_secure else 'FALSE',
                       str(expires_utc), cookie_key, val]
                  ))
  
      conn.rollback()
  
      # Save the file to destination
      if curl_cookie_file:
          with open(curl_cookie_file, "w") as text_file:
              text_file.write('\n'.join(curl_cookies) + '\n')
  
      return cookies