From f524d18df66b4b594485a2ce87e6df147271db20 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 5 Mar 2018 03:42:43 +0100 Subject: [PATCH] [Canvas/VrtNU] relevant URL fix (fixes #15767) --- youtube_dl/extractor/canvas.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/canvas.py b/youtube_dl/extractor/canvas.py index 3faa76076..7bd8fb696 100644 --- a/youtube_dl/extractor/canvas.py +++ b/youtube_dl/extractor/canvas.py @@ -277,6 +277,12 @@ class VrtNUIE(GigyaBaseIE): # If there's a ? or a # in the URL, remove them and everything after clean_url = url.split('?')[0].split('#')[0].strip('/') + + # Check if we are dealing with a '../.relevant' URL / redirect + if clean_url.endswith(".relevant"): + redirect_url = self._downloader.urlopen(clean_url + "/").geturl() + clean_url = redirect_url.split('?')[0].split('#')[0].strip('/') + securevideo_url = clean_url + '.mssecurevideo.json' try: @@ -286,11 +292,6 @@ class VrtNUIE(GigyaBaseIE): self.raise_login_required() raise - # We are dealing with a '../.relevant' URL - redirect_url = video.get('url') - if redirect_url: - return self.url_result(self._proto_relative_url(redirect_url, 'https:')) - # There is only one entry, but with an unknown key, so just get # the first one video_id = list(video.values())[0].get('videoid')