{"record":{"id":"49e59ad8ffd0553b","repo":"ytdl-org/youtube-dl","slug":"s-49e59a","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/linkedin.py","lineNumber":71,"sourceCode":"\n        login_page = self._download_webpage(\n            self._LOGIN_URL, None, 'Downloading login page')\n        action_url = urljoin(self._LOGIN_URL, self._search_regex(\n            r'<form[^>]+action=([\"\\'])(?P<url>.+?)\\1', login_page, 'post url',\n            default='https://www.linkedin.com/uas/login-submit', group='url'))\n        data = self._hidden_inputs(login_page)\n        data.update({\n            'session_key': email,\n            'session_password': password,\n        })\n        login_submit_page = self._download_webpage(\n            action_url, None, 'Logging in',\n            data=urlencode_postdata(data))\n        error = self._search_regex(\n            r'<span[^>]+class=\"error\"[^>]*>\\s*(.+?)\\s*</span>',\n            login_submit_page, 'error', default=None)\n        if error:\n            raise ExtractorError(error, expected=True)\n\n\nclass LinkedInLearningIE(LinkedInLearningBaseIE):\n    IE_NAME = 'linkedin:learning'\n    _VALID_URL = r'https?://(?:www\\.)?linkedin\\.com/learning/(?P<course_slug>[^/]+)/(?P<id>[^/?#]+)'\n    _TEST = {\n        'url': 'https://www.linkedin.com/learning/programming-foundations-fundamentals/welcome?autoplay=true',\n        'md5': 'a1d74422ff0d5e66a792deb996693167',\n        'info_dict': {\n            'id': '90426',\n            'ext': 'mp4',\n            'title': 'Welcome',\n            'timestamp': 1430396150.82,\n            'upload_date': '20150430',\n        },\n    }\n\n    def _real_extract(self, url):","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/linkedin.py#L53-L89","documentation":"Raised by the LinkedIn login helper when the submitted session_key/session_password form response contains an element matching <span class=\"error\">...</span>; the scraped error text becomes the message. It is expected=True. It fires only when a login was attempted and the page shows an inline error.","triggerScenarios":"Using --username/--password on linkedin.com/learning URLs where the login POST returns a page containing a span with class 'error' — wrong password, unknown email, or LinkedIn challenging the automated login.","commonSituations":"Invalid or mistyped credentials; LinkedIn adding captcha/2FA/phone-verification to suspicious logins (datacenter IPs, headless clients); LinkedIn changing its login HTML so the error span matches an unrelated element; accounts with mandatory SSO that cannot do password login.","solutions":["Confirm the credentials work in a normal browser session","Use --cookies / --cookies-from-browser with an already-authenticated browser profile instead of password login","For SSO-only accounts, export session cookies after logging in through your identity provider","Retry from a residential IP if LinkedIn is challenging datacenter logins"],"exampleFix":"# before: password login (often challenged)\n# youtube-dl -u email -p pass 'https://www.linkedin.com/learning/...'\n\n# after: reuse an authenticated browser session\n# yt-dlp --cookies-from-browser firefox 'https://www.linkedin.com/learning/...'","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.download([url])\nexcept ExtractorError as e:\n    if 'login' in str(e).lower() or 'password' in str(e).lower():\n        ydl.cookies.from_browser('firefox')  # fall back to session cookies\n        ydl.download([url])\n    else:\n        raise","preventionTips":["Prefer --cookies-from-browser over password login for LinkedIn properties","Avoid datacenter IPs for LinkedIn auth to reduce captcha/verification challenges"],"tags":["linkedin","authentication","login","captcha","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}