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

RegexNotFoundError: Unable to extract csrf token - www.safaribooksonline.com #13319

Closed
vigo opened this issue Jun 8, 2017 · 0 comments
Closed

RegexNotFoundError: Unable to extract csrf token - www.safaribooksonline.com #13319

vigo opened this issue Jun 8, 2017 · 0 comments

Comments

@vigo
Copy link

@vigo vigo commented Jun 8, 2017

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.06.05. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.06.05

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[debug] System config: []
[debug] User config: [u'-o', u'%(autonumber)03d-%(title)s.%(ext)s', u'--prefer-ffmpeg']
[debug] Custom config: []
[debug] Command-line args: [u'-u', u'PRIVATE', u'-p', u'PRIVATE', u'--verbose', u'https://www.safaribooksonline.com/library/view/go-concurrency/9781788394161/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.06.05
[debug] Git HEAD: 01d39850b564
[debug] Python version 2.7.12 - Darwin-16.6.0-x86_64-i386-64bit
[debug] exe versions: avconv 12, avprobe 12, ffmpeg 3.3.2, ffprobe 3.3.2
[debug] Proxy map: {}
[safari:course] Downloading login form
[safari:course] Logging in as -----------
[safari:course] Login successful
[safari:course] 9781788394161: Downloading course JSON
[download] Downloading playlist: Go Concurrency
[safari:course] playlist Go Concurrency: Collected 10 video ids (downloading 10 of them)
[download] Downloading video 1 of 10
[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; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/Users/----/.pyenv/versions/2.7.12/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 761, in extract_info
    ie_result = ie.extract(url)
  File "/Users/----/.pyenv/versions/2.7.12/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 432, in extract
    self.initialize()
  File "/Users/----/.pyenv/versions/2.7.12/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 390, in initialize
    self._real_initialize()
  File "/Users/----/.pyenv/versions/2.7.12/lib/python2.7/site-packages/youtube_dl/extractor/safari.py", line 28, in _real_initialize
    self._login()
  File "/Users/----/.pyenv/versions/2.7.12/lib/python2.7/site-packages/youtube_dl/extractor/safari.py", line 50, in _login
    login_page, 'csrf token')
  File "/Users/----/.pyenv/versions/2.7.12/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 791, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/Users/----/.pyenv/versions/2.7.12/lib/python2.7/site-packages/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; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description of your issue, suggested solution and other information

I had never issues with safaribooks till this one: https://www.safaribooksonline.com/library/view/go-concurrency/9781788394161/

@dstftw dstftw closed this in 4244a13 Jun 8, 2017
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
1 participant
You can’t perform that action at this time.