youtube-dl: Udemy.com HTTP Error 403: Forbidden (caused by )

Checklist

  • I’m reporting a broken site support
  • I’ve verified that I’m running youtube-dl version 2019.09.28
  • 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:\udemy-downloaded>youtube-dl -v -u xxx@gmail.com -p xxx --cookies C:\udemy-downloaded\udemy-cookies.txt -o "C:\udemy-downloaded\%(
playlist)s/%(chapter_number)s-%(chapter)s/%(playlist_index)s.%(title)s.%(ext)s" https://www.udemy.com/course/academic-ielts-writing-task-1 
s
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-u', 'PRIVATE', '-p', 'PRIVATE', '--cookies', 'C:\\udemy-downloaded\\udemy-cookies.txt', '-o', 'C:\\udemy-downloaded\\%(pl
aylist)s/%(chapter_number)s-%(chapter)s/%(playlist_index)s.%(title)s.%(ext)s', 'https://www.udemy.com/course/academic-ielts-writing-task-1', '--convert-subs', 'vtt']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2019.09.28
[debug] Python version 3.7.4 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-93640-ga087764847, ffprobe N-93640-ga087764847
[debug] Proxy map: {}
[udemy:course] Downloading login popup
[udemy:course] course: Downloading webpage
[udemy:course] 2205064: Downloading course curriculum
[download] Downloading playlist: 2205064
[udemy:course] playlist 2205064: Collected 43 video ids (downloading 43 of them)
[download] Downloading video 1 of 43
[udemy] Downloading login popup
[udemy] 13580764: Downloading webpage
[udemy] 13580764: Downloading lecture JSON
[udemy] 13580764: Downloading lecture JSON
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 ar
e 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:\python37\lib\site-packages\youtube_dl\extractor\common.py", line 627, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "c:\python37\lib\site-packages\youtube_dl\YoutubeDL.py", line 2237, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "c:\python37\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "c:\python37\lib\urllib\request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "c:\python37\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "c:\python37\lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "c:\python37\lib\urllib\request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)```


## Description

<!--
Provide an explanation of your issue in an arbitrary form. Provide any additional information, suggested solution and as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

WRITE DESCRIPTION HERE

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 12
  • Comments: 36 (2 by maintainers)

Most upvoted comments

I was having the same 403 error despite purchasing the course. To fix it I did two things:

  1. Clear my udemy cookies, log back into udemy.com, and then export a new cookies.txt
  2. Changed the course URL from https://www.udemy.com/course/<course_name>/ to https://www.udemy.com/<course_name>/

After the above two steps running youtube-dl --cookies cookies.txt https://www.udemy.com/<course_name>/ --verbose finally worked!

I was having the same 403 error despite purchasing the course. To fix it I did two things:

1. Clear my udemy cookies, log back into udemy.com, and then export a new `cookies.txt`

2. Changed the course URL from `https://www.udemy.com/course/<course_name>/` to `https://www.udemy.com/<course_name>/`

After the above two steps running youtube-dl --cookies cookies.txt https://www.udemy.com/<course_name>/ --verbose finally worked!

This 🥇

I have the exact same problem. Do we have any news about this bug?

@jadence , @nbensa Can you share your full youtube-dl’s command syntax?

@Anil86 - My command I used is youtube-dl --cookies cookies.txt https://www.udemy.com/<course_name>/ --verbose notes: • The --verbose flag almost certainly isn’t necessary • My cookies.txt was placed in the same directory I ran the above command in • My cookies.txt file was generated using https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/

Good luck!

  1. Changed the course URL from https://www.udemy.com/course/<course_name>/ to https://www.udemy.com/<course_name>/

This fixed it for me. I downloaded all the videos for the course I bought.

Thanks @jadence

I have the same problem for many days. In the Meanwhile i use udemy-dl (in a docker container). It works fine.

That tool is also broken it doesnt download the videos either

I have the same problem for many days. In the Meanwhile i use udemy-dl (in a docker container). It works fine.

I have the same problem for many days. In the Meanwhile i use udemy-dl (in a docker container). It works fine.

That tool is also broken it doesnt download the videos either

it works

root@nuc1:/opt/docker-udemydl # cat Dockerfile FROM python:alpine

RUN apk add --no-cache --update gcc libc-dev libffi-dev openssl-dev git &&
git clone https://github.com/r0oth3x49/udemy-dl.git &&
cd udemy-dl &&
pip install -r requirements.txt &&
mkdir -p /course

VOLUME [“/course”]

ENTRYPOINT [“python”, “/udemy-dl/udemy-dl.py”, “-o”, “/course”]

docker build -t xxx/your-udemy-dl-image:1.0 . --no-cache docker run -it --rm -v $(pwd):/course --name tempudemy-dl xxx/your-udemy-dl-image:1.0 -u your-udemy-user -p your-udemy-password https://www.udemy.com/course/xxx

Did all of that already. That was my first guess… did a clean wipe off cookies on my browser. I’ve been using another tool “Udeler”… that seems to be downloading at least some courses, but, gets stuck whenever there’s an attachment in the course.

holly crap it works now … yes … I uninstalled and reinstalled python and pip and it works now …