Skip to content

Meta Ai bot detection #70

@NikitHamal

Description

@NikitHamal

I guess meta is blocking the request? Meta just today launched new models too!

InvalidHeader                             Traceback (most recent call last)
[/tmp/ipykernel_1676/52350185.py](https://localhost:8080/#) in <cell line: 0>()
      2 
      3 ai = MetaAI()
----> 4 response = ai.prompt(message="Whats the weather in San Francisco today? And what is the date?")
      5 print(response)
      6 

8 frames
[/usr/local/lib/python3.12/dist-packages/requests/utils.py](https://localhost:8080/#) in _validate_header_part(header, header_part, header_validator_index)
   1046     if not validator.match(header_part):
   1047         header_kind = "name" if header_validator_index == 0 else "value"
-> 1048         raise InvalidHeader(
   1049             f"Invalid leading whitespace, reserved character(s), or return "
   1050             f"character(s) in header {header_kind}: {header_part!r}"

InvalidHeader: Invalid leading whitespace, reserved character(s), or return character(s) in header value: "_js_datr=ml>\n<head>\n<title>Meta AI</title>\n</head>\n<body>\n<script>\n\n(function() {\n  if (document.readyState !== 'loading') {\n    executeChallenge();\n  } else {\n    document.addEventListener('DOMContentLoaded', executeChallenge);\n  }\n  function executeChallenge() {\n    fetch('/__rd_verify_Q_6hBQPV6akV_tLvtthtB6tZh3hISWnlJp4ycqGzIxlU25D7tQ?challenge=3', {\n      method: 'POST',\n    })\n    .finally(() => window.location.reload());\n  }\n})();\n\n</script>\n</body>\n</html>; abra_csrf=l>\n<head>\n<title>Meta AI</title>\n</head>\n<body>\n<script>\n\n(function() {\n  if (document.readyState !== 'loading') {\n    executeChallenge();\n  } else {\n    document.addEventListener('DOMContentLoaded', executeChallenge);\n  }\n  function executeChallenge() {\n    fetch('/__rd_verify_Q_6hBQPV6akV_tLvtthtB6tZh3hISWnlJp4ycqGzIxlU25D7tQ?challenge=3', {\n      method: 'POST',\n    })\n    .finally(() => window.location.reload());\n  }\n})();\n\n</script>\n</body>\n</html>; datr=\n<html>\n<head>\n<title>Meta AI</title>\n</head>\n<body>\n<script>\n\n(function() {\n  if (document.readyState !== 'loading') {\n    executeChallenge();\n  } else {\n    document.addEventListener('DOMContentLoaded', executeChallenge);\n  }\n  function executeChallenge() {\n    fetch('/__rd_verify_Q_6hBQPV6akV_tLvtthtB6tZh3hISWnlJp4ycqGzIxlU25D7tQ?challenge=3', {\n      method: 'POST',\n...`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions