mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-29 01:51:06 +00:00
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.
This commit is contained in:
parent
5121ef2071
commit
cc10940385
1 changed files with 5 additions and 5 deletions
10
youtube-dl
10
youtube-dl
|
@ -493,12 +493,8 @@ class YoutubeIE(InfoExtractor):
|
||||||
self.to_stderr(u'WARNING: parsing .netrc: %s' % str(err))
|
self.to_stderr(u'WARNING: parsing .netrc: %s' % str(err))
|
||||||
return
|
return
|
||||||
|
|
||||||
# No authentication to be performed
|
|
||||||
if username is None:
|
|
||||||
return
|
|
||||||
|
|
||||||
# Set language
|
# Set language
|
||||||
request = urllib2.Request(self._LOGIN_URL, None, std_headers)
|
request = urllib2.Request(self._LANG_URL, None, std_headers)
|
||||||
try:
|
try:
|
||||||
self.report_lang()
|
self.report_lang()
|
||||||
urllib2.urlopen(request).read()
|
urllib2.urlopen(request).read()
|
||||||
|
@ -506,6 +502,10 @@ class YoutubeIE(InfoExtractor):
|
||||||
self.to_stderr(u'WARNING: unable to set language: %s' % str(err))
|
self.to_stderr(u'WARNING: unable to set language: %s' % str(err))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# No authentication to be performed
|
||||||
|
if username is None:
|
||||||
|
return
|
||||||
|
|
||||||
# Log in
|
# Log in
|
||||||
login_form = {
|
login_form = {
|
||||||
'current_form': 'loginForm',
|
'current_form': 'loginForm',
|
||||||
|
|
Loading…
Reference in a new issue