ytdl-org/youtube-dl · error · ExtractorError

not a video or an audio

Error message

not a video or an audio

What it means

Raised by TriluliluExtractor when media_info['class'] is neither 'video' nor 'audio' — the id resolves to some other content type (e.g. an image gallery). Unlike the sibling errors, this one is NOT marked expected=True, so it surfaces as a generic extraction error.

Source

Thrown at youtube_dl/extractor/trilulilu.py:63

        },
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        media_info = self._download_json('http://m.trilulilu.ro/%s?format=json' % display_id, display_id)

        age_limit = 0
        errors = media_info.get('errors', {})
        if errors.get('friends'):
            raise ExtractorError('This video is private.', expected=True)
        elif errors.get('geoblock'):
            raise ExtractorError('This video is not available in your country.', expected=True)
        elif errors.get('xxx_unlogged'):
            age_limit = 18

        media_class = media_info.get('class')
        if media_class not in ('video', 'audio'):
            raise ExtractorError('not a video or an audio')

        user = media_info.get('user', {})

        thumbnail = media_info.get('cover_url')
        if thumbnail:
            thumbnail.format(width='1600', height='1200')

        # TODO: get correct ext for audio files
        stream_type = media_info.get('stream_type')
        formats = [{
            'url': media_info['href'],
            'ext': stream_type,
        }]
        if media_info.get('is_hd'):
            formats.append({
                'format_id': 'hd',
                'url': media_info['hrefhd'],
                'ext': stream_type,

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Check the item type on the website; if it is an image, download it directly with curl/wget instead of youtube-dl
  2. Ensure you are passing a media (video/audio) URL and not a profile or gallery page
  3. Catch ExtractorError and skip non-A/V ids in crawlers
  4. Update to yt-dlp where the site is either fixed or removed
Defensive patterns

Strategy: validation

Validate before calling

info = json.load(urllib.request.urlopen('http://m.trilulilu.ro/%s?format=json' % display_id))
if info.get('class') not in ('video', 'audio'):
    handle_non_av(display_id, info.get('class'))

Try / catch

try:
    ydl.extract_info(url)
except ExtractorError as e:
    if 'not a video or an audio' in str(e):
        download_as_image(url)  # fall back to direct HTTP for photos

Prevention

When it happens

Trigger: A trilulilu.ro URL pointing at an image or other non-A/V item: the JSON fetch succeeds, but 'class' is e.g. 'image', so the extractor refuses to build formats.

Common situations: Trilulilu was a general media host (photos + video); passing a photo page URL to a video downloader; URLs harvested without checking content type.

Related errors


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