Skip to content

Commit

Permalink
[linkedin:learning] use urljoin for form action url(closes #20431)
Browse files Browse the repository at this point in the history
  • Loading branch information
remitamine authored and meunierd committed Dec 27, 2019
1 parent 662fbcc commit d46ea5e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions youtube_dl/extractor/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
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 = {
Expand Down Expand Up @@ -50,11 +52,10 @@ def _real_initialize(self):
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,
Expand Down

0 comments on commit d46ea5e

Please sign in to comment.