Your cookie may have expired, or LeetCode has temporarily restricted API access #167

Open
opened 2025-02-26 13:10:27 -06:00 by adityainduraj · 9 comments
adityainduraj commented 2025-02-26 13:10:27 -06:00 (Migrated from github.com)

As the title says, I get the error:
Your cookie may have expired, or LeetCode has temporarily restricted API access

when I try to run the test cases for a question that I've already attempted. I can however submit the question with no issues.

This happens for 2 already-attempted questions as far as my testing goes (these were both questions I submitted for the first time through the plugin).

Let me know if there is any additional information required from my end.

As the title says, I get the error: `Your cookie may have expired, or LeetCode has temporarily restricted API access` when I try to run the test cases for a question that I've already attempted. I can however submit the question with no issues. This happens for 2 already-attempted questions as far as my testing goes (these were both questions I submitted for the first time through the plugin). Let me know if there is any additional information required from my end.
tminhvu commented 2025-08-15 00:39:26 -05:00 (Migrated from github.com)

I'm having the same problem. After putting debug = true in opts and replicating the issue I got status 403 and apparently a Couldflare challenge.

I'm having the same problem. After putting `debug = true` in `opts` and replicating the issue I got status `403` and apparently a Couldflare challenge.
abaj8494 commented 2025-08-24 21:47:08 -05:00 (Migrated from github.com)

me too. I just sat down to buzz through the problems too :((. great plugin, please fix

update: seems alright now, i let it sit for a moment. theres also this

me too. I just sat down to buzz through the problems too :((. great plugin, please fix update: seems alright now, i let it sit for a moment. theres also [this](https://github.com/kawre/leetcode.nvim/issues/138)
kawre commented 2025-08-25 15:20:35 -05:00 (Migrated from github.com)

me too. I just sat down to buzz through the problems too :((. great plugin, please fix

update: seems alright now, i let it sit for a moment. theres also this

What exactly helped? And is the main branch working for you now?

> me too. I just sat down to buzz through the problems too :((. great plugin, please fix > > update: seems alright now, i let it sit for a moment. theres also [this](https://github.com/kawre/leetcode.nvim/issues/138) What exactly helped? And is the main branch working for you now?
abaj8494 commented 2025-08-26 21:57:15 -05:00 (Migrated from github.com)

thanks for being so active with this plugin, I'm experiencing the same issue today. 338. is not letting me test or submit, however I am able to do so for 260. single-number III.

i've refreshed the token a couple times now and just moved on to the next problem for now. I'm not sure how to generate helpful logs for you

thanks for being so active with this plugin, I'm experiencing the same issue today. 338. is not letting me test or submit, however I am able to do so for 260. single-number III. i've refreshed the token a couple times now and just moved on to the next problem for now. I'm not sure how to generate helpful logs for you
kawre commented 2025-08-27 07:04:59 -05:00 (Migrated from github.com)

thanks for being so active with this plugin, I'm experiencing the same issue today. 338. is not letting me test or submit, however I am able to do so for 260. single-number III.

i've refreshed the token a couple times now and just moved on to the next problem for now. I'm not sure how to generate helpful logs for you

Can you confirm whether you experience the same behavior as described in this issue (excluding the debug part). If so, could you check similar tools to this plugin and let me know if they behave the same way?

> thanks for being so active with this plugin, I'm experiencing the same issue today. 338. is not letting me test or submit, however I am able to do so for 260. single-number III. > > i've refreshed the token a couple times now and just moved on to the next problem for now. I'm not sure how to generate helpful logs for you Can you confirm whether you experience the same behavior as described in [this issue](https://github.com/kawre/leetcode.nvim/issues/194) (excluding the debug part). If so, could you check [similar tools](https://github.com/kawre/leetcode.nvim/issues/194#issuecomment-3122184660) to this plugin and let me know if they behave the same way?
abaj8494 commented 2025-08-28 22:53:33 -05:00 (Migrated from github.com)

so, it's hugely interesting because the error seems contigent on the code that I write!

if I start the code fresh and incrementally build it up again, ensuring I can get a response to :Leet test, then I'm sweet.

currently I am working through 15: 3Sum and this works, whereas wrapping 'combinations_of_3' with list, generate the cookie error:

# @leet start
from itertools import combinations
class Solution:
    def threeSum(self, nums: List[int]) -> List[List[int]]:
        print(nums)
        combinations_of_3 = combinations(nums,3)
        print(combinations_of_3) # print(list(combinations_of_3)) will break!

        return [nums]


        
# @leet end

obviously this isn't the correct logic of the program, but I think your cookie logic is fine! statistics also work great; I'm certainly authenticated.

so, it's hugely interesting because the error seems contigent on the code that I write! if I start the code fresh and incrementally build it up again, ensuring I can get a response to `:Leet test`, then I'm sweet. currently I am working through 15: 3Sum and this works, whereas wrapping 'combinations_of_3' with list, generate the cookie error: ```python # @leet start from itertools import combinations class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: print(nums) combinations_of_3 = combinations(nums,3) print(combinations_of_3) # print(list(combinations_of_3)) will break! return [nums] # @leet end ``` obviously this isn't the correct logic of the program, but I think your cookie logic is fine! statistics also work great; I'm certainly authenticated.
arnm commented 2025-09-21 12:50:56 -05:00 (Migrated from github.com)

Yeap, todays daily 1912 seems to have the same issue, if I add some comments inside leetcode start it seems to work but if i remove them i get the error. not sure exactly what in the comment is making it work or not. Adding the comment after leet start somehow allows submission. Second example adding parenthesis breaks submission? Probably some parsing issue in the code.

Is able to submit:

# @leet start
# Each movie is given as a 2D integer array entries where entries[i] = [shop_i, movie_i, price_i] indicates


class MovieRentingSystem:

    def __init__(self, n: int, entries: List[List[int]]):


    def search(self, movie: int) -> List[int]:


    def rent(self, shop: int, movie: int) -> None:


    def drop(self, shop: int, movie: int) -> None:


    def report(self) -> List[List[int]]:



# Your MovieRentingSystem object will be instantiated and called as such:
# obj = MovieRentingSystem(n, entries)
# param_1 = obj.search(movie)
# obj.rent(shop,movie)
# obj.drop(shop,movie)
# param_4 = obj.report()
# @leet end

Not able to submit

# @leet start
# Each movie is given as a 2D integer array entries where entries[i] = [shop_i, movie_i, price_i] indicates (breaks somehow)


class MovieRentingSystem:

    def __init__(self, n: int, entries: List[List[int]]):


    def search(self, movie: int) -> List[int]:


    def rent(self, shop: int, movie: int) -> None:


    def drop(self, shop: int, movie: int) -> None:


    def report(self) -> List[List[int]]:



# Your MovieRentingSystem object will be instantiated and called as such:
# obj = MovieRentingSystem(n, entries)
# param_1 = obj.search(movie)
# obj.rent(shop,movie)
# obj.drop(shop,movie)
# param_4 = obj.report()
# @leet end
Yeap, todays daily 1912 seems to have the same issue, if I add some comments inside leetcode start it seems to work but if i remove them i get the error. not sure exactly what in the comment is making it work or not. Adding the comment after `leet start` somehow allows submission. Second example adding parenthesis breaks submission? Probably some parsing issue in the code. Is able to submit: ``` # @leet start # Each movie is given as a 2D integer array entries where entries[i] = [shop_i, movie_i, price_i] indicates class MovieRentingSystem: def __init__(self, n: int, entries: List[List[int]]): def search(self, movie: int) -> List[int]: def rent(self, shop: int, movie: int) -> None: def drop(self, shop: int, movie: int) -> None: def report(self) -> List[List[int]]: # Your MovieRentingSystem object will be instantiated and called as such: # obj = MovieRentingSystem(n, entries) # param_1 = obj.search(movie) # obj.rent(shop,movie) # obj.drop(shop,movie) # param_4 = obj.report() # @leet end ``` Not able to submit ``` # @leet start # Each movie is given as a 2D integer array entries where entries[i] = [shop_i, movie_i, price_i] indicates (breaks somehow) class MovieRentingSystem: def __init__(self, n: int, entries: List[List[int]]): def search(self, movie: int) -> List[int]: def rent(self, shop: int, movie: int) -> None: def drop(self, shop: int, movie: int) -> None: def report(self) -> List[List[int]]: # Your MovieRentingSystem object will be instantiated and called as such: # obj = MovieRentingSystem(n, entries) # param_1 = obj.search(movie) # obj.rent(shop,movie) # obj.drop(shop,movie) # param_4 = obj.report() # @leet end ```
kawre commented 2025-09-21 13:28:34 -05:00 (Migrated from github.com)

Yeap, todays daily 1912 seems to have the same issue, if I add some comments inside leetcode start it seems to work but if i remove them i get the error. not sure exactly what in the comment is making it work or not. Adding the comment after leet start somehow allows submission. Second example adding parenthesis breaks submission? Probably some parsing issue in the code.

Is able to submit:

# @leet start
# Each movie is given as a 2D integer array entries where entries[i] = [shop_i, movie_i, price_i] indicates


class MovieRentingSystem:

    def __init__(self, n: int, entries: List[List[int]]):


    def search(self, movie: int) -> List[int]:


    def rent(self, shop: int, movie: int) -> None:


    def drop(self, shop: int, movie: int) -> None:


    def report(self) -> List[List[int]]:



# Your MovieRentingSystem object will be instantiated and called as such:
# obj = MovieRentingSystem(n, entries)
# param_1 = obj.search(movie)
# obj.rent(shop,movie)
# obj.drop(shop,movie)
# param_4 = obj.report()
# @leet end

Not able to submit

# @leet start
# Each movie is given as a 2D integer array entries where entries[i] = [shop_i, movie_i, price_i] indicates (breaks somehow)


class MovieRentingSystem:

    def __init__(self, n: int, entries: List[List[int]]):


    def search(self, movie: int) -> List[int]:


    def rent(self, shop: int, movie: int) -> None:


    def drop(self, shop: int, movie: int) -> None:


    def report(self) -> List[List[int]]:



# Your MovieRentingSystem object will be instantiated and called as such:
# obj = MovieRentingSystem(n, entries)
# param_1 = obj.search(movie)
# obj.rent(shop,movie)
# obj.drop(shop,movie)
# param_4 = obj.report()
# @leet end

What error message do you get? I'm able to submit both of these solutions

> Yeap, todays daily 1912 seems to have the same issue, if I add some comments inside leetcode start it seems to work but if i remove them i get the error. not sure exactly what in the comment is making it work or not. Adding the comment after `leet start` somehow allows submission. Second example adding parenthesis breaks submission? Probably some parsing issue in the code. > > Is able to submit: > > ``` > # @leet start > # Each movie is given as a 2D integer array entries where entries[i] = [shop_i, movie_i, price_i] indicates > > > class MovieRentingSystem: > > def __init__(self, n: int, entries: List[List[int]]): > > > def search(self, movie: int) -> List[int]: > > > def rent(self, shop: int, movie: int) -> None: > > > def drop(self, shop: int, movie: int) -> None: > > > def report(self) -> List[List[int]]: > > > > # Your MovieRentingSystem object will be instantiated and called as such: > # obj = MovieRentingSystem(n, entries) > # param_1 = obj.search(movie) > # obj.rent(shop,movie) > # obj.drop(shop,movie) > # param_4 = obj.report() > # @leet end > ``` > > Not able to submit > > ``` > # @leet start > # Each movie is given as a 2D integer array entries where entries[i] = [shop_i, movie_i, price_i] indicates (breaks somehow) > > > class MovieRentingSystem: > > def __init__(self, n: int, entries: List[List[int]]): > > > def search(self, movie: int) -> List[int]: > > > def rent(self, shop: int, movie: int) -> None: > > > def drop(self, shop: int, movie: int) -> None: > > > def report(self) -> List[List[int]]: > > > > # Your MovieRentingSystem object will be instantiated and called as such: > # obj = MovieRentingSystem(n, entries) > # param_1 = obj.search(movie) > # obj.rent(shop,movie) > # obj.drop(shop,movie) > # param_4 = obj.report() > # @leet end > ``` What error message do you get? I'm able to submit both of these solutions
rishyramen commented 2026-04-25 12:35:55 -05:00 (Migrated from github.com)

I was also encountering this issue with some problems and the underlying cause seems to come from cloudflare. Claude proposed I install curl-impersonate and so far the issue seem to have subsided after setting vim.g.plenary_curl_bin_path = "curl_chrome136".

I was also encountering this issue with some problems and the underlying cause seems to come from cloudflare. Claude proposed I install `curl-impersonate` and so far the issue seem to have subsided after setting `vim.g.plenary_curl_bin_path = "curl_chrome136"`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
arduinohatesme/leetcode.nvim#167
No description provided.