joshcai / leetcode-sync

GitHub Action for syncing LeetCode submissions to GitHub
303 stars 61 forks source link

Leetcode now has challenge page #56

Closed kbiits closed 7 months ago

kbiits commented 7 months ago

Request to the leetcode API always return 403 status.

Below is the sample response. I tried to bypass it by modifying and adding some http headers, but still got the 403 error.

image
ckcherry23 commented 7 months ago

I am getting an error 403 since 2 days as well.

Screenshot 2024-03-10 at 11 47 30 AM
ali-john commented 7 months ago

I am also having the same issue

ajmedeio commented 7 months ago

I as well.

yehezkielgunawan commented 7 months ago

I think I'm not alone. I also having the same issue

ckcherry23 commented 7 months ago

Hi @joshcai, thanks for creating this action! Are there any plans to fix this issue?

joshcai commented 7 months ago

Sorry, I've been traveling for the past two weeks - I will take a look this weekend to see if I can fix this issue.

joshcai commented 7 months ago

The commit I just added is working for my repository, could anyone else confirm that it's working for them (use @master in the .yml file)? I can make a new release with this code shortly after it's verified to be fixed.

kbiits commented 7 months ago

Did you modify any configurations @joshcai ? Because it's not working for me.

First, I got this error and it's solved by updating the CSRF and session token

image

After I updated the csrf and session token, I got another error here.

image
joshcai commented 7 months ago

Thanks for trying @kbiits! I can't reproduce this error on my repo, but I recall seeing that issue in https://github.com/joshcai/leetcode-sync/issues/22, do you have destination-folder set? I think I can also just strip the trailing / if that's the issue for you as well.

kbiits commented 7 months ago

I don't have destination-folder set. Let me try to debug it and will get back to you with the details of question and solution path

kbiits commented 7 months ago

@joshcai I also didn't see anything wrong about the paths here

image

Fyi, the error is thrown when caling octokit.git.createTree, not the octokit.git.createCommit

siriscmv commented 7 months ago

@joshcai It ran without errors for me, but it only made a single api call and hence synced only the 20 most recent submissions. There are many other submissions from the past 2-3 weeks that did not get synced

joshcai commented 7 months ago

@kbiits Ah I looked into it more, and the default for the destination folder changing to "." caused the issue. I have now normalized the path so it shouldn't be an issue anymore.

@siriscmv thanks for reporting! I only tested on a single batch, the has_next feature was affected by the graphql changes. I plan on adding some unit tests to help with testing in the future.

I think all issues should be fixed now with the latest commit.

joshcai commented 7 months ago

I released a new version v1.6 that should work, please feel free to re-open if anything is broken - closing this for now.

kbiits commented 7 months ago

Thanks. It works well now @joshcai

Gurubalan-GIT commented 6 months ago

Thanks for getting on this, appreciate this a lot! - @joshcai