Closed vikiaiteam closed 2 years ago
I have the exact same problem. Do we have any news about this bug?
This has been reported many times, but I haven't yet seen any info on it. I've tried with a cookies.txt file and also with manually specifying -u
and -p
. The cookies file gets further, as shown in the logs above, but only as far as seeing all of the videos to download. Once it tries downloading the first video, the 403 shows up again.
I have the same problem for many days. In the Meanwhile i use udemy-dl (in a docker container). It works fine.
I experienced the same issue from Git-bash and from the windows version. Any help or updates?
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.
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
@Darkcast it works just fine with the instructions in the repo
403 looks like a missmatch in the Metadata. Which data does the udemy-dl script use?
I tried to use gist instructions described here: https://gist.github.com/barbietunnie/8531d9c26cd1c0668e7278c7c4ba5853
But without success.
Heres what i got on current youtube-dl:
Downloads|⇒ youtube-dl --cookies cookie.txt https://www.udemy.com/course/hacking-real-websites-legally-2 --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--cookies', u'cookie.txt', u'https://www.udemy.com/course/hacking-real-websites-legally-2', u'--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.01.24
[debug] Python version 2.7.17 (CPython) - Darwin-18.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2, rtmpdump 2.4
[debug] Proxy map: {}
[udemy:course] course: Downloading webpage
[udemy:course] 2664834: Downloading course curriculum
[download] Downloading playlist: 2664834
[udemy:course] playlist 2664834: Collected 28 video ids (downloading 28 of them)
[download] Downloading video 1 of 28
[udemy] 17022386: Downloading webpage
[udemy] 17022386: Downloading lecture JSON
[udemy] 17022386: Downloading lecture JSON
ERROR: Unable to download JSON metadata: 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 "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 627, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2237, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
@Shineson1001
For some reason my docker doesnt like the line breaks in this dockerfile:
Sending build context to Docker daemon 2.048kB
Error response from daemon: Dockerfile parse error line 4: unknown instruction: GIT
Splitting them into multiple RUNs / joining them to one line solved the issue. Thanks for your input.
This is how i solved it:
FROM python:alpine
RUN apk add --no-cache --update gcc libc-dev libffi-dev openssl-dev git
RUN 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"]
Same here, it dies in exactly same spot everytime I run it:
..
[download] Destination: 30318/3.03. Javascript Essentials/14.0303 Boolean Types And Comparison.mp4
[download] 100% of 3.05MiB in 00:00
[download] Downloading video 15 of 92
[udemy] 170627: Downloading webpage
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.
Hello guys same here ... any update? It would be helpful to fix it so we can watch those courses offline
OS: Linux
youtube-dl -u #myUsername# -p #MyPassword# https://udemy.com/course/the-ultimate-drawing-course-beginner-to-advanced/ --verbose [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u'-u', u'PRIVATE', u'-p', u'PRIVATE', u'https://udemy.com/course/the-ultimate-drawing-course-beginner-to-advanced/', u'--verbose'] [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2020.03.24 [debug] Python version 2.7.17 (CPython) - Linux-5.3.0-45-generic-x86_64-with-Ubuntu-18.04-bionic [debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6, phantomjs 2.1.1, rtmpdump 2.4 [debug] Proxy map: {} [udemy:course] Downloading login popup [udemy:course] Logging in [udemy:course] course: Downloading webpage [udemy:course] 874012: Enrolling in the course [udemy:course] 874012: Downloading course curriculum ERROR: Unable to download JSON metadata: 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; 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 627, in _request_webpage return self._downloader.urlopen(url_or_request) File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 2238, 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)
Hi all,
The download will not work, because the course is not downloadable from the browser. You can check the api calls and search for "download_urls:" and you will see the value is set to null.
Maybe checking for the parameter from the api calls for "stream_urls:" and than try to download the video file.
api call example: { "stream_urls": { "Video": [ { "type":"video/mp4", "label":"720", "file":"https://bla bla bla with no extension" } ] } }
I also have this error
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!
sorry ... even that does not work :(
hi @jadence, thanks, it works.
- Changed the course URL from
https://www.udemy.com/course/<course_name>/
tohttps://www.udemy.com/<course_name>/
This fixed it for me. I downloaded all the videos for the course I bought.
Thanks @jadence
@jadence , @nbensa Can you share your full youtube-dl's command syntax?
@Anil86
youtube-dl --cookies [path-to-cookies-file] https://www.udemy.com/<course-name>/
HTH
I tried to generate cookie file using EditThisCookie chrome extension. But it shows following error:
'cookies.txt' does not look like a Netscape format cookies file
.
@nbensa What tool are you using to export cookie file?
I used this extension: https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg
@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!
guys what os and version of youtube-dl are you running ??
My system Ubuntu: 20.04 LTS Gnome: 3.36.2 youtube-dl: 2020-06-06
and your way simply does not work.. always returns 403 :(
plus can you list down your python version and packages installed? might be something related to that as well
holly crap it works now .. yes ... I uninstalled and reinstalled python and pip and it works now ...
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 🥇
This seems to be broken now. Have been trying all the mentioned work-arounds, no luck.
This seems to be broken now. Have been trying all the mentioned work-arounds, no luck.
arent u experiencing the one with amazon aws s3 storage instead? they recently migrated a lot of projects to aws and there is no way around atm :(
Could be that and I've been reading and saw that Udemy has introduced DRM (at least on their new content), so that could also be in the play. Not sure how much this info is on point...
Could be that and I've been reading and saw that Udemy has introduced DRM (at least on their new content), so that could also be in the play. Not sure how much this info is on point...
well check your --verbose output.. if you will see 403 on aws/s3 -> welcome to the club :(
I don't see any URL in my verbose output... It's failing on downloading login pop up itself...
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-u', 'PRIVATE', '-p', 'PRIVATE', '-F', '-i', 'https://www.udemy.com/ableton-live-11-course/', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.05.16
[debug] Python version 3.9.5 (CPython) - macOS-11.3.1-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.4, ffprobe 4.4, rtmpdump 2.4
[debug] Proxy map: {}
[udemy:course] Downloading login popup
ERROR: Unable to download webpage: 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 "/usr/local/Cellar/youtube-dl/2021.5.16/libexec/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 634, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/Cellar/youtube-dl/2021.5.16/libexec/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 2288, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 523, in open
response = meth(req, response)
File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 632, in http_response
response = self.parent.error(
File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 561, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
EDIT: After providing --print-traffic
, I see that it's trying to make a call to Cloudflare CDN report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct
... Could it be that Yt-dl isn't able to bypass CF protection?
is your cookie correct? try to delete all cache in your browser.... log in to udemy again, use "export cookies" add on and export the cookie .... and try again with verbose pls
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.
Here is a recent Issue for the AWS Problem: https://github.com/ytdl-org/youtube-dl/issues/28877 Update: On the other issue you can also have account credentials.
У меня была та же ошибка 403, несмотря на покупку курса. Чтобы исправить это, я сделал две вещи:
- Очистите мои файлы cookie udemy, снова войдите на udemy.com, а затем экспортируйте новый
cookies.txt
- URL курса изменен с
https://www.udemy.com/course/<course_name>/
наhttps://www.udemy.com/<course_name>/
После двух вышеуказанных шагов запуск,
youtube-dl --cookies cookies.txt https://www.udemy.com/<course_name>/ --verbose
наконец, сработал!
It worked for me too. Even without deleting cookies Thank you!!
Continued in #22306, closed as solved.
Checklist
Verbose log