skygragon / leetcode-cli

A cli tool to enjoy leetcode!
MIT License
3.65k stars 458 forks source link

leetcode show [ERROR] http error [400] #106

Closed futuristek closed 6 years ago

futuristek commented 6 years ago

Problem Summary

$ leetcode show [ERROR] http error [400]

$ leetcode show 2 [ERROR] http error [400]

How to reproduce

$ leetcode show [ERROR] http error [400]

Environment

futuristek commented 6 years ago

Verbose log:

$ leetcode show -vv [TRACE] initializing all plugins [TRACE] found plugin: cache=default [TRACE] inited plugin: cache [TRACE] found plugin: company=2017.12.18 [TRACE] inited plugin: company [TRACE] found plugin: leetcode=default [TRACE] inited plugin: leetcode [TRACE] found plugin: retry=default [TRACE] inited plugin: retry [TRACE] missing plugins: 0 [DEBUG] cache hit: problems.json [DEBUG] running leetcode.getProblem ⠋ Downloading max-increase-to-keep-city-skyline[TRACE] REQUEST %s { url: 'https://leetcode.com/graphql', headers: { Cookie: , 'X-CSRFToken': , 'X-Requested-With': 'XMLHttpRequest', Origin: 'https://leetcode.com', Referer: 'https://leetcode.com/problems/max-increase-to-keep-city-skyline/description/' }, json: true, body: { query: 'query getQuestionDetail($titleSlug: String!) {\n question(titleSlug: $titleSlug) {\n content\n stats\n codeDefinition\n sampleTestCase\n enableRunCode\n metaData\n discussCategoryId\n }\n}', variables: { titleSlug: 'max-increase-to-keep-city-skyline' }, operationName: 'getQuestionDetail' }, callback: [Function], method: 'POST' } [TRACE] REQUEST %s make request https://leetcode.com/graphql ⠸ Downloading max-increase-to-keep-city-skyline[TRACE] REQUEST %s onRequestResponse https://leetcode.com/graphql 400 { date: 'Tue, 29 May 2018 20:34:40 GMT', 'content-type': 'application/json', 'content-length': '129', connection: 'close', 'set-cookie': [ 'cfduid=d374f29b2a0b6081b544c4ef5b7f7bf591527626080; expires=Wed, 29-May-19 20:34:40 GMT; path=/; domain=.leetcode.com; HttpOnly', 'csrftoken=2zfhaUcKJq2QnPTDC4q8s0EMYZpl3aYVvH7L2jygzYp2i62tDYiqZdKC3WqONcRs; expires=Tue, 28-May-2019 20:34:40 GMT; Max-Age=31449600; Path=/; Secure' ], vary: 'Cookie', 'x-frame-options': 'SAMEORIGIN', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options': 'nosniff', 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', server: 'cloudflare', 'cf-ray': '422bbe388bda2180-EWR' } [TRACE] REQUEST %s reading response's body [TRACE] REQUEST %s finish init function https://leetcode.com/graphql [TRACE] REQUEST %s response end https://leetcode.com/graphql 400 { date: 'Tue, 29 May 2018 20:34:40 GMT', 'content-type': 'application/json', 'content-length': '129', connection: 'close', 'set-cookie': [ 'cfduid=d374f29b2a0b6081b544c4ef5b7f7bf591527626080; expires=Wed, 29-May-19 20:34:40 GMT; path=/; domain=.leetcode.com; HttpOnly', 'csrftoken=2zfhaUcKJq2QnPTDC4q8s0EMYZpl3aYVvH7L2jygzYp2i62tDYiqZdKC3WqONcRs; expires=Tue, 28-May-2019 20:34:40 GMT; Max-Age=31449600; Path=/; Secure' ], vary: 'Cookie', 'x-frame-options': 'SAMEORIGIN', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options': 'nosniff', 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', server: 'cloudflare', 'cf-ray': '422bbe388bda2180-EWR' } [TRACE] REQUEST %s end event https://leetcode.com/graphql [TRACE] REQUEST %s has body https://leetcode.com/graphql 129 [TRACE] REQUEST %s emitting complete https://leetcode.com/graphql [DEBUG] http error: 400

skygragon commented 6 years ago

please update to the latest leetcode-cli

npm install -g leetcode-cli
skygragon commented 6 years ago

duplicated to #100