skygragon / leetcode-cli

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

Unable to generate cpp template #89

Closed yzyDavid closed 6 years ago

yzyDavid commented 6 years ago

leetcode show 4 -g -l cpp -x -vv [TRACE] found plugin: cache=default [TRACE] inited plugin: cache [TRACE] found plugin: leetcode=default [TRACE] inited plugin: leetcode [TRACE] found plugin: retry=default [TRACE] inited plugin: retry [DEBUG] running leetcode.getProblems [DEBUG] running leetcode.getCategoryProblems: algorithms [TRACE] REQUEST %s { url: 'https://leetcode.com/api/problems/algorithms/', headers:
{ Cookie: ,
'X-CSRFToken': ,
'X-Requested-With': 'XMLHttpRequest' },
callback: [Function] }
[DEBUG] running leetcode.getCategoryProblems: database [TRACE] REQUEST %s { url: 'https://leetcode.com/api/problems/database/', headers:
{ Cookie: ,
'X-CSRFToken': ,
'X-Requested-With': 'XMLHttpRequest' },
callback: [Function] }
[DEBUG] running leetcode.getCategoryProblems: shell [TRACE] REQUEST %s { url: 'https://leetcode.com/api/problems/shell/', headers:
{ Cookie: ,
'X-CSRFToken': ,
'X-Requested-With': 'XMLHttpRequest' },
callback: [Function] }
[TRACE] REQUEST %s make request https://leetcode.com/api/problems/algorithms/ [TRACE] REQUEST %s make request https://leetcode.com/api/problems/database/ [TRACE] REQUEST %s make request https://leetcode.com/api/problems/shell/ [TRACE] REQUEST %s onRequestResponse https://leetcode.com/api/problems/shell/ 200 { date: 'Wed, 21 Feb 2018 15:56:49 GMT', 'content-type': 'text/html; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'close',
'set-cookie':

, vary: 'Accept-Encoding, Cookie', 'x-frame-options': 'SAMEORIGIN', allow: 'GET, HEAD, OPTIONS', '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': '3f0ae5d9bb266bec-SJC' } [TRACE] REQUEST %s reading response's body [TRACE] REQUEST %s finish init function https://leetcode.com/api/problems/shell/ [TRACE] REQUEST %s response end https://leetcode.com/api/problems/shell/ 200 { date: 'Wed, 21 Feb 2018 15:56:49 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': , vary: 'Accept-Encoding, Cookie', 'x-frame-options': 'SAMEORIGIN', allow: 'GET, HEAD, OPTIONS', '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': '3f0ae5d9bb266bec-SJC' } [TRACE] REQUEST %s end event https://leetcode.com/api/problems/shell/ [TRACE] REQUEST %s has body https://leetcode.com/api/problems/shell/ 1879 [TRACE] REQUEST %s emitting complete https://leetcode.com/api/problems/shell/ [DEBUG] shell: getProblems got 4 problems [TRACE] REQUEST %s onRequestResponse https://leetcode.com/api/problems/algorithms/ 200 { date: 'Wed, 21 Feb 2018 15:56:49 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': , vary: 'Accept-Encoding, Cookie', 'x-frame-options': 'SAMEORIGIN', allow: 'GET, HEAD, OPTIONS', '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': '3f0ae5d99fba6e20-SJC' } [TRACE] REQUEST %s reading response's body [TRACE] REQUEST %s finish init function https://leetcode.com/api/problems/algorithms/ [TRACE] REQUEST %s onRequestResponse https://leetcode.com/api/problems/database/ 200 { date: 'Wed, 21 Feb 2018 15:56:49 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': , vary: 'Accept-Encoding, Cookie', 'x-frame-options': 'SAMEORIGIN', allow: 'GET, HEAD, OPTIONS', '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': '3f0ae5daaba76c3a-SJC' } [TRACE] REQUEST %s reading response's body [TRACE] REQUEST %s finish init function https://leetcode.com/api/problems/database/ [TRACE] REQUEST %s response end https://leetcode.com/api/problems/database/ 200 { date: 'Wed, 21 Feb 2018 15:56:49 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': , vary: 'Accept-Encoding, Cookie', 'x-frame-options': 'SAMEORIGIN', allow: 'GET, HEAD, OPTIONS', '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': '3f0ae5daaba76c3a-SJC' } [TRACE] REQUEST %s end event https://leetcode.com/api/problems/database/ [TRACE] REQUEST %s has body https://leetcode.com/api/problems/database/ 19366 [TRACE] REQUEST %s emitting complete https://leetcode.com/api/problems/database/ [DEBUG] database: getProblems got 42 problems [TRACE] REQUEST %s response end https://leetcode.com/api/problems/algorithms/ 200 { date: 'Wed, 21 Feb 2018 15:56:49 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': , vary: 'Accept-Encoding, Cookie', 'x-frame-options': 'SAMEORIGIN', allow: 'GET, HEAD, OPTIONS', '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': '3f0ae5d99fba6e20-SJC' } [TRACE] REQUEST %s end event https://leetcode.com/api/problems/algorithms/ [TRACE] REQUEST %s has body https://leetcode.com/api/problems/algorithms/ 310285 [TRACE] REQUEST %s emitting complete https://leetcode.com/api/problems/algorithms/ [DEBUG] algorithms: getProblems got 702 problems [DEBUG] running leetcode.getProblem [TRACE] REQUEST %s { url: 'https://leetcode.com/problems/median-of-two-sorted-arrays', headers: { Cookie: , 'X-CSRFToken': , 'X-Requested-With': 'XMLHttpRequest' }, callback: [Function] } [TRACE] REQUEST %s make request https://leetcode.com/problems/median-of-two-sorted-arrays [TRACE] REQUEST %s onRequestResponse https://leetcode.com/problems/median-of-two-sorted-arrays 301 { date: 'Wed, 21 Feb 2018 15:56:51 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': , location: '/problems/median-of-two-sorted-arrays/', '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': '3f0ae5e2cf606c3a-SJC' } [TRACE] REQUEST %s redirect /problems/median-of-two-sorted-arrays/ [TRACE] REQUEST %s redirect to /problems/median-of-two-sorted-arrays/ [TRACE] REQUEST %s {} [TRACE] REQUEST %s response end https://leetcode.com/problems/median-of-two-sorted-arrays/ 301 { date: 'Wed, 21 Feb 2018 15:56:51 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': , location: '/problems/median-of-two-sorted-arrays/', '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': '3f0ae5e2cf606c3a-SJC' } [TRACE] REQUEST %s make request https://leetcode.com/problems/median-of-two-sorted-arrays/ [TRACE] REQUEST %s onRequestResponse https://leetcode.com/problems/median-of-two-sorted-arrays/ 200 { date: 'Wed, 21 Feb 2018 15:56:51 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': [ '__cfduid=df171f89b424388a45f5eebc35af1da281519228611; expires=Thu, 21-Feb-19 15:56:51 GMT; path=/; domain=.leetcode.com; HttpOnly', 'csrftoken=RKm5vmw3UTHzZr5XgQ7EeCgKUxiRZzYw6jI5TrZN5hgArmgIlD6qTW6MK8PlKDQj; expires=Wed, 20-Feb-2019 15:56:51 GMT; Max-Age=31449600; Path=/; secure' ], vary: 'Accept-Encoding, 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': '3f0ae5e71b7e6e44-SJC' } [TRACE] REQUEST %s reading response's body [TRACE] REQUEST %s finish init function https://leetcode.com/problems/median-of-two-sorted-arrays/ [TRACE] REQUEST %s response end https://leetcode.com/problems/median-of-two-sorted-arrays/ 200 { date: 'Wed, 21 Feb 2018 15:56:51 GMT', 'content-type': 'text/html; charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': [ '__cfduid=df171f89b424388a45f5eebc35af1da281519228611; expires=Thu, 21-Feb-19 15:56:51 GMT; path=/; domain=.leetcode.com; HttpOnly', 'csrftoken=RKm5vmw3UTHzZr5XgQ7EeCgKUxiRZzYw6jI5TrZN5hgArmgIlD6qTW6MK8PlKDQj; expires=Wed, 20-Feb-2019 15:56:51 GMT; Max-Age=31449600; Path=/; secure' ], vary: 'Accept-Encoding, 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': '3f0ae5e71b7e6e44-SJC' } [TRACE] REQUEST %s end event https://leetcode.com/problems/median-of-two-sorted-arrays/ [TRACE] REQUEST %s has body https://leetcode.com/problems/median-of-two-sorted-arrays/ 17702 [TRACE] REQUEST %s emitting complete https://leetcode.com/problems/median-of-two-sorted-arrays/ [ERROR] Unknown language "cpp" [0]
skygragon commented 6 years ago

Please update to the latest leetcode-cli:

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

Thx!

I issued that for initially I did not update it and I got a template generated successfully, now I thought it might be cached a few months ago. sorry for the trouble