Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of courses not available - "profile is private" #46

Closed
jorritvm opened this issue Dec 3, 2021 · 2 comments · Fixed by #47
Closed

List of courses not available - "profile is private" #46

jorritvm opened this issue Dec 3, 2021 · 2 comments · Fixed by #47

Comments

@jorritvm
Copy link

jorritvm commented Dec 3, 2021

I think the guys at datacamp must have updated their website, as I am now getting an error while listing courses:

First I set up my token, which works fine. Output is:

INFO: Hi, Jorrit
INFO: Active subscription found

However, then when attempting to read courses the selenium window shows a "profile is private" before closing and Python crashes (stack below).

D:\dev\python\datacamp_downloader_31\.venv\Scripts>datacamp courses
+--------+------------------------------------------+------------+------------+------------+
| ID     | Title                                    | Datasets   | Exercises  | Videos     |
+--------+------------------------------------------+------------+------------+------------+
Please wait |Traceback (most recent call last):
  File "C:\Program Files\Python38\lib\runpy.py", line 194, in _run_module_as_main
Please wait /    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\dev\python\datacamp_downloader_31\.venv\Scripts\datacamp.exe\__main__.py", line 7, in <module>
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\typer\main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\typer\main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\datacamp_downloader\downloader.py", line 67, in courses
    datacamp.list_completed_courses(refresh)
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\datacamp_downloader\datacamp_utils.py", line 44, in wrapper
    return f(*args, **kwargs)
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\datacamp_downloader\helper.py", line 72, in wrapper
    output = f(*args)
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\datacamp_downloader\datacamp_utils.py", line 181, in list_completed_courses
    for i, course in enumerate(self.get_completed_courses(refresh), 1):
  File "d:\dev\python\datacamp_downloader_31\.venv\lib\site-packages\datacamp_downloader\datacamp_utils.py", line 410, in get_completed_courses
    completed_courses = data["props"]["pageProps"]["completed_courses"]
KeyError: 'completed_courses'
@TRoboto
Copy link
Owner

TRoboto commented Dec 3, 2021

Thank you for reporting this. I've just created PR #47 to fix the issue. Would you mind checking if the PR really fixes the problem reported?

@TRoboto TRoboto linked a pull request Dec 3, 2021 that will close this issue
@jorritvm
Copy link
Author

jorritvm commented Dec 8, 2021

Hey, sorry for the delay,
I see you have already merged the fix. Just wanted to add that I tested it and it works without any bugs now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants