From 57ebfca39b2624ce8ef6007b95214d093269aab6 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 13 Feb 2022 20:10:20 +0530 Subject: [PATCH] Set `webpage_url_...` from `webpage_url` and not input URL Closes #2756 --- yt_dlp/YoutubeDL.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 9892ed328..67ef2ffa5 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -1471,8 +1471,12 @@ def add_default_extra_info(self, ie_result, ie, url): self.add_extra_info(ie_result, { 'webpage_url': url, 'original_url': url, - 'webpage_url_basename': url_basename(url), - 'webpage_url_domain': get_domain(url), + }) + webpage_url = ie_result.get('webpage_url') + if webpage_url: + self.add_extra_info(ie_result, { + 'webpage_url_basename': url_basename(webpage_url), + 'webpage_url_domain': get_domain(webpage_url), }) if ie is not None: self.add_extra_info(ie_result, {