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

Cannot download from Udemy, through SSO, Username/Password, Cookies.txt #24138

Closed
marcvisconte opened this issue Feb 25, 2020 · 1 comment
Closed

Comments

@marcvisconte
Copy link

@marcvisconte marcvisconte commented Feb 25, 2020

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.02.16
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones [Actually, I've been in and out of Bugtracker multiple times, trying to solve this on my own. I've seen many issues marked as duplicate, but there is no original issue identified, so, we just keep going through this, over and over. I don't know that we can tell when a specific issue has been handled, we just see (closed/duplicate/incomplete/etc.). ]

Verbose log

This is for using the --username / --password options, discarding other (output formatting, audio, etc.) options:
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--dump-json', '--username', 'PRIVATE', '--password', 'PRIVATE', 'https://gdit.udemy.com/complete-linux-training-course-to-get-your-dream-it-job/']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.02.16
[debug] Python version 3.6.4 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
ERROR: Unable to download JSON metadata: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); 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:\program files\python36\lib\site-packages\youtube_dl\extractor\common.py", line 627, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "c:\program files\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 2237, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "c:\program files\python36\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "c:\program files\python36\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "c:\program files\python36\lib\urllib\request.py", line 570, in error
return self._call_chain(*args)
File "c:\program files\python36\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "c:\program files\python36\lib\urllib\request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)

Description

I get to access Udemy through a work account.
I can enter the site from the company portal, which is Okta-hosted, using SSO.
Udemy appears as company-branded Udemy URL: company_name.udemy.com
I can locate and play the course.

From the same computer/browser, while NOT using the work portal, I can log in to the site, and play the content, probably due to saved cookies.

Udemy allows business-account users to create a linked individual account (i.e., using work email) and set a password.
I have done this. I can access Udemy from a separate browser -- NOT using the Okta SSO portal, using the email address/ password.

From the NON-portal-using browser, I entered the company-branded Udemy URL and tried the option to continue to Udemy courses through SSO. Attempting to enter the company-branded URL and selecting the SSO option forwards the browser to another site:
https://sso.connect.pingidentity.com/sso/sp/initsso/?idpid={companyID}&saasid={36-character-alphanumeric-hash}

I have results from multiple attempts, using different combinations of commands and parameters (explicitly pathing the executables, etc).
The LAST attempt, using the working email address/password, resulted in the VERBOSE log above.

Attempting to d/l from this company-branded URL with these settings results in various HTTP Error 403: FORBIDDEN messages.

Normal, using cookies.txt
"C:\Program Files\Python36\Scripts\youtube-dl.exe" --verbose --restrict-filenames --cookie ".\cookies_2020_02_18_upd.txt" -f "best" -o "./Dload_p3/%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s - %(title)s.%(ext)s" --add-metadata --ffmpeg-location "F:\xfers-progs\ffmpeg\bin\ffmpeg.exe" --postprocessor-args "-id3v2_version 3" https://gdit.udemy.com/complete-linux-training-course-to-get-your-dream-it-job/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--restrict-filenames', '--cookie', '.\cookies_2020_02_18_upd.txt', '-f', 'best', '-o', './Dload_p3/%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s - %(title)s.%(ext)s', '--add-metadata', '--ffmpeg-location', 'F:\xfers-progs\ffmpeg\bin\ffmpeg.exe', '--postprocessor-args', '-id3v2_version 3', 'https://gdit.udemy.com/complete-linux-training-course-to-get-your-dream-it-job/']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.02.16
[debug] Python version 3.6.4 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg git-2020-01-26-5e62100, ffprobe git-2020-01-26-5e62100
[debug] Proxy map: {}
[udemy:course] complete-linux-training-course-to-get-your-dream-it-job: Downloading webpage
[udemy:course] 1523066: Downloading course curriculum
ERROR: Unable to download JSON metadata: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); 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:\program files\python36\lib\site-packages\youtube_dl\extractor\common.py", line 627, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "c:\program files\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 2237, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "c:\program files\python36\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "c:\program files\python36\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "c:\program files\python36\lib\urllib\request.py", line 570, in error
return self._call_chain(*args)
File "c:\program files\python36\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "c:\program files\python36\lib\urllib\request.py", line 650, in http_error_default

Not knowing if I needed to keep cookies.txt while using --username / --password, I attempted this:
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--cookies', 'cookies.txt', '--verbose', '--dump-json', '--username', 'PRIVATE', '--password', 'PRIVATE', 'https://gdit.udemy.com/complete-linux-training-course-to-get-your-dream-it-job/']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.02.16
[debug] Python version 3.6.4 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
ERROR: Unable to extract login-form form; 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 "c:\program files\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 796, in extract_info
ie_result = ie.extract(url)
File "c:\program files\python36\lib\site-packages\youtube_dl\extractor\common.py", line 529, in extract
self.initialize()
File "c:\program files\python36\lib\site-packages\youtube_dl\extractor\common.py", line 433, in initialize
self._real_initialize()
File "c:\program files\python36\lib\site-packages\youtube_dl\extractor\udemy.py", line 172, in _real_initialize
self._login()
File "c:\program files\python36\lib\site-packages\youtube_dl\extractor\udemy.py", line 191, in _login
login_form = self._form_hidden_inputs('login-form', login_popup)
File "c:\program files\python36\lib\site-packages\youtube_dl\extractor\common.py", line 1322, in _form_hidden_inputs
html, '%s form' % form_id, group='form')
File "c:\program files\python36\lib\site-packages\youtube_dl\extractor\common.py", line 1005, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract login-form form; 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.

I also attempted using the SSO.CONNECT.PINGIDENTITY.COM url as a referrer URL. This also failed. Meh... it was worth a try.

I'm not compulsive. Not one bit.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 25, 2020

You must provide account credentials for any work on this.

@dstftw dstftw closed this Feb 25, 2020
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.