Closed v2gt closed 4 years ago
Now LeetCode uses reCAPTCHA. We can't login without recaptcha_token. I'm afraid they may add more login authentication from now on.
same problem here: https://github.com/skygragon/leetcode-cli/issues/196
So is there any workaround for this issue? I just installed this package today, and I'm having the same problem logging in.
same problem here: skygragon/leetcode-cli#196
they fixed it using login with cookie
is there any way to workaround it by using cookie
Any updates for this?
yes, It seems we can read chrome cookie from local directory and decrypt browser storage, so that we don't need login anymore.
https://github.com/skygragon/leetcode-cli-plugins/blob/master/plugins/cookie.chrome.js
I haven't look into it, but it maybe doable in Emacs too.
@kaiwk Thank you very much. Are you planning to implement that?
Sure
@kaiwk Awesome. Looking forward to it!!!!!! I am new to Emacs, so I am not able to make some contribution to this. I am now already addicted to using this powerful monster. It is the must-have for me to play with LeetCode. Hope it can be fixed soon. Happy 2020.
I fix this by using a Python3 script to decrypt Chrome cookies, since Emacs lisp lack crypto library such as PBKDF2.
some things should be aware of:
pip3 install my_cookies
leetcode
, one need to login LeetCode in Chrome (Sorry, Firefox)hope someone confirm it works on Mac, thank you!
That's awesome and the best news I got in this new year. I will give it a shot when I go back home later today. Thank you!!!!
Hello @kaiwk , I just tried it and I still could not log in. After executing M-x leetcode, there was a progress bar on the status bar and the progress bar kept moving from left to right, and nothing happened. I uploaded a record for you to take a look. Thanks.
By the way, my system is macOS 10.15.2.
Hello @kaiwk , I just tried it and I still could not log in. After executing M-x leetcode, there was a progress bar on the status bar and the progress bar kept moving from left to right, and nothing happened. I uploaded a record for you to take a look. Thanks.
By the way, my system is macOS 10.15.2.
have you tried my_cookies
in bash? It should ask for Mac OSX keychain password, after that it will print your LEETCODE_SESSION
and csrftoken
.
if it works, try to eval (executable-find "my_cookies")
, it should return the path.
It works!!!!! Thank you very much.
Any progress with Linux and Firefox support? I found there is a python package, browser_cookie3, can extract cookies from web browsers with support for Chrome and Firefox on Linux, Mac and Windows.
Seconded Linux and Firefox support. I tried with browser_cookie3
, it's quite straight-forward and I can test it successfully under Linux/Firefox. It would be greatly appreciated if you may take a look and see if it's easy to integrate.
@RicardoMing @yiufung I have update my_cookies, now it has browser_cookie3 as dependency, you can upgrade it by pip install --upgrade my_cookies
. Make sure you use 0.1.1 version(it doesn't have --version
flag though...), because if you use pypi mirror, it may not update yet.
Works now with my_cookies v0.1.1
and leetcode v0.10.0
. Many thanks for the prompt update!
I still get a LeetCode fetch user and problems failed: (error connection-failed "connect" :host "leetcode.com" :service 443)
. Emacs can find the location of my_cookies
(the eval worked) and my_cookies
in terminal prints out my Leetcode session tokens. MacOS 10.15.2, Emacs 26.3.
@codeofdusk Try to close your Chrome completely by cmd-q and then restart the Chrome and login Leetcode again.
Sadly still not working.
@codeofdusk Okay. On my side, it works very well. MacOS 10.15.2, GNU Emacs 26.3 (installed via "brew install emacs-plus")
@codeofdusk Okay. On my side, it works very well. MacOS 10.15.2, GNU Emacs 26.3 (installed via "brew install emacs-plus")
Got it working via a Linux VM with Firefox for login.
Thanks for making this – I'm totally blind and the Leetcode site doesn't read very well with my screen reader, but it works perfectly under Emacspeak.
.emacs.d/elpa/leetcode-20191011.800/leetcode.el: ‘if-let’ is an obsolete macro (as of 26.1); use ‘if-let*’ instead. [8 times] Contacting host: leetcode.com:443 [2 times] LeetCode login failed: (error http 403) Contacting host: leetcode.com:443