r0oth3x49 / udemy-dl

A cross-platform python based utility to download courses from udemy for personal offline use.
MIT License
4.86k stars 1.2k forks source link

Support for Udemy for Business #28

Closed jman69 closed 7 years ago

jman69 commented 7 years ago

Any plans to include support for Udemy for Business accounts? Each business has it's own unique URL i.e. https://mybusiness.udemy.com and the login page URLs are slightly different. I'm not a developer but I've tried to modify the code myself with a find & replace but obviously there's more to it than that. I've included the error I got when trying below with the latest version of code (username and password are in the configuration file not in the command):

host2:~/udemy-dl# python udemy-dl.py https://mybusiness.udemy.com/learn-how-to-code/

              __                               ____
   __  ______/ /__  ____ ___  __  __      ____/ / /
  / / / / __  / _ \/ __ `__ \/ / / /_____/ __  / /
 / /_/ / /_/ /  __/ / / / / / /_/ /_____/ /_/ / /
 \__,_/\__,_/\___/_/ /_/ /_/\__, /      \__,_/_/
                           /____/
                                 Version : 0.3
                                 Author  : Nasir khan(r0ot h3x49)
                                 Visit   : https://github.com/r0oth3x49

[*] : Using cached configurations..
[*] : Downloading webpage..
[*] : Extracting course information..
[*] : Downloading 'learn how to code'.
Traceback (most recent call last):
  File "/root/udemy-dl/udemy/_extractor.py", line 69, in _get_csrf_token
    return match.group(1)
AttributeError: 'NoneType' object has no attribute 'group'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "udemy-dl.py", line 893, in <module>
    main()
  File "udemy-dl.py", line 566, in main
    udemy.ExtractAndDownload()
  File "udemy-dl.py", line 280, in ExtractAndDownload
    self.login()
  File "udemy-dl.py", line 39, in login
    extract_info.login(self.username, self.password)
  File "/root/udemy-dl/udemy/_extractor.py", line 101, in login
    csrf_token = self._get_csrf_token()
  File "/root/udemy-dl/udemy/_extractor.py", line 72, in _get_csrf_token
    return match.group(1)
AttributeError: 'NoneType' object has no attribute 'group'
r0oth3x49 commented 7 years ago

@jman69 currently i don't have any account. so this is out of scope & i 'm closing the issue.

Update

@jman69 i have tested this against one of friends udemy business account and it works perfectly and download courses which is available in that organization's account.