Open
Description
I installed Node.JS and it's dependencies
I ran npm install
I'm trying to download a book using the CLI method, but I keep getting StatusCodeError: 404 - {"error":"Could not fetch work"}
Here is the command I ran: node cli.js -b "<9781491952016>" -c "<uhn7fxvjku8442ejdljcnn2kcueke3df>"
Here is the full output. I don't know JavaScript, so maybe this is something super simple to solve?
:::::::: ::: ::::::::: :::::::: :::::::: ::: ::: ::::::::
:+: :+: :+ :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#+ +:+ +#++:++#+ +#+ +:+ +#+ +:+ +#++:++ +#++:++#++
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ######### ######## ######## ### ### ########
+:++:++:++:+ using stored cookies
StatusCodeError: 404 - {"error":"Could not fetch work"}
at new StatusCodeError (D:\dev\obooks\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (D:\dev\obooks\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (D:\dev\obooks\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (D:\dev\obooks\node_modules\request\request.js:185:22)
at Request.emit (events.js:315:20)
at Request.<anonymous> (D:\dev\obooks\node_modules\request\request.js:1161:10)
at Request.emit (events.js:315:20)
at IncomingMessage.<anonymous> (D:\dev\obooks\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:421:28)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
statusCode: 404,
error: { error: 'Could not fetch work' },
options: {
uri: 'https://learning.oreilly.com/api/v1/book/<9781491952016>',
method: 'GET',
followAllRedirects: true,
resolveWithFullResponse: true,
headers: {
Accept: '*/*',
'Cache-Control': 'no-cache',
Cookie: '<uhn7oxvj9u8444ejdlj8nn2kcueke3cf>',
Connection: 'keep-alive'
},
body: null,
json: true,
callback: [Function: RP$callback],
transform: undefined,
simple: true,
transform2xxOnly: false
},
response: <ref *1> IncomingMessage {
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: true,
ended: true,
endEmitted: true,
reading: false,
sync: false,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: true,
autoDestroy: false,
destroyed: true,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: false
},
_events: [Object: null prototype] {
end: [Array],
close: [Array],
data: [Function (anonymous)],
error: [Function (anonymous)]
},
_eventsCount: 4,
_maxListeners: undefined,
socket: null,
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: {
connection: 'keep-alive',
'content-length': '32',
server: 'istio-envoy',
'content-type': 'application/json',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
'x-envoy-upstream-service-time': '98',
etag: 'W/"20-VP1zPcsrMiwJerbVIDyOLy0If+4"',
'x-content-type-options': 'nosniff',
'x-powered-by': 'Express',
'accept-ranges': 'bytes',
date: 'Mon, 12 Apr 2021 18:04:08 GMT',
via: '1.1 varnish',
'x-client-ip': '45.19.192.15',
'x-served-by': 'cache-dal21221-DAL',
'x-cache': 'MISS',
'x-cache-hits': '0',
'x-timer': 'S1618250648.303722,VS0,VE359',
vary: 'Accept, Accept-Encoding, Authorization, Cookie'
},
rawHeaders: [
'Connection',
'keep-alive',
'Content-Length',
'32',
'server',
'istio-envoy',
'content-type',
'application/json',
'strict-transport-security',
'max-age=31536000; includeSubDomains',
'x-envoy-upstream-service-time',
'98',
'etag',
'W/"20-VP1zPcsrMiwJerbVIDyOLy0If+4"',
'x-content-type-options',
'nosniff',
'x-powered-by',
'Express',
'Accept-Ranges',
'bytes',
'Date',
'Mon, 12 Apr 2021 18:04:08 GMT',
'Via',
'1.1 varnish',
'X-Client-IP',
'45.19.192.15',
'X-Served-By',
'cache-dal21221-DAL',
'X-Cache',
'MISS',
'X-Cache-Hits',
'0',
'X-Timer',
'S1618250648.303722,VS0,VE359',
'Vary',
'Accept, Accept-Encoding, Authorization, Cookie'
],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 404,
statusMessage: 'Not Found',
client: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: 'learning.oreilly.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 8,
connecting: false,
_hadError: false,
_parent: null,
_host: 'learning.oreilly.com',
_readableState: [ReadableState],
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: null,
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [ClientRequest],
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
5B84
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 10,
[Symbol(kHandle)]: null,
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 614,
[Symbol(kBytesWritten)]: 238,
[Symbol(connect-options)]: [Object],
[Symbol(RequestTimeout)]: undefined
},
_consuming: true,
_dumped: false,
req: ClientRequest {
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: true,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [TLSSocket],
_header: 'GET /api/v1/book/%3C9781491952016%3E HTTP/1.1\r\n' +
'Accept: */*\r\n' +
'Cache-Control: no-cache\r\n' +
'Cookie: <uhn7oxvj9u8444ejdlj8nn2kcueke3cf>\r\n' +
'Connection: keep-alive\r\n' +
'host: learning.oreilly.com\r\n' +
'content-type: application/json\r\n' +
'content-length: 4\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
method: 'GET',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/api/v1/book/%3C9781491952016%3E',
_ended: true,
res: [Circular *1],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'learning.oreilly.com',
protocol: 'https:',
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
request: Request {
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
uri: [Url],
method: 'GET',
followAllRedirects: true,
resolveWithFullResponse: true,
headers: [Object],
body: 'null',
readable: true,
writable: true,
explicitMethod: true,
_qs: [Querystring],
_auth: [Auth],
_oauth: [OAuth],
_multipart: [Multipart],
_redirect: [Redirect],
_tunnel: [Tunnel],
_rp_resolve: [Function (anonymous)],
_rp_reject: [Function (anonymous)],
_rp_promise: [Promise [Object]],
_rp_callbackOrig: undefined,
callback: [Function (anonymous)],
_rp_options: [Object],
setHeader: [Function (anonymous)],
hasHeader: [Function (anonymous)],
getHeader: [Function (anonymous)],
removeHeader: [Function (anonymous)],
localAddress: undefined,
pool: {},
dests: [],
__isRequestRequest: true,
_callback: [Function: RP$callback],
proxy: null,
tunnel: true,
setHost: true,
originalCookieHeader: '<uhn7oxvj9u8444ejdlj8nn2kcueke3cf>',
_disableCookies: true,
_jar: undefined,
port: 443,
host: 'learning.oreilly.com',
path: '/api/v1/book/%3C9781491952016%3E',
_json: true,
httpModule: [Object],
agentClass: [Function: Agent],
agent: [Agent],
_started: true,
href: 'https://learning.oreilly.com/api/v1/book/%3C9781491952016%3E',
req: [ClientRequest],
ntick: true,
response: [Circular *1],
originalHost: 'learning.oreilly.com',
originalHostHeaderName: 'host',
responseContent: [Circular *1],
_destdata: true,
_ended: true,
_callbackCalled: true,
[Symbol(kCapture)]: false
},
toJSON: [Function: responseToJSON],
caseless: Caseless { dict: [Object] },
body: { error: 'Could not fetch work' },
[Symbol(kCapture)]: false,
[Symbol(RequestTimeout)]: undefined
}
}
Metadata
Metadata
Assignees
Labels
No labels