mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-15 18:12:58 +00:00
[shared] Respect redirect URL (Closes #10170)
This commit is contained in:
parent
7935926baa
commit
289a16b4f3
@ -37,15 +37,17 @@ class SharedIE(InfoExtractor):
|
|||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
|
||||||
|
webpage, urlh = self._download_webpage_handle(url, video_id)
|
||||||
|
|
||||||
if '>File does not exist<' in webpage:
|
if '>File does not exist<' in webpage:
|
||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'Video %s does not exist' % video_id, expected=True)
|
'Video %s does not exist' % video_id, expected=True)
|
||||||
|
|
||||||
download_form = self._hidden_inputs(webpage)
|
download_form = self._hidden_inputs(webpage)
|
||||||
|
|
||||||
request = sanitized_Request(
|
request = sanitized_Request(
|
||||||
url, urlencode_postdata(download_form))
|
urlh.geturl(), urlencode_postdata(download_form))
|
||||||
request.add_header('Content-Type', 'application/x-www-form-urlencoded')
|
request.add_header('Content-Type', 'application/x-www-form-urlencoded')
|
||||||
|
|
||||||
video_page = self._download_webpage(
|
video_page = self._download_webpage(
|
||||||
|
Loading…
Reference in New Issue
Block a user