summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRicardo Garcia <[email protected]>2009-03-02 00:02:56 +0100
committerRicardo Garcia <[email protected]>2010-10-31 11:23:48 +0100
commitcc109403853bac92861aab7f0fc5f93398c336b0 (patch)
treef866d97cc5efe0c8ce439ed98d9300cbef390620
parent5121ef207112040fdf58e889393071aeb51cf4f2 (diff)
downloadyoutube-dl-cc109403853bac92861aab7f0fc5f93398c336b0.tar.gz
youtube-dl-cc109403853bac92861aab7f0fc5f93398c336b0.zip
Fix very wrong code for setting the language
It turned out that, despite the program working without apparent errors, the code for setting the language was completely wrong. First, it didn't run unless some form of authentication was performed. Second, I misstyped _LANG_URL as _LOGIN_URL, so the language was not being set at all! Amazing it still worked.
-rwxr-xr-xyoutube-dl10
1 files changed, 5 insertions, 5 deletions
diff --git a/youtube-dl b/youtube-dl
index 323897a9c..4ddf62274 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -493,12 +493,8 @@ class YoutubeIE(InfoExtractor):
self.to_stderr(u'WARNING: parsing .netrc: %s' % str(err))
return
- # No authentication to be performed
- if username is None:
- return
-
# Set language
- request = urllib2.Request(self._LOGIN_URL, None, std_headers)
+ request = urllib2.Request(self._LANG_URL, None, std_headers)
try:
self.report_lang()
urllib2.urlopen(request).read()
@@ -506,6 +502,10 @@ class YoutubeIE(InfoExtractor):
self.to_stderr(u'WARNING: unable to set language: %s' % str(err))
return
+ # No authentication to be performed
+ if username is None:
+ return
+
# Log in
login_form = {
'current_form': 'loginForm',