{"record":{"id":"cdeadb06faa05992","repo":"xtekky/gpt4free","slug":"meta-ai-isn-t-available-yet-in-your-country","errorCode":null,"errorMessage":"Meta AI isn't available yet in your country","messagePattern":"Meta AI isn't available yet in your country","errorType":"exception","errorClass":"AbraGeoBlockedError","httpStatus":null,"severity":"error","filePath":"g4f/Provider/needs_auth/MetaAI.py","lineNumber":196,"sourceCode":"                        last_snippet_len = new_snippet_len\n            # if last_streamed_response is None:\n            #    if attempts > 3:\n            #        raise Exception(\"MetaAI is having issues and was not able to respond (Server Error)\")\n            #    access_token = await self.get_access_token()\n            #    return await self.prompt(message=message, attempts=attempts + 1)\n            if fetch_id is not None:\n                sources = await self.fetch_sources(fetch_id)\n                if sources is not None:\n                    yield sources\n\n    async def update_cookies(self, cookies: Cookies = None):\n        async with self.session.get(\n            \"https://www.meta.ai/\", cookies=cookies\n        ) as response:\n            await raise_for_status(response, \"Fetch home failed\")\n            text = await response.text()\n            if \"AbraGeoBlockedError\" in text:\n                raise AbraGeoBlockedError(\"Meta AI isn't available yet in your country\")\n            if cookies is None:\n                cookies = {\n                    \"_js_datr\": self.extract_value(text, \"_js_datr\"),\n                    \"abra_csrf\": self.extract_value(text, \"abra_csrf\"),\n                    \"datr\": self.extract_value(text, \"datr\"),\n                }\n            self.lsd = self.extract_value(\n                text, start_str='\"LSD\",[],{\"token\":\"', end_str='\"}'\n            )\n            self.dtsg = self.extract_value(\n                text, start_str='\"DTSGInitialData\",[],{\"token\":\"', end_str='\"}'\n            )\n            self.cookies = cookies\n\n    async def fetch_sources(self, fetch_id: str) -> Sources:\n        if self.access_token is None:\n            url = \"https://www.meta.ai/api/graphql/\"\n            payload = {\"lsd\": self.lsd, \"fb_dtsg\": self.dtsg}","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/needs_auth/MetaAI.py#L178-L214","documentation":"During MetaAI.update_cookies(), the fetched www.meta.ai homepage HTML contains 'AbraGeoBlockedError', Meta's marker for regional unavailability. g4f maps it to AbraGeoBlockedError, telling you Meta AI is not offered in the geography of your IP address.","triggerScenarios":"GET https://www.meta.ai/ (with optional cookies) whose response text embeds AbraGeoBlockedError — any instantiation of MetaAI from a blocked country or via a proxy exit node in one.","commonSituations":"Servers hosted in the EU/UK or other unsupported regions; VPN/proxy whose exit IP resolves to a blocked country; traveling users; CI runners in unsupported datacenter regions.","solutions":["Pass a proxy with an exit IP in a supported country (e.g. US): MetaAI(proxy='http://...')","Verify the effective geolocation of your egress IP before instantiating","Catch AbraGeoBlockedError and fall back to another provider when no suitable proxy exists"],"exampleFix":"// before\nmeta = MetaAI()  # AbraGeoBlockedError in unsupported region\n\n// after\nmeta = MetaAI(proxy='http://user:pass@us-residential.example:8080')\n# or fall back\ntry:\n    meta = MetaAI(proxy=proxy)\nexcept AbraGeoBlockedError:\n    provider = use_alternative_provider()","handlingStrategy":"validation","validationCode":"import urllib.request, json\ngeo = json.load(urllib.request.urlopen('http://ip-api.com/json/'))\nif geo.get('countryCode') not in ('US', 'CA'):  # Meta AI supported regions\n    proxy = 'http://us-proxy.example:8080'\nmeta = MetaAI(proxy=proxy)","typeGuard":null,"tryCatchPattern":"from g4f.Provider.needs_auth.MetaAI import AbraGeoBlockedError\ntry:\n    meta = MetaAI(proxy=proxy)\nexcept AbraGeoBlockedError:\n    meta = None  # provider unusable from this egress; switch provider","preventionTips":["Check egress IP geolocation before using MetaAI","Route via a supported-country proxy in deployed environments","Provide an alternative provider in your abstraction for geo-blocked cases"],"tags":["metaai","geo-restriction","proxy","auth"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}