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

Unsupported typenames #3

Open
abachdoc opened this issue Jul 12, 2023 · 4 comments
Open

Unsupported typenames #3

abachdoc opened this issue Jul 12, 2023 · 4 comments

Comments

@abachdoc
Copy link

abachdoc commented Jul 12, 2023

Describe the bug
Jupyter notebooks not downloading and other assets not downloading. There are unsupported typenames:
-Unsupported typename "ungradedWidget" in lecture "reading-getting-started-with-the-model-asset-exchange-and-the-data-asset"
-Unsupported typename "ungradedLti" in lecture "hands-on-lab-getting-started-with-jupyter-notebooks"
-Unsupported typename "staffGraded" in lecture "final-exam

To Reproduce
cs-dlp -ca YOURCAUTH open-source-tools-for-data-science (--download-notebooks included in conf file)

Expected behavior
Jupyter notebooks and other assets download.

@fsixto
Copy link

fsixto commented Jul 24, 2023

Describe the bug Jupyter notebooks not downloading and other assets not downloading. There are unsupported typenames: -Unsupported typename "ungradedWidget" in lecture "reading-getting-started-with-the-model-asset-exchange-and-the-data-asset" -Unsupported typename "ungradedLti" in lecture "hands-on-lab-getting-started-with-jupyter-notebooks" -Unsupported typename "staffGraded" in lecture "final-exam

To Reproduce cs-dlp -ca YOURCAUTH open-source-tools-for-data-science (--download-notebooks included in conf file)

Expected behavior Jupyter notebooks and other assets download.

Good description of the issue, I just experimented the same thing with the jupyter notebooks!

@arnaud-feldmann
Copy link

Same for me.
image

@theotherp
Copy link

I got this far:

    def extract_links_from_lab(self, lecture_id, class_id):
        try:
            ONDEMAND_LAB = "https://www.coursera.org/api/onDemandLearnerWorkspaces.v1/?action=launch&id={user_id}~{class_id}~{lab_id}"

            headers = self._auth_headers_with_json()
            reply = get_page(
                self._session,
                ONDEMAND_LAB,
                json=True,
                post=True,
                data="{}",
                user_id=self._user_id,
                class_id=class_id,
                lab_id=lecture_id,
                headers=headers
            )
            launch_url = reply["launchUrl"]
            workspace_id = reply["workspaceId"]
            notebook_name = re.match(".*notebooks%2F([^&]+).*", launch_url).group(1)
            download_url = f"https://{workspace_id}.labs.coursera.org/nbconvert/notebook/{notebook_name}?download=true"

            # At this point downloading the download_url will download an HTML page because a token is missing
            # I've found the cookie COURSERA_SUBMISSION_TOKEN but don't know if it's important and how to get it

            return {"ipynb": [(download_url, '')]}
        except requests.exceptions.HTTPError as exception:
            logging.error('Could not download notebook %s: %s',
                          lecture_id, exception)
            if is_debug_run():
                logging.exception(
                    'Could not download notebook %s: %s', lecture_id, exception)
            return None

But I'm stuck at the download URL. Opening it in the browser works but downloading in cs-dlp results in an HTML page that says "Generating token".

@zeushera140
Copy link

any solutions? I can download the notebooks manually, but cs-dlp no longer works.

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

No branches or pull requests

5 participants