ytdl-org/youtube-dl · error · ExtractorError

data['errorMsg'] (dynamic server message)

Error message

data['errorMsg'] (dynamic server message)

What it means

Raised by YouNowLiveIE._real_extract after fetching https://api.younow.com/php/api/broadcast/info/curId=0/user=<name> when the JSON response's errorCode field is not 0. The message is the server-provided errorMsg verbatim (e.g. 'user is offline', 'no broadcast found'). expected=True marks it as a YouNow-side condition rather than a youtube-dl bug.

Source

Thrown at youtube_dl/extractor/younow.py:52

        },
        'skip': True,
    }

    @classmethod
    def suitable(cls, url):
        return (False
                if YouNowChannelIE.suitable(url) or YouNowMomentIE.suitable(url)
                else super(YouNowLiveIE, cls).suitable(url))

    def _real_extract(self, url):
        username = self._match_id(url)

        data = self._download_json(
            'https://api.younow.com/php/api/broadcast/info/curId=0/user=%s'
            % username, username)

        if data.get('errorCode') != 0:
            raise ExtractorError(data['errorMsg'], expected=True)

        uploader = try_get(
            data, lambda x: x['user']['profileUrlString'],
            compat_str) or username

        return {
            'id': uploader,
            'is_live': True,
            'title': self._live_title(uploader),
            'thumbnail': data.get('awsUrl'),
            'tags': data.get('tags'),
            'categories': data.get('tags'),
            'uploader': uploader,
            'uploader_id': data.get('userId'),
            'uploader_url': 'https://www.younow.com/%s' % username,
            'creator': uploader,
            'view_count': int_or_none(data.get('viewers')),
            'like_count': int_or_none(data.get('likes')),

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Check the broadcaster's page on younow.com — if there is no LIVE badge, wait until they are live and retry.
  2. Read the errorMsg text; it states the exact API reason (offline, not found, etc.) and should drive next steps.
  3. For offline check automation, poll the broadcast/info endpoint's errorCode and only invoke extraction when it is 0.
  4. Confirm the username matches the URL (self._match_id(url)) — trailing paths or display names cause 'not found' errors.
Defensive patterns

Strategy: validation

Validate before calling

import json, urllib.request

def younow_is_live(username: str) -> bool:
    with urllib.request.urlopen(
            'https://api.younow.com/php/api/broadcast/info/curId=0/user=' + username) as r:
        data = json.load(r)
    return data.get('errorCode') == 0

Type guard

def younow_response_ok(data: dict) -> bool:
    return isinstance(data, dict) and data.get('errorCode') == 0 and 'errorMsg' not in data

Try / catch

try:
    info = ydl.extract_info(younow_url)
except ExtractorError as e:
    if 'offline' in str(e).lower() or 'no broadcast' in str(e).lower():
        schedule_retry_later()  # broadcaster may go live again
    else:
        raise

Prevention

When it happens

Trigger: Requesting a YouNow live URL for a user who is not currently broadcasting, a nonexistent username, or an API-level rejection — any response where data['errorCode'] != 0.

Common situations: Trying to record a stream after the broadcaster went offline (race between discovery and download); mistyped usernames; API behavior changes where errorCode becomes nonzero for rate limiting.

Related errors


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