FLZ101 / dl_coursera

A simple, fast and reliable Coursera crawling & downloading tool
MIT License
142 stars 30 forks source link

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

Open zenny opened 4 years ago

zenny commented 4 years ago

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 commented 4 years ago

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

merberich commented 4 years ago

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

DeepsiA commented 3 years ago

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 commented 3 years ago

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

DeepsiA commented 3 years ago

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 commented 3 years ago

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

DeepsiA commented 3 years ago

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

FLZ101 commented 3 years ago

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 commented 3 years ago

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

FLZ101 commented 3 years ago

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

utpal150894 commented 3 years ago

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 commented 3 years ago

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