-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Bug] Unable to login using cookies #282
Comments
I think it is duplicate of #256. I also have problem to use leetgo on I tried both via invalid qid: user not signed in, your cookies may have expired When I try to leetgo pick today
# output:
invalid qid: user not signed in, your cookies may have expired but when I try to use: leetgo pick name-of-task
# output:
× failed to load cache, try updating with `leetgo cache update` err="stat /home/name/.config/leetgo/cache/leetcode-questions.json: no such file or directory"
● read LeetCode cookies browser=firefox domain=leetcode.com
× invalid qid: user not signed in, your cookies may have expired
# or if I have no variables setup for cookies or I am not login on leetcode
× failed to load cache, try updating with `leetgo cache update` err="stat /home/name/.config/leetgo/cache/leetcode-questions.json: no such file or directory"
● add credentials failed, continue requesting without credentials err="cookies not found"
× invalid qid: user not signed in, your cookies may have expired So I think we can assume that it reads cookies properly. I tried with |
Any idea on how can we make it work on Leetcode us site? I don't understand Chinese. |
I have the same issue. I try to use graphql with insomnia, it still was blocked by cloudflare. Still don't know how to bypass this one. |
The issue might related to this discussion in Reddit. It seems that Leetcode did restrict basic crawler 4 days ago. It should be the same date @Cvaniak got their issue. Here is the curl script that works sometime: curl \
--location "https://leetcode.com/graphql/" \
--header "Content-Type: application/json" \
--header "User-Agent: ME" \
--header "Cookie: LEETCODE_SESSION=<LEETCODE_SESSION>; csrftoken=<csrftoken>" \
--data '{"query":"query problemsetQuestionList($categorySlug: String, $limit: Int, $skip: Int, $filters: QuestionListFilterInput) {\n problemsetQuestionList: questionList(\n categorySlug: $categorySlug\n limit: $limit\n skip: $skip\n filters: $filters\n ) {\n total: totalNum\n questions: data {\n acRate\n difficulty\n freqBar\n frontendQuestionId: questionFrontendId\n isFavor\n paidOnly: isPaidOnly\n status\n title\n titleSlug\n topicTags {\n name\n id\n slug\n }\n hasSolution\n hasVideoSolution\n }\n }\n}","variables":{"categorySlug":"","skip":0,"limit":1,"filters":{}}}' \ It works with my environment occasionally while mostly it will return something like "just a moment". I noticed that Leetgo already add User-Agent in all request except authentication. However, it doesn't work even once under the same env with either browser or cookies option. There might be some filtering behind while I am not sure what that is. |
I figure out that turning off http2 seems to do the trick; now leetcode.com is consistently working for me. Could someone else confirm it by running? go run github.com/j178/leetgo@master whoami |
Can pick problem, but can't submit.
|
It works for me at this moment. |
It also works for me. I hope it will solve this problem for good. Thank you very much! As always - quick and working solution! |
Thank you @j178 for such quick fixes. It have tried setting environment variables as you told. It works absolutely fine.
|
Hi everyone, I've released v1.4.2 which might mitigate this issue. Interestingly, this morning |
leetgo debug
Leetgo version info :
Home dir : /home/gkrj/.config/leetgo
Project root : /mnt/ssd/work
Working dir : /mnt/ssd/work
Project config file : /mnt/ssd/work/leetgo.yaml
Project configuration:
Full configuration :
Debug log
Description
I ran
leetgo pick 1
. I have set the LEETCODE_SESSION and LEETCODE_CSRFTOKEN as environment variables from my logged in Leetcode account and yet I am unable to login.The text was updated successfully, but these errors were encountered: