def METHOD_NAME(response):
    """Extract filename from content-disposition headers if available."""
    content_disposition = response.headers.get("content-disposition", None)
    if not content_disposition:
        return None
    entries = content_disposition.split(";")
    name_entry = next((e.strip() for e in entries if e.strip().lower().startswith("filename*=")), None)
    if name_entry:
        name = name_entry.split("=", 1)[1].strip()
        encoding, _, name = name.split("'")
        return urllib.parse.unquote(name, encoding, errors="strict")
    name_entry = next((e.strip() for e in entries if e.strip().lower().startswith("filename=")), None)
    if not name_entry:
        return None
    filename = name_entry.split("=", 1)[1].strip()
    if filename.startswith('"'):
        filename = filename[1:-1]
    return filename