yt-dlp/yt-dlp · error · ExtractorError

Could not fetch search data

Error message

Could not fetch search data

What it means

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.

Source

Thrown at yt_dlp/extractor/dailymotion.py:607

    }]
    _SEARCH_QUERY = 'query SEARCH_QUERY( $query: String! $page: Int $limit: Int ) { search { videos( query: $query first: $limit page: $page ) { edges { node { xid } } } } } '

    def _call_search_api(self, term, page, note):
        if not self._HEADERS.get('Authorization'):
            self._HEADERS['Authorization'] = f'Bearer {self._get_token(term)}'
        resp = self._download_json(
            'https://graphql.api.dailymotion.com/', None, note, data=json.dumps({
                'operationName': 'SEARCH_QUERY',
                'query': self._SEARCH_QUERY,
                'variables': {
                    'limit': 20,
                    'page': page,
                    'query': term,
                },
            }).encode(), headers=self._HEADERS)
        obj = traverse_obj(resp, ('data', 'search', {dict}))
        if not obj:
            raise ExtractorError(
                traverse_obj(resp, ('errors', 0, 'message', {str})) or 'Could not fetch search data')

        return obj

    def _fetch_page(self, term, page):
        page += 1
        response = self._call_search_api(term, page, f'Searching "{term}" page {page}')
        for xid in traverse_obj(response, ('videos', 'edges', ..., 'node', 'xid')):
            yield self.url_result(f'https://www.dailymotion.com/video/{xid}', DailymotionIE, xid)

    def _real_extract(self, url):
        term = urllib.parse.unquote_plus(self._match_id(url))
        return self.playlist_result(
            OnDemandPagedList(functools.partial(self._fetch_page, term), self._PAGE_SIZE), term, term)


class DailymotionUserIE(DailymotionPlaylistBaseIE):
    IE_NAME = 'dailymotion:user'

View on GitHub (pinned to 81ecd58b13)

Solutions

  1. Retry after a pause - most failures are transient throttling or 5xx responses.
  2. Update yt-dlp: search-query/schema breakage is usually patched upstream quickly.
  3. Run with -v to see the underlying GraphQL error message (it replaces the fallback text when present).
  4. If the literal fallback text appears with no GraphQL error, capture the response and report it upstream.
Defensive patterns

Strategy: retry

Try / catch

from yt_dlp.utils import ExtractorError

for attempt in range(3):
    try:
        result = ydl.extract_info(f'dailymotionsearch:{term}', download=False)
        break
    except ExtractorError as e:
        if 'search data' not in str(e) or attempt == 2:
            raise
        time.sleep(2 ** attempt)

Prevention

When it happens

Trigger: 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.

Common situations: Heavy search usage hitting Dailymotion throttling; yt-dlp version drift after Dailymotion changes the GraphQL schema; transient upstream incidents.

Related errors


AI-assisted analysis of yt-dlp/yt-dlp@81ecd58b13 (2026-08-22). Data as JSON: /api/errors/8c4621feb9ddbcc1. Report an issue: GitHub.