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

Coursera - API Route Does Not Exist #849

Open
satyasaadhak opened this issue Apr 25, 2023 · 5 comments
Open

Coursera - API Route Does Not Exist #849

satyasaadhak opened this issue Apr 25, 2023 · 5 comments

Comments

@satyasaadhak
Copy link

Coursera - API Route Does Not Exist

When executing the download command using the CAUTH method

coursera-dl -ca <CAUTH> software-engineering-modeling-software-systems-using-uml

i get this output

coursera_dl version 0.11.5
Downloading class: software-engineering-modeling-software-systems-using-uml (1 / 1)
Parsing syllabus of on-demand course (id=MnCCTwojEey5zQ4LqE3elQ). This may take some time, please be patient ...
Error 404 Client Error: Not Found for url: https://api.coursera.org/api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true getting page https://api.coursera.org/api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true
The server replied: <html>
        <head>
                <title>Coursera - API Route Does Not Exist</title>
        </head>
        <body style="background-color:#e4e4e4">
                <div style="position:absolute; top:0; bottom:0; left:0; right:0; margin:auto; height:200px; width: 600px">
                        <div style="text-align:center">
                                <img src="https://s3.amazonaws.com/coursera/error_pages/coursera-logo.svg" width="400">
                        </div>
                        <h1 style="text-align:center; font-family:Helvetica, Arial, sans-serif; font-weight:100; color: #555">
                                API Route Does Not Exist
                        </h1>
                        <div style="text-align:center; font-family:Helvetica, Arial, sans-serif; font-weight:300; font-size:13pt; color: #555">
                                Edge does not know about this API route. <br>
                                Check whether this route is exposed in the routing table.
                        </div>
                </div>
        </body>
</html>
HTTPError 404 Client Error: Not Found for url: https://api.coursera.org/api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true

Your environment

  • Operating System (Windows/11):
  • Python version: 3.11.3
  • coursera-dl version: 0.11.5

Steps to reproduce

Tell us how to reproduce this issue, please don't forget to include
enough information so that you can help us help you:

  • Is the problem happening with the latest version of the script? Yes

  • Do you have all the recommended versions of the modules? See them in the
    file requirements.txt. Yes

  • What is the course that you are trying to access? https://www.coursera.org/learn/software-engineering-modeling-software-systems-using-uml

  • What is the precise command line that you are using (don't forget to obfuscate
    your username and password, but leave all other information untouched).
    `coursera-dl -ca software-engineering-modeling-software-systems-using-uml

  • What are the precise messages that you get? Please, use the --debug
    option before posting the messages as a bug report. Please, copy and paste
    them. Don't reword/paraphrase the messages.

    root[main] coursera_dl version 0.11.5
    

root[main] Downloading class: software-engineering-modeling-software-systems-using-uml (1 / 1)
root[download_class] Downloading new style (on demand) class software-engineering-modeling-software-systems-using-uml
urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): api.coursera.org:443
urllib3.connectionpool[_make_request] https://api.coursera.org:443 "GET /api/onDemandCourseMaterials.v2/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=modules%2Clessons%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2Citems%2Ctracks%2CgradePolicy&&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional%2ClearningObjectives)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight%2CisRequiredForPassing)%2ConDemandCourseMaterialItems.v2(name%2Cslug%2CtimeCommitment%2CcontentSummary%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId%2ClockedStatus%2CitemLockSummary)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true HTTP/1.1" 200 None
root[_get_on_demand_syllabus] Downloaded https://api.coursera.org/api/onDemandCourseMaterials.v2/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=modules%2Clessons%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2Citems%2Ctracks%2CgradePolicy&&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional%2ClearningObjectives)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight%2CisRequiredForPassing)%2ConDemandCourseMaterialItems.v2(name%2Cslug%2CtimeCommitment%2CcontentSummary%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId%2ClockedStatus%2CitemLockSummary)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true (24468 bytes)
root[_parse_on_demand_syllabus] Parsing syllabus of on-demand course (id=MnCCTwojEey5zQ4LqE3elQ). This may take some time, please be patient ...
urllib3.connectionpool[_make_request] https://api.coursera.org:443 "GET /api/memberships.v1?includes=courseId,courses.v1&q=me&showHidden=true&filter=current,preEnrolled HTTP/1.1" 200 None
urllib3.connectionpool[_make_request] https://api.coursera.org:443 "GET /api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true HTTP/1.1" 404 428
root[get_reply] Error 404 Client Error: Not Found for url: https://api.coursera.org/api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true getting page https://api.coursera.org/api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true
root[get_reply] The server replied:

<title>Coursera - API Route Does Not Exist</title>







API Route Does Not Exist



Edge does not know about this API route.

Check whether this route is exposed in the routing table.


root[main] HTTPError 404 Client Error: Not Found for url: https://api.coursera.org/api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true root[main] HTTPError 404 Client Error: Not Found for url: https://api.coursera.org/api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true Traceback (most recent call last): File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\coursera_dl.py", line 247, in main error_occurred, completed = download_class( ^^^^^^^^^^^^^^^ File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\coursera_dl.py", line 214, in download_class return download_on_demand_class(session, args, class_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\coursera_dl.py", line 134, in download_on_demand_class error_occurred, modules = extractor.get_modules( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\extractors.py", line 53, in get_modules error_occurred, modules = self._parse_on_demand_syllabus( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\extractors.py", line 105, in _parse_on_demand_syllabus ondemand_material_items = OnDemandCourseMaterialItemsV1.create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\api.py", line 318, in create dom = get_page(session, OPENCOURSE_ONDEMAND_COURSE_MATERIALS, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\network.py", line 91, in get_page reply = get_reply(session, url, post=post, data=data, headers=headers, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\coursera\network.py", line 51, in get_reply reply.raise_for_status() File "C:\Users\ideep\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.coursera.org/api/onDemandCourseMaterials.v1/?q=slug&slug=software-engineering-modeling-software-systems-using-uml&includes=moduleIds%2ClessonIds%2CpassableItemGroups%2CpassableItemGroupChoices%2CpassableLessonElements%2CitemIds%2Ctracks&fields=moduleIds%2ConDemandCourseMaterialModules.v1(name%2Cslug%2Cdescription%2CtimeCommitment%2ClessonIds%2Coptional)%2ConDemandCourseMaterialLessons.v1(name%2Cslug%2CtimeCommitment%2CelementIds%2Coptional%2CtrackId)%2ConDemandCourseMaterialPassableItemGroups.v1(requiredPassedCount%2CpassableItemGroupChoiceIds%2CtrackId)%2ConDemandCourseMaterialPassableItemGroupChoices.v1(name%2Cdescription%2CitemIds)%2ConDemandCourseMaterialPassableLessonElements.v1(gradingWeight)%2ConDemandCourseMaterialItems.v1(name%2Cslug%2CtimeCommitment%2Ccontent%2CisLocked%2ClockableByItem%2CitemLockedReasonCode%2CtrackId)%2ConDemandCourseMaterialTracks.v1(passablesCount)&showLockedItems=true ```
@Corrado-t
Copy link

The issue were already fixed here:
#834
I had the same and resolved following the steps

@manojkumarhr
Copy link

hi @satyasaadhak @satyasaadhak ,
I am also facing the issue I have followed all the steps which are suggested by @Corrado-t but I am getting the error. Please help me
cousera course

@iitjee
Copy link

iitjee commented May 6, 2023

@manojkumarhr
Do this:

pip3 uninstall coursera-dl
git clone https://github.com/raffaem/coursera-dl
cd coursera-dl
pip3 install .

Have a nice day!

@stevenwscss
Copy link

@iitjee
I used Raffaem a few months ago and it worked perfectly. But it doesn't work now.

@marcolussetti
Copy link

@manojkumarhr Do this:

pip3 uninstall coursera-dl git clone https://github.com/raffaem/coursera-dl cd coursera-dl pip3 install .

Have a nice day!

Working beautifully!

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

6 participants