youtube-dl: [Udemy] ERROR: Unable to download webpage: HTTP Error 403: Forbidden
Checklist
- I’m reporting a broken site support
- I’ve verified that I’m running youtube-dl version 2021.06.06
- 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
Verbose log
C:\>youtube-dl.exe -u **** -p **** https://www.udemy.com/course/learn-advanced-java/ --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-u', 'PRIVATE', '-p', 'PRIVATE', 'https://www.udemy.com/course/learn-advanced-java/', '--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: none
[debug] Proxy map: {}
[udemy:course] Downloading login popup
ERROR: Unable to download webpage: HTTP Error 403: Forbidden (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 "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\common.py", line 634, in _request_webpage
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 2288, in urlopen
File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default```
Description
I was trying to download the learn advanced Java course which I have bought from Udemy for offline watching purposes. However, youtube-dl gives me an error when trying to do so.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 35 (15 by maintainers)
I was having the
403issue, and then I was having an extract login-form form issue, but I was able to resolve both of them and get youtube-dl working with Udemy.First I was able to resolve the 403 by logging into the website in chrome and then downloading the cookie file and including it with the ‘–cookie /path/to/cookie.txt’ option. (See How do I pass cookies to youtube-dl). But then I was still getting the error:
It turns out this was caused because in my youtube-dl request I was passing
-u username -p passwordoptions to the request which was causing the login popup preventing the download.Also to note, in the URL for a course in Udemy, i.e.
https://www.udemy.com/course/understanding-typescript/, there is an extra/course/that needs to be removed for the request. So the URL should instead look likehttps://www.udemy.com/understanding-typescript/.Put all this together and a valid request should look like:
Where you replace the path to the cookie file, the path to the output directory, and the course name in the Udemy URL.
Hope this helps 😃
note
This should be handled automatically. Could you post some
-v -Flogs showing behaviour with/withoutcourse/? Or if this patch makes it work with the raw URL as quoted above, let us know:Your URL is not right.
try
youtube-dl.exe -u **** -p **** https://www.udemy.com/learn-advanced-java/ --verbose