debakarr / kodekloud-downloader

Simple downloaded for https://kodekloud.com/
136 stars 43 forks source link

Getting Unauthorized for url while downloading #68

Open rahulgamezop opened 6 days ago

rahulgamezop commented 6 days ago

I am getting this error every time after downloading some files

Traceback (most recent call last):
  File "/usr/local/bin/kodekloud", line 8, in <module>
    sys.exit(kodekloud())
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/kodekloud_downloader/cli.py", line 69, in dl
    download_course(
  File "/usr/local/lib/python3.10/dist-packages/kodekloud_downloader/main.py", line 145, in download_course
    response.raise_for_status()
  File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://learn-api.kodekloud.com/api/lessons/4fa712b1-8c9c-458c-92d2-f3973b91b798?course_id=14863046-8679-403e-98f9-d24de464f3e5
amitfegade121 commented 5 days ago

Your cookie is expired. Re-generate it.

Fasibcs commented 5 days ago

Getting the same issue, regenerate cookie is not helping either.

Fasibcs commented 5 days ago

If anyone has found the issue and is helping it resolved would be appreciated.

rahulgamezop commented 5 days ago

regenerate and replacing cookie works for me but the issue is new cookie also expired before downloading full course. Is there any solution that I can resume downloading from the point where it failed. Due to this I am not able to download the full course and after replacing the cookie it starts from the beginning.

ivan-n20 commented 4 days ago

Getting the same issue, regenerate cookie is not helping either.

Try using a new temporary email and generate cookie. Seemed to work for me when regenerating did not work.