{"record":{"id":"803a1d8b9ae55d0a","repo":"ytdl-org/youtube-dl","slug":"cannot-parse-data","errorCode":null,"errorMessage":"Cannot parse data","messagePattern":"Cannot parse data","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/facebook.py","lineNumber":594,"sourceCode":"                    '__rev': self._search_regex(\n                        r'client_revision[\"\\']\\s*:\\s*(\\d+),', webpage,\n                        'client revision', default='3944515'),\n                    'fb_dtsg': self._search_regex(\n                        r'\"DTSGInitialData\"\\s*,\\s*\\[\\]\\s*,\\s*{\\s*\"token\"\\s*:\\s*\"([^\"]+)\"',\n                        webpage, 'dtsg token', default=''),\n                }),\n                headers={\n                    'Content-Type': 'application/x-www-form-urlencoded',\n                })\n            tahoe_js_data = self._parse_json(\n                self._search_regex(\n                    r'for\\s+\\(\\s*;\\s*;\\s*\\)\\s*;(.+)', tahoe_data,\n                    'tahoe js data', default='{}'),\n                video_id, fatal=False)\n            video_data = extract_from_jsmods_instances(tahoe_js_data)\n\n        if not video_data:\n            raise ExtractorError('Cannot parse data')\n\n        if len(video_data) > 1:\n            entries = []\n            for v in video_data:\n                video_url = v[0].get('video_url')\n                if not video_url:\n                    continue\n                entries.append(self.url_result(urljoin(\n                    url, video_url), self.ie_key(), v[0].get('video_id')))\n            return self.playlist_result(entries, video_id)\n        video_data = video_data[0]\n\n        formats = []\n        subtitles = {}\n        for f in video_data:\n            format_id = f['stream_type']\n            if f and isinstance(f, dict):\n                f = [f]","sourceCodeStart":576,"sourceCodeEnd":612,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/facebook.py#L576-L612","documentation":"Raised by the Facebook extractor as a last resort after every extraction path fails: the HTML video_data search, the GraphQL/attachment parsing, the watchparty API, and the tahoe JS data all returned nothing usable. 'Cannot parse data' means the extractor could not locate any embedded video metadata on the page, usually because Facebook changed its markup or served a login/consent wall. It is NOT marked expected, so it often indicates an extractor that is out of date.","triggerScenarios":"_real_extract downloads the webpage, video_data stays falsy through the HTML regex, the GraphQL video/attachment walk, the tahoe AJAX request, and then hits 'raise ExtractorError(\"Cannot parse data\")'. Typical causes: Facebook A/B-tested new page structure, the page is behind a login redirect, or the tahoe endpoint returned empty JS data.","commonSituations":"Running an old youtube-dl release months after a Facebook frontend deploy; extracting from datacenter IPs that Facebook serves degraded pages to; URLs to non-video posts (photo albums, text posts) that contain no video metadata.","solutions":["Update youtube-dl to the newest version (or switch to yt-dlp, which tracks Facebook layout changes much more actively)","Pass --cookies from a logged-in session so Facebook returns the full page instead of a login wall","Verify the URL actually points to a video post, not a photo or text-only post","If it persists on the latest version, report it as an extractor bug with the URL"],"exampleFix":"# before\nyoutube_dl 'https://www.facebook.com/page/videos/123456'\n# ERROR: Cannot parse data\n\n# after\npip install -U yt-dlp\nyt-dlp --cookies cookies.txt 'https://www.facebook.com/page/videos/123456'","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    info = ydl.extract_info(url, download=False)\nexcept ExtractorError as e:\n    if 'Cannot parse data' in str(e):\n        # likely extractor out of date or login wall; retry once with cookies\n        ydl.cookiefile = 'cookies.txt'\n        info = ydl.extract_info(url, download=False)","preventionTips":["Pin a recent yt-dlp version and update on schedule (Facebook markup changes are frequent)","Always pass login cookies for Facebook URLs","Log the downloaded page size when this fires — near-empty pages indicate bot detection, not a bug"],"tags":["facebook","extractor","parsing","out-of-date"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}