From 2d900facc4fa5c8e93e08a8ca346b58fdf389169 Mon Sep 17 00:00:00 2001 From: cdarlint Date: Fri, 28 May 2021 13:59:16 +0800 Subject: [PATCH] [safari] fix 404 on Manning videos URL schema of videos /library/view/ would default 302 redirect to /videos/ but fails to redirect on some Manning videos, and got 404 this commit fix this and default schema to use /videos/ --- youtube_dl/extractor/safari.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/extractor/safari.py b/youtube_dl/extractor/safari.py index 2cc665122..1c55ac2e1 100644 --- a/youtube_dl/extractor/safari.py +++ b/youtube_dl/extractor/safari.py @@ -193,6 +193,9 @@ class SafariApiIE(SafariBaseIE): part = self._download_json( url, '%s/%s' % (mobj.group('course_id'), mobj.group('part')), 'Downloading part JSON') + part['web_url'] = part['asset_base_url'].replace('library/view', + 'videos') +\ + part['videoclips'][0]['reference_id'] + '/' return self.url_result(part['web_url'], SafariIE.ie_key())