aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-07-22 21:05:39 +0700
committerSergey M․ <dstftw@gmail.com>2016-07-22 21:05:39 +0700
commite298d3a08c2c04aceb5b32e6e8f59c7832d65bd3 (patch)
tree79efd6cbc8a23b17e48a0c765178651028ab96d1
parentfd8c8c7dcdb722ae0ed96b8ceb4c844c87f2c896 (diff)
downloadyoutube-dl-e298d3a08c2c04aceb5b32e6e8f59c7832d65bd3.tar.xz
[youtube] Fix authentication (Closes #10140)
-rw-r--r--youtube_dl/extractor/youtube.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 270ee8861..268080ba6 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -53,6 +53,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
"""Provide base functions for Youtube extractors"""
_LOGIN_URL = 'https://accounts.google.com/ServiceLogin'
_TWOFACTOR_URL = 'https://accounts.google.com/signin/challenge'
+ _PASSWORD_CHALLENGE_URL = 'https://accounts.google.com/signin/challenge/sl/password'
_NETRC_MACHINE = 'youtube'
# If True it will raise an error if no login info is provided
_LOGIN_REQUIRED = False
@@ -116,12 +117,10 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
'hl': 'en_US',
}
- login_data = urlencode_postdata(login_form_strs)
-
- req = sanitized_Request(self._LOGIN_URL, login_data)
login_results = self._download_webpage(
- req, None,
- note='Logging in', errnote='unable to log in', fatal=False)
+ self._PASSWORD_CHALLENGE_URL, None,
+ note='Logging in', errnote='unable to log in', fatal=False,
+ data=urlencode_postdata(login_form_strs))
if login_results is False:
return False