[GoogleDriveFolderIE] raise for access denied

This commit is contained in:
grqx_wsl 2024-08-18 00:01:03 +12:00
parent 28ed64d87a
commit b81a41d5ff

View file

@ -360,8 +360,11 @@ class GoogleDriveFolderIE(InfoExtractor):
try:
webpage, urlh = self._download_webpage_handle(url, folder_id, headers=headers)
except ExtractorError as e:
if isinstance(e.cause, HTTPError) and e.cause.status == 404:
self.raise_no_formats(e.cause.msg)
if isinstance(e.cause, HTTPError):
if e.cause.status == 404:
self.raise_no_formats(e.cause.msg)
elif e.cause.status == 403:
self.raise_login_required('Access Denied!')
raise
if urllib.parse.urlparse(urlh.url).netloc == 'accounts.google.com':
self.raise_login_required('This video is only available for registered users')