{"record":{"id":"8e594ccf6eb274e3","repo":"ytdl-org/youtube-dl","slug":"data-errormsg-dynamic-server-message","errorCode":null,"errorMessage":"data['errorMsg'] (dynamic server message)","messagePattern":"data\\['errorMsg'\\] \\(dynamic server message\\)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/younow.py","lineNumber":52,"sourceCode":"        },\n        'skip': True,\n    }\n\n    @classmethod\n    def suitable(cls, url):\n        return (False\n                if YouNowChannelIE.suitable(url) or YouNowMomentIE.suitable(url)\n                else super(YouNowLiveIE, cls).suitable(url))\n\n    def _real_extract(self, url):\n        username = self._match_id(url)\n\n        data = self._download_json(\n            'https://api.younow.com/php/api/broadcast/info/curId=0/user=%s'\n            % username, username)\n\n        if data.get('errorCode') != 0:\n            raise ExtractorError(data['errorMsg'], expected=True)\n\n        uploader = try_get(\n            data, lambda x: x['user']['profileUrlString'],\n            compat_str) or username\n\n        return {\n            'id': uploader,\n            'is_live': True,\n            'title': self._live_title(uploader),\n            'thumbnail': data.get('awsUrl'),\n            'tags': data.get('tags'),\n            'categories': data.get('tags'),\n            'uploader': uploader,\n            'uploader_id': data.get('userId'),\n            'uploader_url': 'https://www.younow.com/%s' % username,\n            'creator': uploader,\n            'view_count': int_or_none(data.get('viewers')),\n            'like_count': int_or_none(data.get('likes')),","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/younow.py#L34-L70","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the broadcaster's page on younow.com — if there is no LIVE badge, wait until they are live and retry.","Read the errorMsg text; it states the exact API reason (offline, not found, etc.) and should drive next steps.","For offline check automation, poll the broadcast/info endpoint's errorCode and only invoke extraction when it is 0.","Confirm the username matches the URL (self._match_id(url)) — trailing paths or display names cause 'not found' errors."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json, urllib.request\n\ndef younow_is_live(username: str) -> bool:\n    with urllib.request.urlopen(\n            'https://api.younow.com/php/api/broadcast/info/curId=0/user=' + username) as r:\n        data = json.load(r)\n    return data.get('errorCode') == 0","typeGuard":"def younow_response_ok(data: dict) -> bool:\n    return isinstance(data, dict) and data.get('errorCode') == 0 and 'errorMsg' not in data","tryCatchPattern":"try:\n    info = ydl.extract_info(younow_url)\nexcept ExtractorError as e:\n    if 'offline' in str(e).lower() or 'no broadcast' in str(e).lower():\n        schedule_retry_later()  # broadcaster may go live again\n    else:\n        raise","preventionTips":["Poll the broadcast/info endpoint's errorCode before invoking extraction for live recordings.","Expect races: a stream can end between your check and the download; build retry logic."],"tags":["younow","live-stream","api-error","expected-error"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}