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

[udemy] unable to login #14713

Closed
ghost opened this issue Nov 10, 2017 · 17 comments
Closed

[udemy] unable to login #14713

ghost opened this issue Nov 10, 2017 · 17 comments

Comments

@ghost
Copy link

ghost commented Nov 10, 2017

youtube-dl -u [email protected] -p password https://www.udemy.com/javascript-essentials/learn/v4/content --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-u', u'PRIVATE', u'-p', u'PRIVATE', u'https://www.udemy.com/javascript-essentials/learn/v4/content', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.11.06
[debug] Python version 2.7.12 - Linux-4.10.0-38-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: none
[debug] Proxy map: {}
[udemy:course] Downloading login popup
[udemy:course] Logging in as [email protected]
ERROR: Unable to log in; 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 "/home/extsalt/.local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 784, in extract_info
ie_result = ie.extract(url)
File "/home/extsalt/.local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 436, in extract
self.initialize()
File "/home/extsalt/.local/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 394, in initialize
self._real_initialize()
File "/home/extsalt/.local/lib/python2.7/site-packages/youtube_dl/extractor/udemy.py", line 140, in _real_initialize
self._login()
File "/home/extsalt/.local/lib/python2.7/site-packages/youtube_dl/extractor/udemy.py", line 180, in _login
raise ExtractorError('Unable to log in')
ExtractorError: Unable to log in; 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.

@yan12125 yan12125 changed the title unable to login [udemy] unable to login Nov 10, 2017
@dstftw
Copy link
Collaborator

dstftw commented Nov 10, 2017

Post the output with --dump-pages.

@ScttB
Copy link

ScttB commented Nov 11, 2017

You missed a email address there.
[udemy:course] Logging in as ([email protected])

@giacomocerquone
Copy link

giacomocerquone commented Nov 24, 2017

UPDATE: Evreything is working now, I was using an old version of the script that i got from apt!

@dikadk
Copy link

dikadk commented Dec 9, 2017

I can confirm that I have the same issue with downloading courses from Udemy. I use the latest version and I'm on HighSierra.

@giacomocerquone
Copy link

@dikadk It's strange, are you sure are you using the latest version? I've no problem on windows, but the two OS shouldn't differ

@jyounus
Copy link

jyounus commented Dec 11, 2017

I'm having the same error, here's my output with the --dump-pages command (I had to use an external service because of reaching the max number of characters in this comment):
https://paste.ee/p/6qF6K

I'm running the latest version of youtube-dl on High Sierra.

@ghost
Copy link
Author

ghost commented Jan 8, 2018

I can't login to udemy too

@OldTrain
Copy link

youtube-dl -u [email protected] -p PASSWORD -o "%(chapter)s/%(title)s.%(ext)s"  "http://www.udemy.com/unity-game-developers-masterclass-write-games-using-c/learn/v4/content" --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-u', 'PRIVATE', '-p', 'PRIVATE', '-o', '%(chapter)s/%(title)s.%(ext)s', 'http://www.udemy.com/unity-game-developers-masterclass-write-games-using-c/learn/v4/content', '--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2018.09.26
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.16299
[debug] exe versions: none
[debug] Proxy map: {}
[udemy:course] Downloading login popup
[udemy:course] Logging in
ERROR: Unable to log in; 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 "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpcaq35cl9\build\youtube_dl\YoutubeDL.py", line 792, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpcaq35cl9\build\youtube_dl\extractor\common.py", line 506, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpcaq35cl9\build\youtube_dl\extractor\common.py", line 410, in initialize
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpcaq35cl9\build\youtube_dl\extractor\udemy.py", line 154, in _real_initialize
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpcaq35cl9\build\youtube_dl\extractor\udemy.py", line 194, in _login
youtube_dl.utils.ExtractorError: Unable to log in; 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.

@OldTrain
Copy link

request with dump page
udemy-dl-dump.txt

@ralyodio
Copy link

Looks like this is back....

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'-u', u'PRIVATE', u'-p', u'PRIVATE', u'--rate-limit', u'500K', u'--sleep-interval', u'30', u'-o', u'%(autonumber)s-%(title)s.%(ext)s', u'https://www.udemy.com/aws-certified-solutions-architect-associate/learn/v4/overview']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.11.07
[debug] Python version 2.7.15rc1 (CPython) - Linux-3.14.32-xxxx-grs-ipv6-64-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.4-0ubuntu0.18.04.1, ffprobe 3.4.4-0ubuntu0.18.04.1
[debug] Proxy map: {}
[udemy:course] Downloading login popup
ERROR: Unable to download webpage: HTTP Error 403: Unauthorized (caused by HTTPError()); 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.
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 605, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 2211, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

@TCarmine
Copy link

I do have kind similar issue. But to me is strange as once I did write:

youtube-dl -u email -p Password Link/content

it then on the next line put something strange as

youtube-dl -u email -p Password+someotherstring Link/content

I tried without -u and -p but bring me the following

Unable to download webpage: HTTP Error 403: Unauthorized (caused by HTTPError());

@TCarmine
Copy link

I had a look to my local udemy-dl and found that the code that is failing seems the following:

def get_csrf_token():
"""Extractig CSRF Token from login page."""
try:
response = session.get('https://www.udemy.com/join/login-popup')
match = re.search(r"name='csrfmiddlewaretoken'\s+value='(.)'", response.text)
return match.group(1)
except AttributeError:
session.get('http://www.udemy.com/user/logout')
response = session.get('https://www.udemy.com/join/login-popup')
match = re.search(r"name='csrfmiddlewaretoken'\s+value='(.
)'", response.text)
return match.group(1)

@TCarmine
Copy link

So seems the that part fail to get the CSRF Token.

Could be udemy changed the Token?

@TCarmine
Copy link

Just to clarify I got the previous error not running youtube-dl but udemy-dl that is the only one that prompt to give userName and Password.
Unfortunately the youtube-dl add that extra string to the password.

@ewarner9
Copy link

ewarner9 commented Dec 22, 2018

how do you use udemy-dl? when I try that it is not a recognized command. I am getting a similar error trying to login...

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-u', 'PRIVATE', '-p', 'PRIVATE', '-v', 'https://www.udemy.com/the-complete-aspnet-mvc-5-course/learn/v4/content']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2018.12.17
[debug] Python version 3.6.4 (CPython) - Windows-10-10.0.17134-SP0
[debug] exe versions: none
[debug] Proxy map: {}
[udemy:course] Downloading login popup
ERROR: Unable to download webpage: HTTP Error 403: Unauthorized (caused by <HTTPError 403: 'Unauthorized'>); 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.
  File "c:\python\python36\lib\site-packages\youtube_dl\extractor\common.py", line 605, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "c:\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 2212, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "c:\python\python36\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "c:\python\python36\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "c:\python\python36\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "c:\python\python36\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "c:\python\python36\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)

@ghost
Copy link
Author

ghost commented Dec 28, 2018

I also get this error:

ERROR: Unable to download webpage: HTTP Error 403: Unauthorized (caused by <HTTPError 403: 'Unauthorized'>);

Has there been any progress at this?

@TCarmine
Copy link

@ewarner9 I am on Ubuntu 18.04 though.

You are in Windows(n so CPython).

Our error code is the same 403, it then does not recognize our credentials. In my case the reason is that somehow to the password is added an extra string. Too me seems a security constrain

@dstftw dstftw closed this as completed in ae65c93 Feb 16, 2019
meunierd referenced this issue in meunierd/youtube-dl Dec 27, 2019
meunierd referenced this issue in meunierd/youtube-dl Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants