diff options
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 6edd5a769..ff19270ae 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -680,7 +680,7 @@ class InfoExtractor(object): return (username, password) - def _get_login_info(self): + def _get_login_info(self, username_option='username', password_option='password', netrc_machine=None): """ Get the login info as (username, password) It will look in the netrc file using the _NETRC_MACHINE value @@ -694,11 +694,11 @@ class InfoExtractor(object): downloader_params = self._downloader.params # Attempt to use provided username and password or .netrc data - if downloader_params.get('username') is not None: - username = downloader_params['username'] - password = downloader_params['password'] + if downloader_params.get(username_option) is not None: + username = downloader_params[username_option] + password = downloader_params[password_option] else: - username, password = self._get_netrc_login_info() + username, password = self._get_netrc_login_info(netrc_machine) return (username, password) |