ytdl-org/youtube-dl · error · ExtractorError

No sources found for video %s. Maybe a plain image?

Error message

No sources found for video %s. Maybe a plain image?

What it means

Raised by ImgurIE when three fallback sources all came up empty: the video-elements div regex found nothing, no Twitter player formats were extracted, and no media_url exists. The 'Maybe a plain image?' hint conveys that the post most likely contains only a still image.

Source

Thrown at youtube_dl/extractor/imgur.py:137

            if not media_fmt.get('ext'):
                media_fmt['ext'] = mimetype2ext(traverse_obj(
                    data, ('media', 0, 'mime_type'))) or determine_ext(media_url)
            if traverse_obj(data, ('media', 0, 'type')) == 'image':
                media_fmt['acodec'] = 'none'
                media_fmt.setdefault('preference', -10)

        tw_formats = self._extract_twitter_formats(webpage)
        if traverse_obj(tw_formats, (0, 'url')) == media_url:
            tw_formats = []
        else:
            # maybe this isn't an animated image/video?
            self._check_formats(tw_formats, video_id)

        video_elements = self._search_regex(
            r'(?s)<div class="video-elements">(.*?)</div>',
            webpage, 'video elements', default=None)
        if not (video_elements or tw_formats or media_url):
            raise ExtractorError(
                'No sources found for video %s. Maybe a plain image?' % video_id,
                expected=True)

        def mung_format(fmt, *extra):
            fmt.update({
                'http_headers': {
                    'User-Agent': 'youtube-dl (like wget)',
                },
            })
            for d in extra:
                fmt.update(d)
            return fmt

        if video_elements:
            def og_get_size(media_type):
                return dict((p, int_or_none(self._og_search_property(
                    ':'.join((media_type, p)), webpage, default=None)))
                    for p in ('width', 'height'))

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Open the Imgur page in a browser to see whether the content is animated at all.
  2. If it is static, download it with curl/wget from i.imgur.com.
  3. Update youtube-dl/yt-dlp for current Imgur page markup.
Defensive patterns

Strategy: fallback

Try / catch

try:
    ydl.extract_info(imgur_url)
except ExtractorError as e:
    if 'No sources found' in str(e):
        # last resort: try the direct file endpoints
        for ext in ('gifv', 'mp4', 'gif'):
            attempt(f'https://i.imgur.com/{imgur_id}.{ext}')

Prevention

When it happens

Trigger: An imgur post where the API metadata suggests animation but the gifv webpage contains no <div class='video-elements'> and no alternative media URL - typically static images, deleted media, or pages rewritten by A/B tests.

Common situations: Static Imgur posts, removed images, or Imgur markup changes breaking the video-elements regex; mobile-only variants of the page.

Related errors


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/678e5357ed5fccbc. Report an issue: GitHub.