datacamp-downloader icon indicating copy to clipboard operation
datacamp-downloader copied to clipboard

JSON no longer has 'has_active_subscription' field

Open jorritvm opened this issue 2 years ago • 3 comments

Current build will crash due to datacamp no longer providing this JSON field. Removing that check from the set_profile method fixes things. There seems to be no clear substitute key, apart maybe from the key indicating if the user is on his first trial week.

https://github.com/TRoboto/datacamp-downloader/blob/cc04f1ffabeb7f1e828db6c5d0d177dfc905df31/src/datacamp_downloader/datacamp_utils.py#L486

jorritvm avatar Feb 11 '24 15:02 jorritvm

There is a key called active_products. That might be a good substitute.

Ben-0-mad avatar Feb 29 '24 12:02 Ben-0-mad

can someone please help me with the "has_active_subscription" error

AbhijeetRoy2107 avatar Mar 23 '24 04:03 AbhijeetRoy2107

@AbhijeetRoy2107 A very dirty way of solving it is by removing the following lines from datacamp_utils.py file:

        if data["has_active_subscription"]:
            Logger.info("Active subscription found")
        else:
            Logger.warning("No active subscription found")

And changing

self.has_active_subscription = data["has_active_subscription"]

to

self.has_active_subscription = True

psyguy avatar Mar 16 '25 14:03 psyguy