]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[youtube] Only set language when necessary
authorPhilipp Hagemeister <phihag@phihag.de>
Wed, 22 Oct 2014 22:44:21 +0000 (00:44 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Wed, 22 Oct 2014 22:44:22 +0000 (00:44 +0200)
We only need to set the language when we are using a login; otherwise it will always be English.

youtube_dl/extractor/youtube.py

index cfae2de8990ff7f6ae1f7ff37fdc0b559db3d290..4ab56e0ac6baf7f59f1c8892b5dbe560d96cb195 100644 (file)
@@ -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()