Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to download lynda.com videos using Organizational Login (HTTP 400 Bad Request Error) #6429

Closed
gdad-s-river opened this issue Aug 1, 2015 · 3 comments

Comments

@gdad-s-river
Copy link

@gdad-s-river gdad-s-river commented Aug 1, 2015

I've followed everything on this link (#5926) but I'm still getting the following error on typing the following command

youtube-dl --cookies Desktop/cookies1.txt --verbose http://www.lynda.com/Git-tutorials/Ignoring-tracked-files/100222/111297-4.html

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--cookies', u'Desktop/cookies1.txt', u'--verbose', u'http://www.lynda.com/Git-tutorials/Ignoring-tracked-files/100222/111297-4.html']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.07.28
[debug] Python version 2.7.6 - Linux-3.13.0-58-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 9.18-6, avprobe 9.18-6, rtmpdump 2.4
[debug] Proxy map: {}
[lynda] 111297: Downloading video JSON
ERROR: Unable to download webpage: HTTP Error 400: Bad Request (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 318, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1732, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

I've spent days trying to figure out a workaround here and troubleshooting, but I'm able to find out what is making a bad request after receiving the video JSON, please help

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 1, 2015

Post the output of --verbose --print-traffic --dump-pages and the layout of cookies file. Remove all private data.

@gdad-s-river
Copy link
Author

@gdad-s-river gdad-s-river commented Aug 2, 2015

@dstftw Command : youtube-dl --cookies Desktop/cookies.txt --verbose --print-traffic --dump-pages http://www.lynda.com/Git-tutorials/Ignoring-tracked-files/100222/111297-4.html

Output:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--cookies', u'Desktop/cookies.txt', u'--verbose', u'--print-traffic', u'--dump-pages', u'http://www.lynda.com/Git-tutorials/Ignoring-tracked-files/100222/111297-4.html']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.07.28
[debug] Python version 2.7.6 - Linux-3.13.0-58-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 9.18-6, avprobe 9.18-6, rtmpdump 2.4
[debug] Proxy map: {}
[lynda] 111297: Downloading video JSON
send: u'GET /ajax/player?videoId=111297&type=video HTTP/1.1\r\nHost: www.lynda.com\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/20.0 (Chrome)\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nConnection: close\r\nCookie: <REMOVED>\r\r\n\r\n'
reply: 'HTTP/1.0 400 Bad Request\r\n'
header: Content-Type: text/html
header: Content-Length: 349
header: Connection: close
header: Date: Sun, 02 Aug 2015 04:44:32 GMT
header: Server: ECDF (fcn/4027)
ERROR: Unable to download webpage: HTTP Error 400: Bad Request (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 318, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1732, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

Cookie layout:

# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file!  Do not edit.
<REMOVED>
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 2, 2015

You have invalid newline format used in cookies file. Currently it's Windows CRLF (\r\n) instead of Linux LF (\n). Converting newlines to \n fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.