{"record":{"id":"513408869914e817","repo":"ytdl-org/youtube-dl","slug":"invalid-url","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/arkena.py","lineNumber":76,"sourceCode":"        # See https://support.arkena.com/display/PLAY/Ways+to+embed+your+video\n        mobj = re.search(\n            r'<iframe[^>]+src=([\"\\'])(?P<url>(?:https?:)?//play\\.arkena\\.com/embed/avp/.+?)\\1',\n            webpage)\n        if mobj:\n            return mobj.group('url')\n\n    def _real_extract(self, url):\n        mobj = re.match(self._VALID_URL, url)\n        video_id = mobj.group('id')\n        account_id = mobj.group('account_id')\n\n        # Handle http://video.arkena.com/play2/embed/player URL\n        if not video_id:\n            qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query)\n            video_id = qs.get('mediaId', [None])[0]\n            account_id = qs.get('accountId', [None])[0]\n            if not video_id or not account_id:\n                raise ExtractorError('Invalid URL', expected=True)\n\n        media = self._download_json(\n            'https://video.qbrick.com/api/v1/public/accounts/%s/medias/%s' % (account_id, video_id),\n            video_id, query={\n                # https://video.qbrick.com/docs/api/examples/library-api.html\n                'fields': 'asset/resources/*/renditions/*(height,id,language,links/*(href,mimeType),type,size,videos/*(audios/*(codec,sampleRate),bitrate,codec,duration,height,width),width),created,metadata/*(title,description),tags',\n            })\n        metadata = media.get('metadata') or {}\n        title = metadata['title']\n\n        duration = None\n        formats = []\n        thumbnails = []\n        subtitles = {}\n        for resource in media['asset']['resources']:\n            for rendition in (resource.get('renditions') or []):\n                rendition_type = rendition.get('type')\n                for i, link in enumerate(rendition.get('links') or []):","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/arkena.py#L58-L94","documentation":"Raised by the Arkena extractor when the URL matched _VALID_URL but captured neither id nor account_id groups, AND the query string lacks mediaId/accountId parameters. It is the guard for embed player URLs (video.arkena.com/play2/embed/player) that were expected to carry the ids in the query but do not. Marked expected=True.","triggerScenarios":"A /play2/embed/player URL without ?mediaId=...&accountId=...; malformed embed snippets copied without their query string; regex-captured groups empty for a URL that still matched the pattern.","commonSituations":"Truncated embed code copied from a page; query string stripped by URL normalization or shell quoting; player URLs from older Arkena integrations using different parameter names.","solutions":["Re-copy the full embed URL including the complete ?mediaId=<id>&accountId=<acct> query string","Quote the URL in the shell so '&' is not interpreted","If the embed gives only a partial id, open the parent page and extract the canonical arkena media URL"],"exampleFix":"# before\nyoutube-dl 'http://video.arkena.com/play2/embed/player'\n\n# after\nyoutube-dl 'http://video.arkena.com/play2/embed/player?mediaId=abc123&accountId=acct456'","handlingStrategy":"validation","validationCode":"# Validate Arkena embed URLs before extraction\nfrom urllib.parse import urlparse, parse_qs\nq = parse_qs(urlparse(url).query)\nif 'arkena.com/play2/embed/player' in url and not (q.get('mediaId') and q.get('accountId')):\n    raise ValueError('Arkena embed URL missing mediaId/accountId query params: %s' % url)","typeGuard":"def is_valid_arkena_embed(url):\n    \"\"\"Embed player URLs must carry both mediaId and accountId in the query.\"\"\"\n    if 'play2/embed/player' not in url:\n        return True  # path-style URLs are matched by regex groups\n    q = parse_qs(urlparse(url).query)\n    return bool(q.get('mediaId', [None])[0] and q.get('accountId', [None])[0])","tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if str(e) == 'Invalid URL':\n        url = recover_full_embed_url_from_parent_page(url)  # re-scrape the embed snippet","preventionTips":["Always shell-quote URLs containing '&' so query parameters survive","When copying embed code, take the entire iframe src including its query string","Validate mediaId/accountId presence in your own URL pipeline before invoking the extractor"],"tags":["arkena","qbrick","url-parsing","embed","invalid-url"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}