From b81a41d5ff33f05379c7ae96997d9d366ff4061b Mon Sep 17 00:00:00 2001 From: grqx_wsl <173253225+grqx@users.noreply.github.com> Date: Sun, 18 Aug 2024 00:01:03 +1200 Subject: [PATCH] [GoogleDriveFolderIE] raise for access denied --- yt_dlp/extractor/googledrive.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/googledrive.py b/yt_dlp/extractor/googledrive.py index a77ca24c07..a3d645f08c 100644 --- a/yt_dlp/extractor/googledrive.py +++ b/yt_dlp/extractor/googledrive.py @@ -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')