ytdl-org/youtube-dl · error · ExtractorError

%s encountered an error: %s

Error message

%s encountered an error: %s

What it means

Raised by the mgoon extractor when the video API response's errorInfo.code is anything other than 'NONE' — the service's own error channel. The message embeds errorInfo.message verbatim. Expected=True, so it represents a normal service refusal (removed video, permission, quota) rather than a parsing bug.

Source

Thrown at youtube_dl/extractor/mgoon.py:50

        },
        {
            'url': 'http://www.mgoon.com/play/view/5582148',
            'only_matching': True,
        },
        {
            'url': 'http://video.mgoon.com/5582148',
            'only_matching': True,
        },
    ]

    def _real_extract(self, url):
        mobj = re.match(self._VALID_URL, url)
        video_id = mobj.group('id')

        data = self._download_json(self._API_URL.format(video_id), video_id)

        if data.get('errorInfo', {}).get('code') != 'NONE':
            raise ExtractorError('%s encountered an error: %s' % (
                self.IE_NAME, data['errorInfo']['message']), expected=True)

        v_info = data['videoInfo']
        title = v_info.get('v_title')
        thumbnail = v_info.get('v_thumbnail')
        duration = v_info.get('v_duration')
        upload_date = unified_strdate(v_info.get('v_reg_date'))
        uploader_id = data.get('userInfo', {}).get('u_alias')
        if duration:
            duration /= 1000.0

        age_limit = None
        if data.get('accessInfo', {}).get('code') == 'VIDEO_STATUS_ADULT':
            age_limit = 18

        formats = []
        get_quality = qualities(['360p', '480p', '720p', '1080p'])
        for fmt in data['videoFiles']:

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Read the embedded message — it is mgoon's own reason text.
  2. Confirm the video still exists at http://video.mgoon.com/{id}.
  3. Update youtube-dl; the mgoon extractor and its API endpoint have needed maintenance as the site wound down.
  4. If the whole service is offline, obtain the media from another source; no client fix recovers it.
Defensive patterns

Strategy: try-catch

Type guard

def mgoon_has_error(data):
    return isinstance(data, dict) and data.get('errorInfo', {}).get('code') != 'NONE'

Try / catch

try:
    info = ydl.extract_info(url, download=False)
except ExtractorError as e:
    if 'mgoon encountered an error' in str(e):
        mark_permanently_dead(url)  # service-side refusal; not retryable
    else:
        raise

Prevention

When it happens

Trigger: GET of self._API_URL.format(video_id) returns JSON where data['errorInfo']['code'] != 'NONE'; the raise reads data['errorInfo']['message'] directly (KeyError if the service omits it).

Common situations: Video deleted from mgoon; API requiring a referer/session for some assets; the (now largely defunct) Korean service returning generic error codes for all requests; schema change dropping the message field and turning the intended error into a KeyError.

Related errors


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