From 4de88a6a362a6f976ebac5d384a79ca59606ec0a Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 17 Nov 2022 02:12:07 +0530 Subject: [PATCH] [extractor/generic] Don't report redirect to https --- yt_dlp/extractor/generic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/generic.py b/yt_dlp/extractor/generic.py index 0765d38ac..21e92cba6 100644 --- a/yt_dlp/extractor/generic.py +++ b/yt_dlp/extractor/generic.py @@ -2584,7 +2584,9 @@ def _real_extract(self, url): **smuggled_data.get('http_headers', {}) }) new_url = full_response.geturl() - if url != new_url: + if new_url == urllib.parse.urlparse(url)._replace(scheme='https').geturl(): + url = new_url + elif url != new_url: self.report_following_redirect(new_url) if force_videoid: new_url = smuggle_url(new_url, {'force_videoid': force_videoid})