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
'Did not find necessary cookies' output when trying to download courses #547
Comments
@Polyphemus This is a known issue. Please see this: #508 (comment) |
Thank you, forcing the call to be to |
I think the same error(#154) got the different reason. |
Thanks, @Polyphemus for raising this issue, I too started seeing this only today. Thanks, @balta2ar , your suggestion works. |
Thanks, I got it. |
Thank @jiangtiandao , your code line worked for me |
I am having the same issue. I was able to download courses just fine, till yesterday, today I'm seeing this error. I have seen all the older threads and successfully updated both the script and the requirements. However, I could not quite figure out how to use --clear-cache and also the solutions posted on this thread (how can I change and access sections of the script). I am relatively, a noob, when it comes to programming. In fact, this is exactly what I'm trying to get better at through Coursera. I hope you guys can help me out. Thanks in advance. And thanks to the makers of this project for helping all of us learn new things. |
@shk3 What courses are you downloading? Old courses were shut down yesterday, only on-demand courses are available now. |
@balta2ar I believe the course i was trying to download was an on-demand course. It was Front-end Javascript Frameworks: Angular JS. The error, as i mentioned above is "Could not authenticate: Did not find necessary cookies."
I do see that when i use the --debug attribute that it is trying to download the course as an 'old style course'. But I'm not sure what the solution is, to that. I also, still cannot figure out how to use the --clear-cache attribute. |
@shkp Confirming. Old classes do not work anymore and unfortunately because of that downloader fails to switch to on-demand class download. You need to hack the code. See my comment above in this issue. We will fix it in the next version. |
Yes, sorry! Github completion confused me. |
In the newest version, I'm switching the exception in download_class function. So it will try the new version first, then the old version
|
@balta2ar I am getting the same error inspite of changing all occurrences of 'download_class' to 'download_on_demand_class'. |
@simratsingh96 Which course? |
https://www.coursera.org/learn/probability-intro/home : Introduction to Probability and Data |
@simratsingh96 Could you use the latest version from github? Support for old courses is already removed there, I think it should work for you. This change will be in the next release. |
@balta2ar I am using the most recent version 0.6.1 |
@simratsingh96 The changes that I'm talking about are not yet tagged, they are not in pip yet. Follow this: https://github.com/coursera-dl/coursera-dl#alternative-installation-method-for-unix-systems |
@balta2ar I use a mac, the instructions seem to be for a windows environment. Are there terminal specefic instructions availible? |
@simratsingh96 they work for mac |
Thank you for the suggestions @balta2ar. Worked perfectly for me |
Thank you @balta2ar ! Works fine now! |
@balta2ar, I am not able to make it work. I tried downloading the following courses: Alternatively when I tried to use the coursera-dl.py file you pointed to in post https://github.com/coursera-dl/coursera-dl/blob/master/coursera/coursera_dl.py#L1293 after making the same replacement, I am getting the error as shown below: Please let me know what I should do differently? -Sam |
@samrus98 Have you tried this instruction? https://github.com/coursera-dl/coursera-dl#alternative-installation-method-for-unix-systems Pay attention that this instruction does not use pip to install coursera-dl (only for dependencies). |
@balta2ar I am currently trying to do this in Windows command prompt...are you indicating that I should use unix environment? I am assuming that you are talking about the following piece of code: cd /directory/where/I/want/my/courses |
Well, in Windows you can do pretty much the same. I think there is git for windows, so it's possible. In fact, you don't necessarily need to clone, you can simply download master.zip and unpack it. I think virtualenv should work for Windows too. |
I have the same problem :/ course: https://www.coursera.org/learn/climate-change-mitigation/home/week/1 |
@balta2ar Sorry to disturb you, I have met the same problem as others. I installed the latest version 0.6.1, and tried to fix this problem as what you said in this issue, but it still doesn‘t work on my win 10 laptop. |
Thanks @balta2ar your suggestion for replacing download_class to download_on_demand_class in main() method worked 👍 |
in which directory do you find coursera-dl.py after installation? |
That depends on a lot of things: your OS, installation method, Python version. |
Unfortunately i could not make the suggested solution work (yet). When are -Sam On Jul 14, 2016 14:18, "Yuri Bochkarev" notifications@github.com wrote:
|
Only one thing is left in my plans for the next release: quiz download. I've started work on it but it appeared slightly more complicated than I anticipated. I don't want to give any concrete deadlines but I hope to finish it soon. |
@balta2ar QUIZ-download would make this insanely cool. |
@balta2ar Thank you! Alternative install working properly. |
@kinshuk4 how you can fix that? you fix in main() function or down_load function? |
As line numbers have changed: i) def download_class(args, class_name): thanks |
OK, I can answer my own question. |
I am getting the same issue. I am using the latest version on pip.
Debug output:
Environment: |
I am no expert, but this seems not enough. Inside of my virtual environment I had to edit Look my previous posts |
This should be fixed in 0.7.0. |
Subject of the issue
coursera-dl does not seem to authenticate through cookies correctly and always exits with the message:
Could not authenticate: Did not find necessary cookies.
I tried it for a number of course names:
sdn1
,sdn1-001
,modelthinking
,modelthinking-004
, and the one I am currently interested in:crypto
, for which I also triedlearn/crypto
.Your environment
81b9d40
(also tried release version0.6.1
)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?
81b9d40
Do you have all the recommended versions of the modules? See them in the
file
requirements.txt
.sudo pip install -r requirements.txt --upgrade
on the repo checkout.What is the course that you are trying to access?
What is the precise command line that you are using.
coursera-dl -u 'username@gmail.com' -p 'XXXXXXX' crypto
coursera-dl -u 'username@gmail.com' -p 'XXXXXXX' learn/crypto
--on-demand
command switch, but this only outputs a depreciated option message extra.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.
$ coursera-dl -u 'username@gmail.com' -p 'XXXXXXX' crypto --debug
root[main] coursera_dl version 0.6.1
root[main] Downloading class: crypto
root[download_class] Downloading old style class crypto
root[get_cookies_from_cache] Trying to get cookies from the cache.
root[load_cookies_file] Loading cookie file /tmp/rolf_coursera_dl_cache/cookies/rolfmorel@gmail.com.txt into memory.
root[get_cookies_from_cache] Could not load cookies from the cache.
root[login] Initiating login.
root[login] There were no .coursera.org cookies to be cleared.
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): class.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "GET /crypto HTTP/1.1" 200 None
root[login] Forging cookie header: csrftoken=5jeRB9VL13vGBq5QZ; csrf2_token_oiH1R=____D0VB0Q2I3POZciw6Woio.
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): www.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "POST /api/login/v3 HTTP/1.1" 200 None
root[login] Logged in on coursera.org.
requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): class.coursera.org
requests.packages.urllib3.connectionpool[_make_request] "GET /crypto/auth/auth_redirector?type=login&subtype=normal HTTP/1.1" 200 None
root[down_the_wabbit_hole] Following https://class.coursera.org/crypto/auth/auth_redirector?type=login&subtype=normal to authenticate on class.coursera.org.
root[down_the_wabbit_hole] Exiting "deep" authentication.
root[main] Could not authenticate: Did not find necessary cookies.
Expected behaviour
Having used coursera-dl some time ago, I expected it to download the course.
Actual behaviour
If I run the command
coursera-dl -u 'username@gmail.com' -p 'XXXXXXX' crypto
, or with any other course name, the output that I get back is as follows:The text was updated successfully, but these errors were encountered: