Udemy-dl: Bug cannot download Course

Created on 12 Feb 2018  Â·  16Comments  Â·  Source: r0oth3x49/udemy-dl

[-] Unable to extract login-form form Traceback (most recent call last): File "udemy-dl.py", line 924, in <module> main() File "udemy-dl.py", line 829, in main udemy.ExtractAndDownload() File "udemy-dl.py", line 291, in ExtractAndDownload self.login() File "udemy-dl.py", line 40, in login extract_info.login(self.username, self.password) File "D:\udemy-dl\udemy\_extractor.py", line 147, in login login_form = self._fill_login_form(login_popup, username, password) File "D:\udemy-dl\udemy\_extractor.py", line 98, in _fill_login_form login_form = self._form_hidden_inputs('login-form', webpage) File "D:\udemy-dl\udemy\_extractor.py", line 88, in _form_hidden_inputs return _hidden_inputs(form) File "D:\udemy-dl\udemy\_utils.py", line 80, in _hidden_inputs html = re.sub(r'<!--(?:(?!<!--).)*-->', '', html) File "C:\Python27\lib\re.py", line 155, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: expected string or buffer

iam using latest udemy-dl and installed all requirements...

duplicate

Most helpful comment

@trash-anger can you please explain a bit more?

@coder797 i already have given the solution in issue #98 and it works fine for me i have tested with py2 & py3 both on windows 7,windows 8.1, windows 10, mac osx 10.9.5.
have a look of windows 10 POC. it works fine.
capture

Steps to patch.

  • sudo pip install requests --upgrade
  • sudo pip install unidecode --upgrade
  • sudo pip install requests[security] --upgrade
  • done

i 'm closing this issue as duplicate now.

All 16 comments

Using windows 10 pro and python 2

Udemy has implemented a validation for automation tools.
the picture shows the html code that is returned of udemy when the udemy-dl tool tries to get the login form.
screenshot from 2018-02-12 09-36-44

I do not know what we need to do, but you can count on me to try to find a solution. My email is Linneu.[email protected].

The solution could be to encapsulate the script into a chrome extension to use the chrome's cookies and fingerprint ... ?

See if this solution was found at #98 . It worked for me.

@trash-anger can you please explain a bit more?

@coder797 i already have given the solution in issue #98 and it works fine for me i have tested with py2 & py3 both on windows 7,windows 8.1, windows 10, mac osx 10.9.5.
have a look of windows 10 POC. it works fine.
capture

Steps to patch.

  • sudo pip install requests --upgrade
  • sudo pip install unidecode --upgrade
  • sudo pip install requests[security] --upgrade
  • done

i 'm closing this issue as duplicate now.

It seams that udemy is trying to avoid users to download automatically a course by adding a captcha.

It would be a good idea to create a browser extension to rather than use a directly the python script and to replace std_headers by the user's real user-agent.

Doing this way, we maybe could distribute udemy-dl to a larger users population and we could especially use different fingerprints for each udemy-dl users.

And maybe using pyjs, it won't be to much work to do !

Thanks - solution did work for me.

@r0oth3x49 Hi those 3 pip commands didn't resolve the login issue in windows 7.
The same error message appears:

Trying to log in ...
Exception
Traceback (most recent call last):
File "udemy_dl.py", line 976, in module
File "udemy_dl.py", line 971, in main
File "udemy_dl.py", line 766, in udemy_dl
File "udemy_dl.py", line 156, in login
File "udemy_dl.py", line 150, in get_csrf_token
AttributeError: 'NoneType' object has no attribute 'group'
Failed to execute script udemy_dl

Today the download worked - udemy-dl logged in to udemy account & downloaded the course,.Don't know why it didn't work 10 days ago after the pip updates.

Try with this -> https://www.npmjs.com/package/udemy-dl

-> npm install -g udemy-dl
-> udl https://www.udemy.com/COURSE_NAME

its working with python 3

Today the download worked - udemy-dl logged in to udemy account & downloaded the course,.Don't know why it didn't work 10 days ago after the pip updates.

is it still working now ?

it is working but some time when some one tries to download things like a robot then udemy appears with the captcha. The solution for that is using cookie based method instead

Should i subscribe the course first? I've succeeded to download the
subscribed course but not for the course that i want to have it.

On Sat, Jan 25, 2020, 2:44 PM Nasir Khan notifications@github.com wrote:

it is working but some time when some one tries to download things like a
robot then udemy appears with the captcha. The solution for that is using
cookie based method instead

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/r0oth3x49/udemy-dl/issues/100?email_source=notifications&email_token=AD6HAT5QFB3FFKAGLLBS4U3Q7PUXBA5CNFSM4EQHVOIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ4XMZQ#issuecomment-578385510,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AD6HATZNIRMY3KPSLZJ2CV3Q7PUXBANCNFSM4EQHVOIA
.

it is working but some time when some one tries to download things like a robot then udemy appears with the captcha. The solution for that is using cookie based method instead

i've tried using cookie but it didnt work either
the 1st issue is can't enroll
the second is '403 porbidden'

I've sent you some emails

cant_enrol
porbidden

Should i subscribe the course first? I've succeeded to download the subscribed course but not for the course that i want to have it.
…
On Sat, Jan 25, 2020, 2:44 PM Nasir Khan @.*> wrote: it is working but some time when some one tries to download things like a robot then udemy appears with the captcha. The solution for that is using cookie based method instead — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#100?email_source=notifications&email_token=AD6HAT5QFB3FFKAGLLBS4U3Q7PUXBA5CNFSM4EQHVOIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ4XMZQ#issuecomment-578385510>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6HATZNIRMY3KPSLZJ2CV3Q7PUXBANCNFSM4EQHVOIA .

the tool will only download subscribed courses.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pppedrillo picture pppedrillo  Â·  10Comments

mynameismaxz picture mynameismaxz  Â·  6Comments

sagarsamrat3956 picture sagarsamrat3956  Â·  7Comments

serhattsnmz picture serhattsnmz  Â·  3Comments

SwapnilSoni1999 picture SwapnilSoni1999  Â·  7Comments