leetcode-downloader icon indicating copy to clipboard operation
leetcode-downloader copied to clipboard

HTTP 429 too many requests

Open sfdye opened this issue 7 years ago • 3 comments

I can only download at most 60 submissions. Maybe the script should respect the leetcode API rate limit?

{ Error: Request failed with status code 429
    at createError (/Users/xxx/Projects/leetcode-downloader/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/Users/xxx/Projects/leetcode-downloader/node_modules/axios/lib/core/settle.js:18:12)
    at IncomingMessage.handleStreamEnd (/Users/xxx/Projects/leetcode-downloader/node_modules/axios/lib/adapters/http.js:191:11)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1081:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  config:
   { adapter: [Function: httpAdapter],
     transformRequest: { '0': [Function: transformRequest] },
     transformResponse: { '0': [Function: transformResponse] },
     timeout: 0,
     xsrfCookieName: 'XSRF-TOKEN',
     xsrfHeaderName: 'X-XSRF-TOKEN',
     maxContentLength: -1,
     validateStatus: [Function: validateStatus],
     headers:
      { Accept: 'application/json, text/plain, */*',
        Cookie:

sfdye avatar Aug 14 '18 02:08 sfdye

Hmm ok I'll try to find time to add a limit the concurrent requests, or you could submit a PR if you have time 😄

yangshun avatar Aug 14 '18 02:08 yangshun

@yangshun Thanks! This tools has been very helpful.

sfdye avatar Aug 14 '18 02:08 sfdye

Same problem, can you solve it? I do not have knowledge in JS.

GoingMyWay avatar Jan 31 '23 10:01 GoingMyWay