Udemy-dl: TypeError: unbound method __init__() must be called with Downloader instance as first argument (got InternUdemyLectureAssets instance instead)

Created on 11 Sep 2019  路  7Comments  路  Source: r0oth3x49/udemy-dl

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)
  1. 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/
    
  2. 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):

  • OS Platform: Ubuntu 18.04 (on Windows 10 WSL)
  • Python Version 2.7.15+ (default, Jul 9 2019, 16:51:35), [GCC 7.4.0]

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.

All 7 comments

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

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

@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.

@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 - 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 ..

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TechieGenie picture TechieGenie  路  10Comments

thedtech picture thedtech  路  7Comments

vivekpanchal picture vivekpanchal  路  8Comments

Puyodead1 picture Puyodead1  路  8Comments

ipkpjersi picture ipkpjersi  路  5Comments