mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-20 13:57:25 +01:00
update url and video id instead of returning a url result
This commit is contained in:
parent
23ea25196d
commit
3582a238a0
@ -179,9 +179,16 @@ def _get_automatic_captions(self, video_id, subtitles_id, hl):
|
|||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
_, webpage_urlh = self._download_webpage_handle(url, video_id)
|
try:
|
||||||
|
_, webpage_urlh = self._download_webpage_handle(url, video_id)
|
||||||
|
except ExtractorError as e:
|
||||||
|
if isinstance(e.cause, HTTPError):
|
||||||
|
if e.cause.status in (401, 403):
|
||||||
|
self.raise_login_required('Access Denied')
|
||||||
|
raise
|
||||||
if webpage_urlh.url != url:
|
if webpage_urlh.url != url:
|
||||||
return self.url_result(webpage_urlh.url)
|
url = webpage_urlh.url
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
video_info = urllib.parse.parse_qs(self._download_webpage(
|
video_info = urllib.parse.parse_qs(self._download_webpage(
|
||||||
'https://drive.google.com/get_video_info',
|
'https://drive.google.com/get_video_info',
|
||||||
@ -378,7 +385,7 @@ def item_url_getter(item, video_id):
|
|||||||
except ExtractorError as e:
|
except ExtractorError as e:
|
||||||
if isinstance(e.cause, HTTPError):
|
if isinstance(e.cause, HTTPError):
|
||||||
if e.cause.status == 404:
|
if e.cause.status == 404:
|
||||||
self.raise_no_formats(e.cause.msg)
|
self.raise_no_formats(e.cause.msg, expected=True)
|
||||||
elif e.cause.status == 403:
|
elif e.cause.status == 403:
|
||||||
# logged in with an account without access
|
# logged in with an account without access
|
||||||
self.raise_login_required('Access Denied')
|
self.raise_login_required('Access Denied')
|
||||||
|
Loading…
Reference in New Issue
Block a user