mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-22 06:00:00 +00:00
[extractor/generic] Handle basic-auth when checking redirects
Closes #6352
This commit is contained in:
parent
43a3eaf963
commit
8e9fe43cd3
1 changed files with 3 additions and 3 deletions
|
@ -15,6 +15,7 @@
|
||||||
UnsupportedError,
|
UnsupportedError,
|
||||||
determine_ext,
|
determine_ext,
|
||||||
dict_get,
|
dict_get,
|
||||||
|
extract_basic_auth,
|
||||||
format_field,
|
format_field,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
is_html,
|
is_html,
|
||||||
|
@ -2372,9 +2373,8 @@ def _real_extract(self, url):
|
||||||
**smuggled_data.get('http_headers', {})
|
**smuggled_data.get('http_headers', {})
|
||||||
})
|
})
|
||||||
new_url = full_response.geturl()
|
new_url = full_response.geturl()
|
||||||
if new_url == urllib.parse.urlparse(url)._replace(scheme='https').geturl():
|
url = urllib.parse.urlparse(url)._replace(scheme=urllib.parse.urlparse(new_url).scheme).geturl()
|
||||||
url = new_url
|
if new_url != extract_basic_auth(url)[0]:
|
||||||
elif url != new_url:
|
|
||||||
self.report_following_redirect(new_url)
|
self.report_following_redirect(new_url)
|
||||||
if force_videoid:
|
if force_videoid:
|
||||||
new_url = smuggle_url(new_url, {'force_videoid': force_videoid})
|
new_url = smuggle_url(new_url, {'force_videoid': force_videoid})
|
||||||
|
|
Loading…
Reference in a new issue