From 6b445558ffe292c11327862ab510b1abf4e36616 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Thu, 23 Oct 2014 00:44:21 +0200 Subject: [PATCH] [youtube] Only set language when necessary We only need to set the language when we are using a login; otherwise it will always be English. --- youtube_dl/extractor/youtube.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index cfae2de89..4ab56e0ac 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -191,8 +191,9 @@ class YoutubeBaseInfoExtractor(InfoExtractor): def _real_initialize(self): if self._downloader is None: return - if not self._set_language(): - return + if self._get_login_info()[0] is not None: + if not self._set_language(): + return if not self._login(): return self._confirm_age()