diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-07-08 11:22:34 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-07-08 11:24:11 +0200 |
commit | fefcb5d314577bdcfeadf63f88859512892a938b (patch) | |
tree | 5d38c7a0bfde307b955380d72812cf856d718532 /youtube_dl/extractor | |
parent | 345b0c9b46f85ad8447c41ec41676405ee673225 (diff) |
YoutubeIE: use the new method in the base IE for getting the login info
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 537f88406..0de3bb0b3 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -131,10 +131,6 @@ class YoutubeIE(InfoExtractor): """Report attempt to set language.""" self.to_screen(u'Setting language') - def report_login(self): - """Report attempt to log in.""" - self.to_screen(u'Logging in') - def report_video_webpage_download(self, video_id): """Report attempt to download video webpage.""" self.to_screen(u'%s: Downloading video webpage' % video_id) @@ -296,26 +292,6 @@ class YoutubeIE(InfoExtractor): if self._downloader is None: return - username = None - password = None - downloader_params = self._downloader.params - - # Attempt to use provided username and password or .netrc data - if downloader_params.get('username', None) is not None: - username = downloader_params['username'] - password = downloader_params['password'] - elif downloader_params.get('usenetrc', False): - try: - info = netrc.netrc().authenticators(self._NETRC_MACHINE) - if info is not None: - username = info[0] - password = info[2] - else: - raise netrc.NetrcParseError('No authenticators for %s' % self._NETRC_MACHINE) - except (IOError, netrc.NetrcParseError) as err: - self._downloader.report_warning(u'parsing .netrc: %s' % compat_str(err)) - return - # Set language request = compat_urllib_request.Request(self._LANG_URL) try: @@ -325,6 +301,8 @@ class YoutubeIE(InfoExtractor): self._downloader.report_warning(u'unable to set language: %s' % compat_str(err)) return + (username, password) = self._get_login_info() + # No authentication to be performed if username is None: return |