diff options
author | Remita Amine <[email protected]> | 2019-04-11 08:44:58 +0100 |
---|---|---|
committer | Remita Amine <[email protected]> | 2019-04-11 08:44:58 +0100 |
commit | c912029480a38b7031b56e69a4c8233918d1c9d4 (patch) | |
tree | 28a4bf0290a7046c0439aae52bb8c2547ab503c3 | |
parent | 118f7add3b9690884edb4dc887995f3815243c78 (diff) | |
download | youtube-dl-c912029480a38b7031b56e69a4c8233918d1c9d4.tar.gz youtube-dl-c912029480a38b7031b56e69a4c8233918d1c9d4.zip |
[linkedin:learning] use urljoin for form action url(closes #20431)
-rw-r--r-- | youtube_dl/extractor/linkedin.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/extractor/linkedin.py b/youtube_dl/extractor/linkedin.py index 5a86b0064..26fc703d1 100644 --- a/youtube_dl/extractor/linkedin.py +++ b/youtube_dl/extractor/linkedin.py @@ -9,11 +9,13 @@ from ..utils import ( float_or_none, int_or_none, urlencode_postdata, + urljoin, ) class LinkedInLearningBaseIE(InfoExtractor): _NETRC_MACHINE = 'linkedin' + _LOGIN_URL = 'https://www.linkedin.com/uas/login?trk=learning' def _call_api(self, course_slug, fields, video_slug=None, resolution=None): query = { @@ -50,11 +52,10 @@ class LinkedInLearningBaseIE(InfoExtractor): return login_page = self._download_webpage( - 'https://www.linkedin.com/uas/login?trk=learning', - None, 'Downloading login page') - action_url = self._search_regex( + self._LOGIN_URL, None, 'Downloading login page') + action_url = urljoin(self._LOGIN_URL, self._search_regex( r'<form[^>]+action=(["\'])(?P<url>.+?)\1', login_page, 'post url', - default='https://www.linkedin.com/uas/login-submit', group='url') + default='https://www.linkedin.com/uas/login-submit', group='url')) data = self._hidden_inputs(login_page) data.update({ 'session_key': email, |