{"record":{"id":"8c4621feb9ddbcc1","repo":"yt-dlp/yt-dlp","slug":"could-not-fetch-search-data","errorCode":null,"errorMessage":"Could not fetch search data","messagePattern":"Could not fetch search data","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"yt_dlp/extractor/dailymotion.py","lineNumber":607,"sourceCode":"    }]\n    _SEARCH_QUERY = 'query SEARCH_QUERY( $query: String! $page: Int $limit: Int ) { search { videos( query: $query first: $limit page: $page ) { edges { node { xid } } } } } '\n\n    def _call_search_api(self, term, page, note):\n        if not self._HEADERS.get('Authorization'):\n            self._HEADERS['Authorization'] = f'Bearer {self._get_token(term)}'\n        resp = self._download_json(\n            'https://graphql.api.dailymotion.com/', None, note, data=json.dumps({\n                'operationName': 'SEARCH_QUERY',\n                'query': self._SEARCH_QUERY,\n                'variables': {\n                    'limit': 20,\n                    'page': page,\n                    'query': term,\n                },\n            }).encode(), headers=self._HEADERS)\n        obj = traverse_obj(resp, ('data', 'search', {dict}))\n        if not obj:\n            raise ExtractorError(\n                traverse_obj(resp, ('errors', 0, 'message', {str})) or 'Could not fetch search data')\n\n        return obj\n\n    def _fetch_page(self, term, page):\n        page += 1\n        response = self._call_search_api(term, page, f'Searching \"{term}\" page {page}')\n        for xid in traverse_obj(response, ('videos', 'edges', ..., 'node', 'xid')):\n            yield self.url_result(f'https://www.dailymotion.com/video/{xid}', DailymotionIE, xid)\n\n    def _real_extract(self, url):\n        term = urllib.parse.unquote_plus(self._match_id(url))\n        return self.playlist_result(\n            OnDemandPagedList(functools.partial(self._fetch_page, term), self._PAGE_SIZE), term, term)\n\n\nclass DailymotionUserIE(DailymotionPlaylistBaseIE):\n    IE_NAME = 'dailymotion:user'","sourceCodeStart":589,"sourceCodeEnd":625,"githubUrl":"https://github.com/yt-dlp/yt-dlp/blob/81ecd58b1394793e6da9998cc19fdb45657f1685/yt_dlp/extractor/dailymotion.py#L589-L625","documentation":"Dailymotion GraphQL search failure in DailymotionSearchIE._call_search_api. The SEARCH_QUERY request to graphql.api.dailymotion.com returned JSON without a usable data.search dict; yt-dlp raises errors[0].message from the GraphQL response when present, otherwise this fallback text. The exception aborts the whole search playlist, not a single entry.","triggerScenarios":"The GraphQL endpoint returns an errors array (throttling, invalid query, server-side failure) or a schema-changed response where traverse_obj(('data','search',{dict})) yields nothing.","commonSituations":"Heavy search usage hitting Dailymotion throttling; yt-dlp version drift after Dailymotion changes the GraphQL schema; transient upstream incidents.","solutions":["Retry after a pause - most failures are transient throttling or 5xx responses.","Update yt-dlp: search-query/schema breakage is usually patched upstream quickly.","Run with -v to see the underlying GraphQL error message (it replaces the fallback text when present).","If the literal fallback text appears with no GraphQL error, capture the response and report it upstream."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from yt_dlp.utils import ExtractorError\n\nfor attempt in range(3):\n    try:\n        result = ydl.extract_info(f'dailymotionsearch:{term}', download=False)\n        break\n    except ExtractorError as e:\n        if 'search data' not in str(e) or attempt == 2:\n            raise\n        time.sleep(2 ** attempt)","preventionTips":["Space out search requests; Dailymotion throttles aggressive GraphQL callers.","Treat search extraction as best-effort metadata lookup, not a stable pipeline."],"tags":["dailymotion","search","graphql","pagination","api-error"],"backgroundTag":"graphql-api-error","analyzedSha":"81ecd58b1394793e6da9998cc19fdb45657f1685","analyzedAt":"2026-08-22T12:21:25.439Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}