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

dl_coursera.define.CookiesExpiredException: The cookies.txt expired #16

Open
zenny opened this issue May 1, 2020 · 12 comments
Open

dl_coursera.define.CookiesExpiredException: The cookies.txt expired #16

zenny opened this issue May 1, 2020 · 12 comments

Comments

@zenny
Copy link

zenny commented May 1, 2020

Hi,

I have an issue with the latest cookies.txt from the browser:

$ dl_coursera --cookies ~/Downloads/coursera_cookies.txt --slug <COURSE ID> --outdir <path/to/output/dir> --how curl
Traceback (most recent call last):
  File "/home/zenny/.local/bin/dl_coursera", line 8, in <module>
    sys.exit(main())
  File "/home/zenny/.local/lib/python3.8/site-packages/dl_coursera_run.py", line 178, in main
    soc = crawl(args['cookies'], args['slug'], args['isSpec'], args['outdir'], args['n_worker'])
  File "/home/zenny/.local/lib/python3.8/site-packages/dl_coursera_run.py", line 65, in crawl
    raise CookiesExpiredException()
dl_coursera.define.CookiesExpiredException: The cookies.txt expired

Tried with builtin, aria2 and curl, but getting the same results. Any clue?

Cheers,
/z

@FLZ101
Copy link
Owner

FLZ101 commented May 5, 2020

The cookies.txt expired, so you need to get a new one. Refer to README.md for instructions.

@merberich
Copy link

Also make sure you are using the "coursera.org" cookies and not the "www.coursera.org" cookies (there is a difference).

@DeepsiA
Copy link

DeepsiA commented Sep 27, 2020

Hi @merberich , I am generating a new cookies.txt file using the chrome extension, and right away trying to download the files but I am still getting the exception CookiesExpiredException().

Also, how do we use only coursera.org; browser is redirecting me to https://www.coursera.org

Below is the command, I am using
>dl_coursera --cookies F:/Downloads/cookies.txt --slug machine-learning --how builtin --outdir path

@FLZ101
Copy link
Owner

FLZ101 commented Sep 27, 2020

Have you checked content of the cookies.txt to make sure it is the cookies.txt of Coursera ? @DeepsiA

@DeepsiA
Copy link

DeepsiA commented Sep 27, 2020

Have you checked content of the cookies.txt to make sure it is the cookies.txt of Coursera ? @DeepsiA

@FLZ101
Below attached is the content of my generated cookies.txt file.

# HTTP Cookie File downloaded with cookies.txt by Genuinous @genuinous
# This file can be used by wget, curl, aria2c and other standard compliant tools.
# Usage Examples:
#   1) wget -x --load-cookies cookies.txt "https://www.coursera.org/"
#   2) curl --cookie cookies.txt "https://www.coursera.org/"
#   3) aria2c --load-cookies cookies.txt "https://www.coursera.org/"
#
.www.coursera.org	TRUE	/	TRUE	0	G_AUTHUSER_H	0

Steps followed -

  1. Launched www.coursera.org
  2. Click on extension -> cookies.txt -> Download Here

@FLZ101
Copy link
Owner

FLZ101 commented Sep 27, 2020

Had you signed in before getting the cookies.txt? @DeepsiA

@DeepsiA
Copy link

DeepsiA commented Sep 27, 2020

@FLZ101 Yes. I am logged in with my Coursera Account.

@FLZ101
Copy link
Owner

FLZ101 commented Sep 27, 2020

The cookies.txt I got just now looks quite different from the one you got. @DeepsiA

# HTTP Cookie File downloaded with cookies.txt by Genuinous @genuinous
# This file can be used by wget, curl, aria2c and other standard compliant tools.
# Usage Examples:
#   1) wget -x --load-cookies cookies.txt "https://www.coursera.org/"
#   2) curl --cookie cookies.txt "https://www.coursera.org/"
#   3) aria2c --load-cookies cookies.txt "https://www.coursera.org/"
#
.coursera.org	TRUE	/	FALSE	1603610152	__204u	9013717...
.coursera.org	TRUE	/	FALSE	1603894717	__204r	htt...
.coursera.org	TRUE	/	FALSE	1664283449	_ga	GA1.2.66...
.coursera.org	TRUE	/	FALSE	1604471417	_hjid	56ee...
...

@DeepsiA
Copy link

DeepsiA commented Sep 27, 2020

Did you follow the same steps as I mentioned @FLZ101 or am I doing something wrong in generating the cookies?

@FLZ101
Copy link
Owner

FLZ101 commented Sep 27, 2020

I followed the same steps described in README, just as you did.

@utpal150894
Copy link

utpal150894 commented Feb 11, 2021

first try to login coursera account in your browser ...let it open in a tab ....then try to fetch the cookies text....it will work..

@RedemptionC
Copy link

make sure you are exporting cookies of coursera.com not www.coursera.com
I am using firefox,its extension will ask you this

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