Skip to content

Commit

Permalink
Merge pull request #1 from pyy/patch-1
Browse files Browse the repository at this point in the history
update authentication info
  • Loading branch information
sirkuttin authored Aug 13, 2021
2 parents 890c99e + 1c4a8d9 commit 50732f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lld.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
reload(sys)
sys.setdefaultencoding('utf-8')

login_url = 'https://www.linkedin.com/'
post_login_url = 'https://www.linkedin.com/uas/login-submit'
login_url = 'https://www.linkedin.com/checkpoint/lg/login'
post_login_url = 'https://www.linkedin.com/checkpoint/lg/login-submit'
course_api_url = 'https://www.linkedin.com/learning-api/detailedCourses??fields=fullCourseUnlocked,releasedOn,' \
'exerciseFileUrls,exerciseFiles&addParagraphsToTranscript=true&courseSlug=%s&q=slugs'
video_api_url = 'https://www.linkedin.com/learning-api/detailedCourses?addParagraphsToTranscript=false&courseSlug=%s' \
Expand Down Expand Up @@ -124,7 +124,7 @@ def download_courses(self):
for course in config.COURSES:
time.sleep(1)
resp = self.session.get(course_api_url % course)
course_data = resp.json()['elements'][0]
course_data = resp.json()['elements'][0]
course_name = self.format_string(course_data['title'])
logging.info('Starting download of course [%s]...' % course_name)
course_path = '%s/%s' % (self.base_path, course_name)
Expand Down Expand Up @@ -154,7 +154,7 @@ def download_courses(self):
video_index += 1
continue
try:
video_url = re.search('"progressiveUrl":"(.+)","streamingUrl"', video_data.text).group(1)
video_url = re.search('"progressiveUrl":"(.+)","expiresAt"', video_data.text).group(1)
except:
logging.error('Can\'t download the video [%s], probably is only for premium users' % video_name)
continue
Expand Down

0 comments on commit 50732f2

Please sign in to comment.