aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/extractor/googledrive.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-02-04 13:26:01 +0530
committerpukkandan <pukkandan@gmail.com>2021-02-04 13:26:22 +0530
commit2181983a0c97c6fd3bb681c86d64699051061c1c (patch)
tree3b352353ae60cf8a889cccf89cfffc60d4db5f0d /youtube_dlc/extractor/googledrive.py
parente29663c644a65846125f5792be52dc27feb68297 (diff)
downloadhypervideo-pre-2181983a0c97c6fd3bb681c86d64699051061c1c.tar.lz
hypervideo-pre-2181983a0c97c6fd3bb681c86d64699051061c1c.tar.xz
hypervideo-pre-2181983a0c97c6fd3bb681c86d64699051061c1c.zip
Update to ytdl-2021.02.04.1 except youtube
Diffstat (limited to 'youtube_dlc/extractor/googledrive.py')
-rw-r--r--youtube_dlc/extractor/googledrive.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dlc/extractor/googledrive.py b/youtube_dlc/extractor/googledrive.py
index fdb15795a..4eefcb70c 100644
--- a/youtube_dlc/extractor/googledrive.py
+++ b/youtube_dlc/extractor/googledrive.py
@@ -7,6 +7,7 @@ from ..compat import compat_parse_qs
from ..utils import (
determine_ext,
ExtractorError,
+ get_element_by_class,
int_or_none,
lowercase_escape,
try_get,
@@ -237,7 +238,7 @@ class GoogleDriveIE(InfoExtractor):
if confirmation_webpage:
confirm = self._search_regex(
r'confirm=([^&"\']+)', confirmation_webpage,
- 'confirmation code', fatal=False)
+ 'confirmation code', default=None)
if confirm:
confirmed_source_url = update_url_query(source_url, {
'confirm': confirm,
@@ -245,6 +246,11 @@ class GoogleDriveIE(InfoExtractor):
urlh = request_source_file(confirmed_source_url, 'confirmed source')
if urlh and urlh.headers.get('Content-Disposition'):
add_source_format(urlh)
+ else:
+ self.report_warning(
+ get_element_by_class('uc-error-subcaption', confirmation_webpage)
+ or get_element_by_class('uc-error-caption', confirmation_webpage)
+ or 'unable to extract confirmation code')
if not formats and reason:
raise ExtractorError(reason, expected=True)