{"record":{"id":"4e8a36b8beb378de","repo":"ytdl-org/youtube-dl","slug":"s-returned-error-s-s","errorCode":null,"errorMessage":"%s returned error: %s - %s","messagePattern":"(.+?) returned error: (.+?) - (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/mtv.py","lineNumber":156,"sourceCode":"        mediagen_url = mediagen_url.replace('device={device}', '')\n        if 'acceptMethods' not in mediagen_url:\n            mediagen_url += '&' if '?' in mediagen_url else '?'\n            mediagen_url += 'acceptMethods='\n            mediagen_url += 'hls' if use_hls else 'fms'\n\n        mediagen_doc = self._download_xml(\n            mediagen_url, video_id, 'Downloading video urls', fatal=False)\n\n        if mediagen_doc is False:\n            return None\n\n        item = mediagen_doc.find('./video/item')\n        if item is not None and item.get('type') == 'text':\n            message = '%s returned error: ' % self.IE_NAME\n            if item.get('code') is not None:\n                message += '%s - ' % item.get('code')\n            message += item.text\n            raise ExtractorError(message, expected=True)\n\n        description = strip_or_none(xpath_text(itemdoc, 'description'))\n\n        timestamp = timeconvert(xpath_text(itemdoc, 'pubDate'))\n\n        title_el = None\n        if title_el is None:\n            title_el = find_xpath_attr(\n                itemdoc, './/{http://search.yahoo.com/mrss/}category',\n                'scheme', 'urn:mtvn:video_title')\n        if title_el is None:\n            title_el = itemdoc.find(compat_xpath('.//{http://search.yahoo.com/mrss/}title'))\n        if title_el is None:\n            title_el = itemdoc.find(compat_xpath('.//title'))\n            if title_el.text is None:\n                title_el = None\n\n        title = title_el.text","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/mtv.py#L138-L174","documentation":"Raised by MTV's _get_video_info when the downloaded mediagen XML contains a <item type=\"text\"> element — the API's way of returning a textual error instead of video data. The message assembles the IE name, optional item code attribute, and the item's text. It is expected=True.","triggerScenarios":"Any MTV-family extraction whose mediagen response has ./video/item with type='text'; the 'code' attribute is appended when present, followed by the free-text error body.","commonSituations":"Expired/removed MTV videos; content unavailable for the requesting region; the GUID from the page no longer resolving in mediagen after a site migration — fixed only by an extractor update.","solutions":["Read the returned code/text — it states the site's reason (expired, region, rights) and whether a proxy would help.","If the code suggests geo restriction, retry with --geo-verify-proxy or a US proxy.","Update youtube-dl; GUID/mediagen changes are handled over time in the extractor.","Confirm the video still plays in a browser; if not, the link is dead."],"exampleFix":"youtube-dl --geo-verify-proxy '<url>'   # else: pip install -U youtube-dl","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"except ExtractorError as e:\n    if e.expected and 'returned error' in str(e):\n        handle_mtv_error(url, str(e))  # parse optional 'code - text' payload\n    else:\n        raise","preventionTips":["Parse the code/text pair from the message — it tells you whether a proxy helps.","Expire MTV links from your index when the site reports them withdrawn.","Update the extractor frequently; mediagen GUID handling changes over time."],"tags":["site-error","geo-restriction","extractor","expected-error"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}