Code Monkey home page Code Monkey logo

Comments (51)

Puyodead1 avatar Puyodead1 commented on May 18, 2024 10

This looks to be caused by a cookie __cf_bm which is a CloudFlare cookie related to anti-bot protection.
https://support.cloudflare.com/hc/en-us/articles/200170156-Understanding-the-Cloudflare-Cookies#12345681

I will try a possible to solution tomorrow.

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024 3

f6918e4 fixes the 403 errors when fetching courses and course information. There is still a problem with yt-dlp and fetching MPD manifests causing 403 errors.

from udemy-downloader.

Zeddex avatar Zeddex commented on May 18, 2024 2

I've found a solution - use https://www.udemy.com/course-name/ instead of https://www.udemy.com/course/course-name/

from udemy-downloader.

quidt avatar quidt commented on May 18, 2024 2

True that yt-dlp cannot fetching mpd causing 403 Forbidden when I leeching encrypted files.

And yes, I did fixed utils.py, removed User-Agent header, block IPv6.

image

from udemy-downloader.

Zeddex avatar Zeddex commented on May 18, 2024 1

How do you avoid the DRM problem?
@Zeddex works but DRM fail...help me?

Just find this repo widevine-l3-guesser

from udemy-downloader.

rvipinkumar avatar rvipinkumar commented on May 18, 2024 1

@jbauer2016 Seems like you installed a python version which is not the normal python. Where did you installed this python from? The lib folder of the python installation should have subprocess.py library, which in your case is throwing some error. Install python from python.org, and try again.

from udemy-downloader.

booshveg avatar booshveg commented on May 18, 2024 1

Can anyone find a solution?

from udemy-downloader.

booshveg avatar booshveg commented on May 18, 2024 1

Yes, I use the latest version of yt-dlp and comment line 1680 ('User-Agent': random_user_agent(),), but error 403 occur.
I've also tried the method that @amaillo-mc mentioned building yt-dlp, but it doesn't work for me.

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

check your bearer token

from udemy-downloader.

mahdisky avatar mahdisky commented on May 18, 2024

i using bearer token but its show error

from udemy-downloader.

amirali1996 avatar amirali1996 commented on May 18, 2024

i using bearer token but its show error

Use US IP if you are from ME

from udemy-downloader.

aluisco avatar aluisco commented on May 18, 2024

Same here:

(venv) root@DESKTOP-Q0SCQBM:/mnt/d/Projects/udemy-downloader# python main.py -c https://www.udemy.com/course/XXX
Login Success

Fetching course information, this may take a minute...
Udemy Says: 403 Forbidden on https://www.udemy.com/api-2.0/users/me/subscribed-courses?fields[course]=id,url,title,published_title&page=1&page_size=500&search=XXX

I think they disable the download option for now

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

I think they disable the download option for now

If that were the case, you wouldn't be able to use the website to view courses either. I'll take a look and see if I can find what's going on

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

I just tested it and it worked fine for me, so there must be something that different with the way you are trying to download. maybe a vpn?

from udemy-downloader.

gyurix avatar gyurix commented on May 18, 2024

This is a real issue and I have made a fix to this for an older version of the application.
Please refer to my Discord post @ https://discord.com/channels/844358207018893323/844358207018893326/874340558796103751

from udemy-downloader.

mahdisky avatar mahdisky commented on May 18, 2024

I using vpn but its not work

from udemy-downloader.

gyurix avatar gyurix commented on May 18, 2024

Using or not using VPN won't change anything, unless you have a bad quality VPN (like a free VPN shared between a bunch of people or something like that). However for safety reasons I would suggest using the same IP for the downloader script as your IP was when you logged in to Udemy and ideally also changing the user-agent in the script to the exact same one as your browser.

from udemy-downloader.

mahdisky avatar mahdisky commented on May 18, 2024

how i to change user-agent in scripts?

from udemy-downloader.

gyurix avatar gyurix commented on May 18, 2024

https://github.com/Puyodead1/udemy-downloader/blob/master/main.py#L30 change this line after downloading the project

from udemy-downloader.

mahdisky avatar mahdisky commented on May 18, 2024

i done it but its not work again

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

Using or not using VPN won't change anything, unless you have a bad quality VPN (like a free VPN shared between a bunch of people or something like that). However for safety reasons I would suggest using the same IP for the downloader script as your IP was when you logged in to Udemy and ideally also changing the user-agent in the script to the exact same one as your browser.

forgot that was for 4xx errors, thought it was 5xx for some reason. I'll go ahead and add your fix.

from udemy-downloader.

0x2f0713 avatar 0x2f0713 commented on May 18, 2024

This error raise again

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

This error raise again

Are you using the latest version of the utility?

from udemy-downloader.

0x2f0713 avatar 0x2f0713 commented on May 18, 2024

This error raise again

Are you using the latest version of the utility?

Yes, I just clone this repo

from udemy-downloader.

atakurt034 avatar atakurt034 commented on May 18, 2024

Yeah apparently they have updated it. I've tried to login and then logout of Udemy with vpn's and without and the bearer token now remains the same.

from udemy-downloader.

johnny-aras avatar johnny-aras commented on May 18, 2024

I have the same error with an aditional message:
403 Forbidden, retrying (attempt 9 )...
Udemy Says: 'NoneType' object has no attribute 'json' on https://www.udemy.com/api-2.0/users/me/subscribed-courses?fields[course]=id,url,title,published_title&page=1&page_size=500&search=URL-to-the-specific-course
I appreciate so much if someone has a solution. Thanks in advanced.

from udemy-downloader.

Zeddex avatar Zeddex commented on May 18, 2024

I have the same issue. Using the same IP to login and run the script

from udemy-downloader.

xatsuriyo avatar xatsuriyo commented on May 18, 2024

Looks like something change within Udemy API
got the error
error-udemy-downloader

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

Just tested myself and am getting this error also, I will see if I can find out why

from udemy-downloader.

rvipinkumar avatar rvipinkumar commented on May 18, 2024

I am getting a 502 Bad gateway error as well. Is it same as above? Any possible solution for it?

Capture

from udemy-downloader.

rvipinkumar avatar rvipinkumar commented on May 18, 2024

Hello @Puyodead1, any updates on the errors?

from udemy-downloader.

tcortega avatar tcortega commented on May 18, 2024

I've found a solution - use https://www.udemy.com/course-name/ instead of https://www.udemy.com/course/course-name/

Seems to work as a temporary fix until someone finds a way to bypass the cf cookies. Selenium is the way @Puyodead1

from udemy-downloader.

jbauer2016 avatar jbauer2016 commented on May 18, 2024

How do you avoid the DRM problem?

Chapter(s) (16)
Lecture(s) (39)
======= Processing chapter 1 of 16 =======

Processing lecture 1 of 39
001 Introduction.mp4
> Lecture '001 Introduction' is already downloaded, skipping...
======= Processing chapter 2 of 16 =======
Processing lecture 2 of 39
001 Introuction.mp4
> Lecture '001 SAP Introuction' has DRM, attempting to download
Downloading Lecture Tracks...
Traceback (most recent call last):
File "C:\Users\usuario\Downloads\udemy-downloader-master\main.py", line 1730, in
parse_new(_udemy, quality, skip_lectures, dl_assets, dl_captions,
File "C:\Users\usuario\Downloads\udemy-downloader-master\main.py", line 1152, in parse_new
process_lecture(lecture, lecture_path, lecture_file_name,
File "C:\Users\usuario\Downloads\udemy-downloader-master\main.py", line 1040, in process_lecture
handle_segments(source.get("download_url"),
File "C:\Users\usuario\Downloads\udemy-downloader-master\main.py", line 869, in handle_segments
ret_code = subprocess.Popen([
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

C:\Users\usuario\Downloads\udemy-downloader-master>

@Zeddex works but DRM fail...help me?

Thanks

from udemy-downloader.

jbauer2016 avatar jbauer2016 commented on May 18, 2024

@Zeddex perfect but this error ...

File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

Can I be missing a new library in windows 10?

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

@Zeddex perfect but this error ...

File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in init

self._execute_child(args, executable, preexec_fn, close_fds,

File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child

hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

Can I be missing a new library in windows 10?

I'm going to assume you didn't read the readme and that you didn't rename the keyfile. Idk, python isnt my primary language so I'm not as familiar with it.

from udemy-downloader.

jbauer2016 avatar jbauer2016 commented on May 18, 2024

@rvipinkumar perfect

Although I have the keyid and the key, something keeps failing me, but I'll take it out

Thanks

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

Seems this issue has popped up again and the workaround mentioned above is no longer working, I looked into this and the issue is now caused by a Clouflare hCaptcha being displayed. I am not able to bypass this even when trying to use browser automation such as selenium. At this time, there is no solution to this.

from udemy-downloader.

mahdisky avatar mahdisky commented on May 18, 2024

i have this issue too,
now all users have this issue or some users?

from udemy-downloader.

cyanide-aoe2 avatar cyanide-aoe2 commented on May 18, 2024

Have the issue as well. Finally got around to setting this up and bam.

from udemy-downloader.

gauravkhadgi avatar gauravkhadgi commented on May 18, 2024

@mahdisky I think so. Udemy probably upgraded their security.

from udemy-downloader.

gauravkhadgi avatar gauravkhadgi commented on May 18, 2024

@Puyodead1 Did you find any solution?

from udemy-downloader.

cyanide-aoe2 avatar cyanide-aoe2 commented on May 18, 2024

yt-dlp is failing. check their repo as well.

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

@Puyodead1 Did you find any solution?

If I had, I would have made a comment here.

from udemy-downloader.

MrWWheat avatar MrWWheat commented on May 18, 2024

Same issue here

Error fetching MPD streams: 'ERROR: [generic] Unable to download webpage: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.'
Processing 5 of 118```

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

That's related to yt-dlp, the only way to fix that issue is to edit yt-dlp util.py and commenting out the user agent header. I'll most likely be making a fork of yt-dlp

from udemy-downloader.

barepixels avatar barepixels commented on May 18, 2024

I started to get 403 errors last few days from Udemy
I am guessing it's because the .mpds are stored on their CDN and or captcha

So I downloaded the .mpd file using Chrome's inspector >network>filter for mpd files
Then I upload the .mpd to my own web server and change "mpd_url" in the keys.json file. The keys.json file came from widevine-l3-guesser and is required for widevine-L3-WEB-DL-Script.

And it works using widevine-L3-WEB-DL-Script

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

Can anyone find a solution?

A solution has already been found and an update was already pushed

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

Closing this now, will reopen if the issue comes back

from udemy-downloader.

amaillo-mc avatar amaillo-mc commented on May 18, 2024

Can anyone find a solution?

What Puyodead1 said here: #47 (comment) woks for me.

What I've done was:

  1. pip uninstall yt-dlp
  2. git clone yt-dlp
  3. edit master/yt_dlp/utils.py and remove line 1680 ('User-Agent': random_user_agent(),)
  4. compile and install following https://github.com/yt-dlp/yt-dlp#compile

Then udemy-downloader works like a charm.
Hope this helps.

from udemy-downloader.

booshveg avatar booshveg commented on May 18, 2024

I try this branch 5d60bfe1ce, but still have got this error.

from udemy-downloader.

Puyodead1 avatar Puyodead1 commented on May 18, 2024

I try this branch 5d60bfe1ce, but still have got this error.

did you edit yt-dlp as instructed?

from udemy-downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.