Add option --cookies-from-browser to load cookies from a browser (#488)

* also adds `--no-cookies-from-browser`

Original PR: https://github.com/ytdl-org/youtube-dl/pull/29201
Authored by: mbway
This commit is contained in:
Matt Broadway
2021-07-21 21:32:49 +01:00
committed by GitHub
parent 7ea6541124
commit 982ee69a74
8 changed files with 881 additions and 15 deletions

View File

@@ -99,7 +99,9 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
self.report_warning(message)
# username+password login is broken
if self._LOGIN_REQUIRED and self.get_param('cookiefile') is None:
if (self._LOGIN_REQUIRED
and self.get_param('cookiefile') is None
and self.get_param('cookiesfrombrowser') is None):
self.raise_login_required(
'Login details are needed to download this content', method='cookies')
username, password = self._get_login_info()