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

TypeError: unbound method __init__() must be called with Downloader instance as first argument (got InternUdemyLectureAssets instance instead) #429

Closed EnoqueEsteves closed 5 years ago

EnoqueEsteves commented 5 years ago

Describe the bug This has only recently started to happen when using the udemy-dl.py to download a course. This happens on both an update to an already downloaded course as well as downloading a new one.

To Reproduce Steps to reproduce the behavior:

  1. udemy course url:

    • https://www.udemy.com/course/the-complete-ios-developer-course-with-swift (first time downlad),
    • https://www.udemy.com/learn-devops-the-complete-kubernetes-course (previously downloaded url)
  2. Run the following command to reproduce the error.

    ./udemy-dl.py "https://www.udemy.com/course/the-complete-ios-developer-course-with-swift" -k ./authcookie.txt -o ~/udemy_downloads/
  3. See error:

                  __                               ____
      __  ______/ /__  ____ ___  __  __      ____/ / /
      / / / / __  / _ \/ __ `__ \/ / / /_____/ __  / /
    / /_/ / /_/ /  __/ / / / / / /_/ /_____/ /_/ / /
    \__,_/\__,_/\___/_/ /_/ /_/\__, /      \__,_/_/
                              /____/
                                    Version : 0.5
                                    Author  : Nasir Khan (r0ot h3x49)
                                    Github  : https://github.com/r0oth3x49
    
    [*] : Trying to login using cookies ...
    [+] : Logged in successfully.
    [*] : Downloaded course information .. (done)
    [*] : Trying to logout now...
    [+] : Logged out successfully.
    [*] : Course 'the-complete-ios-developer-course-with-swift'.
    [+] : Chapter(s) (26).
    [*] : Lecture(s) (299).
    
    [*] : Downloading chapter : (1 of 26)
    [+] : Chapter (01 Introduction)
    [*] : Found (2) lectures ...
    
    [*] : Lecture(s) : (1 of 2)
    [*] : Downloading (001 Introduction)
    [*] : 48.43MB/48.43MB 100.00% |##############################| 8.64MB/s
    [+] : Downloaded  (001 Introduction)
    
    [*] : Downloading subtitle(s)
    [*] : Downloading (001 Introduction-en)
    [*] : 2.54KB/2.54KB 100.00% |##############################| 30.44kB/s
    [+] : Downloaded  (001 Introduction-en)
    Traceback (most recent call last):
      File "./udemy-dl.py", line 1432, in <module>
        main()
      File "./udemy-dl.py", line 1091, in main
        udemy.course_download(path=options.output, quality=options.quality, unsafe=options.unsafe)
      File "./udemy-dl.py", line 467, in course_download
        lecture_assets = lecture.assets
      File "/mnt/g/udemy-downloader/udemy-dl/udemy/_shared.py", line 341, in assets
        self._process_assets()
      File "/mnt/g/udemy-downloader/udemy-dl/udemy/_internal.py", line 119, in _process_assets
        assets  =   [InternUdemyLectureAssets(z, self) for z in self._info['assets']] if self._assets_count > 0 else []
      File "/mnt/g/udemy-downloader/udemy-dl/udemy/_internal.py", line 143, in __init__
        super(InternUdemyLectureAssets, self).__init__(parent)
      File "/mnt/g/udemy-downloader/udemy-dl/udemy/_shared.py", line 521, in __init__
        Downloader.__init__(self)
    TypeError: unbound method __init__() must be called with Downloader instance as first argument (got InternUdemyLectureAssets instance instead)

Expected behavior Successfully downloads the content both for new and previously downloaded courses

Screenshots n/a see error out put

Python Environment (please complete the following information):

Additional context Has been working correctly for the last 6 months. The previous time it was run was 1 week prior to it failing. I also did a recent git pull as well as a sudo apt update && sudo apt upgrade to see if that resolved the issue but it did not help.

r0oth3x49 commented 5 years ago

@EnoqueEsteves need more explanation see the issue reporting template, i have just added

EnoqueEsteves commented 5 years ago

@r0oth3x49 - apologies I have updated the issue following you template. Let us know if you require any further information or clarification.

r0oth3x49 commented 5 years ago

@EnoqueEsteves r you using the recent master because this error is i guess already reported and i have fixed take a look at #428 .

clone the recent maste and let me know.

EnoqueEsteves commented 5 years ago

@r0oth3x49 - I have just kicked it off and it appears to be working now. Once the run finishes with no issue I will let you know.

r0oth3x49 commented 5 years ago

@r0oth3x49 - I have just kicked it off and it appears to be working now. Once the run finishes with no issue I will let you know.

you could just run it against that particular chapter containing assets information ..

EnoqueEsteves commented 5 years ago

It has has passed the point at which it was failing previously so all looking good so far

EnoqueEsteves commented 5 years ago

Yup all good. you can close this issue as I do believe it is resolved by the earlier fix