Udemy-dl: unable to get course ID "NoneType' object has no attribute 'group'"

Created on 6 Dec 2017  Â·  14Comments  Â·  Source: r0oth3x49/udemy-dl

Traceback (most recent call last):
File "udemy-dl.py", line 896, in
main()
File "udemy-dl.py", line 569, in main
udemy.ExtractAndDownload()
File "udemy-dl.py", line 286, in ExtractAndDownload
videos_dict = self.clean_dict(extract_info.real_extract(self.url, course_name, course_path))
File "/home/ec2-user/udemy-dl/udemy/_extractor.py", line 221, in real_extract
course_id = self._regex_course_id(url)
File "/home/ec2-user/udemy-dl/udemy/_extractor.py", line 137, in _regex_course_id
course_id = unescapeHTML(_search_simple_regex(r'(?<="id":\s)(\d+)',webpage).group())
AttributeError: 'NoneType' object has no attribute 'group'

All 14 comments

@psarz which course are you trying to download i did tried against this free course https://www.udemy.com/learn-ruby-on-rails-from-scratch/ it works like charm. so i need a bit explanation.

@r0oth3x49 , I am not even able to download the free course, i.e.https://www.udemy.com/learn-ruby-on-rails-from-scratch/.

File "/home/ec2-user/udemy-dl/udemy/_extractor.py", line 137, in _regex_course_id
course_id = unescapeHTML(_search_simple_regex(r'(?<="id":\s)(\d+)',webpage).group())
AttributeError: 'NoneType' object has no attribute 'group'

as per the stackoverflow link attached below expression contains non-latin characters, so it usually fails. might need decode into Unicode.

https://stackoverflow.com/questions/15232832/python-regex-attributeerror-nonetype-object-has-no-attribute-groups

I am just a beginner, hope this help you to fix my issue.

Thanks a lot for reply.

@psarz how can i reproduce this error? i have checked the code it works perfectly on Windows 8.1/8/7, Mac, Linux. i cannot add the fix until i can reproduce this error. and one more thing i have added two methods to extract the course id if some how it fails with one should extract with other,

Traceback (most recent call last):
File "udemy-dl.py", line 898, in
main()
File "udemy-dl.py", line 688, in main
udemy.ExtractAndDownload()
File "udemy-dl.py", line 288, in ExtractAndDownload
videos_dict = self.clean_dict(extract_info.real_extract(self.url, course_name, course_path))
File "/home/psarz/udemy-dl/udemy/_extractor.py", line 226, in real_extract
num_lect = int(self._lecture_count(response))
File "/home/psarz/udemy-dl/udemy/_extractor.py", line 177, in _lecture_count
for entry in response['results']:
KeyError: 'results'

Not working :|

@psarz i don't know why you are facing such kind of weird errors. for me it works fine i cannot reproduce so i will w8 for more reports from others no solution for this yet.

This error happens on login for me

[INFO-133] Trying to log in ...
[ERROR-61] Exception
Traceback (most recent call last):
  File "/usr/local/bin/udemy-dl", line 7, in <module>
    main()
  File "/usr/local/lib/python2.7/site-packages/udemy_dl/udemy_dl.py", line 947, in main
    save_links, safe_file_names, just_list, output_dest, dir_use_course_title)
  File "/usr/local/lib/python2.7/site-packages/udemy_dl/udemy_dl.py", line 744, in udemy_dl
    login(username, password)
  File "/usr/local/lib/python2.7/site-packages/udemy_dl/udemy_dl.py", line 134, in login
    csrf_token = get_csrf_token()
  File "/usr/local/lib/python2.7/site-packages/udemy_dl/udemy_dl.py", line 128, in get_csrf_token
    return match.group(1)
AttributeError: 'NoneType' object has no attribute 'group'

udemy-dl is up to date. the course is bought (I only download courses I have bought, because I don't have the kind of internet to stream hd videos)

Same problem on login on windows 7.

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

same issue. Has anyone found the solution?
screenshot at 2018-04-06 15-27-39

What version are you using? Try with the latest on GitHub.

El vie., 6 de abr. de 2018 7:36 AM, Anthony Muna notifications@github.com
escribió:

same issue. Has anyone found the solution?

[image: screenshot at 2018-04-06 15-27-39]
https://user-images.githubusercontent.com/20999541/38421531-1bf56222-39b0-11e8-83df-a004530d2148.png

—

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/r0oth3x49/udemy-dl/issues/40#issuecomment-379239902,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAF6H6PJSQOsooQlY-SN_YjX5E_BgR5Pks5tl2E6gaJpZM4Q3RMl
.

Am using the latest version 0.2.2a2.

On Friday, April 6, 2018, Aldo notifications@github.com wrote:

What version are you using? Try with the latest on GitHub.

El vie., 6 de abr. de 2018 7:36 AM, Anthony Muna >
escribió:

same issue. Has anyone found the solution?

[image: screenshot at 2018-04-06 15-27-39]
39b0-11e8-83df-a004530d2148.png>

—

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/r0oth3x49/udemy-dl/issues/40#issuecomment-379239902
,
or mute the thread
YjX5E_BgR5Pks5tl2E6gaJpZM4Q3RMl>
.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/r0oth3x49/udemy-dl/issues/40#issuecomment-379252984,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUBtdch2ocx_zadno76G23RdDlPXjR5Zks5tl21MgaJpZM4Q3RMl
.

Guys..
It's working for me.

I think the problem because of permission issue in my linux vm.

Try to configure it using root and then switch back to normal user.

Best,
Psarz

On Fri, 6 Apr 2018, 18:57 Aldo, notifications@github.com wrote:

What version are you using? Try with the latest on GitHub.

El vie., 6 de abr. de 2018 7:36 AM, Anthony Muna >
escribió:

same issue. Has anyone found the solution?

[image: screenshot at 2018-04-06 15-27-39]
<
https://user-images.githubusercontent.com/20999541/38421531-1bf56222-39b0-11e8-83df-a004530d2148.png

—

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/r0oth3x49/udemy-dl/issues/40#issuecomment-379239902
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AAF6H6PJSQOsooQlY-SN_YjX5E_BgR5Pks5tl2E6gaJpZM4Q3RMl

.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/r0oth3x49/udemy-dl/issues/40#issuecomment-379252984,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AOci_E37pEZsaj02c2EER93ms_4LQ7_Xks5tl21MgaJpZM4Q3RMl
.

You may be installing the wrong udemy-dl

This package is installed via:
git clone https://github.com/r0oth3x49/udemy-dl.git

If you are installing
pip install udemy-dl
That package has the noted problem and no fancy GUI in the cli.

Hi Babazon,
Now I can download my courses from udemy.
I used to use UDEMY-DL.EXE and I experienced problems as mentioned by others.
So, thanks for showing this link: git clone https://github.com/r0oth3x49/udemy-dl.git

I suggest any one to check this link: https://github.com/r0oth3x49/udemy-dl
to get this: git clone https://github.com/r0oth3x49/udemy-dl.git)

Here is the image that I made it.
udemy-dl

@r0oth3x49 I am getting "403 Unauthorized retry after few minutes ..." error during login. Please do the needful.
udemy_download

Was this page helpful?
0 / 5 - 0 ratings