abrausch / coursera-downloader

Ruby script to download material from coursera courses
39 stars 18 forks source link

Login Page #7

Closed Lewis-Clayton closed 11 years ago

Lewis-Clayton commented 11 years ago

Hi Alex,

It looks like the Coursera site now redirects if your browser doesn't support JavaScript, which Mechanize doesn't. As such the script can no longer log into the site and we get this error:

coursera-downloader.rb:19:in <main>': undefined methodemail=' for nil:NilClass (NoMethodError)

Regards,

Lewis

abrausch commented 11 years ago

OK, I think about how to create a solution for this. Perhaps I refactor the code and use somethine like selenium for scraping the website.

abrausch commented 11 years ago

Can you please restest the download?

Lewis-Clayton commented 10 years ago

Hi abrausch,

I think Coursera updated their login mechanic again. Either way you can get Mechanize working with the cookie by adding this:

cauth = "_HJ-ME3aBipizN20gB5Q_iLkN4jeb..blah..blah..blah" cookie = Mechanize::Cookie.new :domain => '.coursera.org', :name => "CAUTH", :value => cauth, :path => '/', :expires => (Date.today + 1).to_s agent.cookie_jar << cookie

Regards,

Lewis

abrausch commented 10 years ago

Can you perhaps create a pull request for that?