mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-26 13:42:23 +00:00
[Oreilly] Handle new web url (#990)
The change in URL is most likely a server side issue. But we can work around it by a simple substitution Authored by: MKSherbini
This commit is contained in:
parent
7c37ff97d3
commit
7738bd3272
@ -193,7 +193,12 @@ class SafariApiIE(SafariBaseIE):
|
||||
part = self._download_json(
|
||||
url, '%s/%s' % (mobj.group('course_id'), mobj.group('part')),
|
||||
'Downloading part JSON')
|
||||
return self.url_result(part['web_url'], SafariIE.ie_key())
|
||||
web_url = part['web_url']
|
||||
if 'library/view' in web_url:
|
||||
web_url = web_url.replace('library/view', 'videos')
|
||||
natural_keys = part['natural_key']
|
||||
web_url = f'{web_url.rsplit("/")[0]}/{natural_keys[0]}-{natural_keys[1][:-5]}'
|
||||
return self.url_result(web_url, SafariIE.ie_key())
|
||||
|
||||
|
||||
class SafariCourseIE(SafariBaseIE):
|
||||
|
Loading…
Reference in New Issue
Block a user