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

Safaribooksonline login failed #13413

Closed
error0x01 opened this issue Jun 17, 2017 · 5 comments
Closed

Safaribooksonline login failed #13413

error0x01 opened this issue Jun 17, 2017 · 5 comments

Comments

@error0x01
Copy link

@error0x01 error0x01 commented Jun 17, 2017

I can't login with a subscription account.

| => youtube-dl -v --username USER --password PASS "https://www.safaribooksonline.com/library/view/ccna-routing-and/9780134580715/"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--username', u'PRIVATE', u'--password', u'PRIVATE', u'https://www.safaribooksonline.com/library/view/ccna-routing-and/9780134580715/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.06.12
[debug] Python version 2.7.13 - Darwin-16.6.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.3.2, ffprobe 3.3.2
[debug] Proxy map: {}
[safari:course] Downloading login form
[safari:course] Logging in as USER
ERROR: Login failed; make sure your credentials are correct and try again.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 762, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 432, in extract
    self.initialize()
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 390, in initialize
    self._real_initialize()
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/safari.py", line 27, in _real_initialize
    self._login()
  File "/usr/local/lib/python2.7/site-packages/youtube_dl/extractor/safari.py", line 69, in _login
    expected=True)
ExtractorError: Login failed; make sure your credentials are correct and try again.

I've seen in the file "youtube_dl/extractor/safari.py" that _LOGIN_URL = 'https://www.safaribooksonline.com/accounts/login/'

I've tried to login through "https://www.safaribooksonline.com/accounts/login/" with my credentials and my user/pass works fine as well as the access through "https://ssl.safaribooksonline.com/securelogin"

@ofauno
Copy link

@ofauno ofauno commented Jun 21, 2017

I got 2 different outputs on different computers

[debug] Command-line args: [u'--verbose', u'--username', u'PRIVATE', u'--password', u'PRIVATE', u'https://www.safaribooksonline.com/library/view/algorithms-24-part-lecture/9780134384528/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.06.05
[debug] Python version 2.7.10 - Darwin-16.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.6.1, ffprobe 2.6.1
[debug] Proxy map: {}
[safari:course] Downloading login form
ERROR: Unable to download webpage: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))
  File "./youtube-dl/youtube_dl/extractor/common.py", line 502, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "./youtube-dl/youtube_dl/YoutubeDL.py", line 2129, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "./youtube-dl/youtube_dl/utils.py", line 1082, in https_open
    req, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)

and

[download] Downloading video 1 of 124
[safari:api] Downloading login form
ERROR: Unable to extract csrf token; 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.
Traceback (most recent call last):
  File "/Users/fauno/homebrew/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 761, in extract_info
    ie_result = ie.extract(url)
  File "/Users/fauno/homebrew/bin/youtube-dl/youtube_dl/extractor/common.py", line 432, in extract
    self.initialize()
  File "/Users/fauno/homebrew/bin/youtube-dl/youtube_dl/extractor/common.py", line 390, in initialize
    self._real_initialize()
  File "/Users/fauno/homebrew/bin/youtube-dl/youtube_dl/extractor/safari.py", line 28, in _real_initialize
    self._login()
  File "/Users/fauno/homebrew/bin/youtube-dl/youtube_dl/extractor/safari.py", line 50, in _login
    login_page, 'csrf token')
  File "/Users/fauno/homebrew/bin/youtube-dl/youtube_dl/extractor/common.py", line 791, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/Users/fauno/homebrew/bin/youtube-dl/youtube_dl/extractor/common.py", line 782, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract csrf token; 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.
@deividfortuna
Copy link

@deividfortuna deividfortuna commented Jul 3, 2017

Same problem here 😭

@lexia
Copy link

@lexia lexia commented Jul 28, 2017

I hit the same error message with this error on login.

[debug] Proxy map: {}
[safari] Downloading login form
ERROR: Unable to download webpage: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 502, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2166, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 1086, in https_open
    req, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)

On inspecting my system, I noticed that Python was using OpenSSL 0.9.8zh which was installed. Homebrew's OpenSSL version was at 1.0.2l. [EDIT: This is isn't the newest rev, but worked for me as it was, so if you want to move to latest stable to try something similar go ahead!]

I updated Python to use 1.0.2l, and cleaned up links in Homebrew. Did the bones of this suggestion from first answer in this SO query https://stackoverflow.com/questions/18752409/updating-openssl-in-python-2-7

Worked for me! Let me know if works for any of you.

@7wgs0gr04v
Copy link

@7wgs0gr04v 7wgs0gr04v commented Aug 26, 2018

This is still not fixed !!

[debug] System config: []
[debug] User config: ['-u', 'PRIVATE', '-p', 'PRIVATE', '-i', '-c', '--no-warnings', '--verbose', '--console-title', '--
batch-file=batch-file.txt', '-o', '%(playlist_title)s/%(playlist_index)s-%(title)s.%(ext)s', '-f', 'bestvideo[height<=72
0]+bestaudio/best[height<=720]/worst']
[debug] Custom config: []
[debug] Command-line args: []
[debug] Batch file urls: ['https://www.safaribooksonline.com/videos/opencv-3-by/9781787287259/']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2018.08.22
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.14393
[debug] exe versions: ffmpeg N-91690-g844ff49469, ffprobe N-91690-g844ff49469
[debug] Proxy map: {}
[safari:course] Downloading login form
[safari:course] Logging in
ERROR: Login failed; make sure your credentials are correct and try again.
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsjdqsmfs\build\youtube_dl\YoutubeDL.py", line 792,
in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsjdqsmfs\build\youtube_dl\extractor\common.py", lin
e 501, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsjdqsmfs\build\youtube_dl\extractor\common.py", lin
e 405, in initialize
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsjdqsmfs\build\youtube_dl\extractor\safari.py", lin
e 27, in _real_initialize
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsjdqsmfs\build\youtube_dl\extractor\safari.py", lin
e 69, in _login
youtube_dl.utils.ExtractorError: Login failed; make sure your credentials are correct and try again.
@renatoch
Copy link

@renatoch renatoch commented Sep 24, 2018

I got a similar error, although probably not the same, since I didn't get the traceback.
Sharing here in case it helps somebody. I tried using the youtube-dl.conf with user and pass built in it, but got login error.
I then removed the password, so that youtube-dl asked for me to type it when ran.
I typed and it worked (probably some reserved character).

@dstftw dstftw closed this Dec 15, 2018
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
7 participants
You can’t perform that action at this time.