facundoolano / app-store-scraper

scrape data from the itunes app store
MIT License
1.03k stars 244 forks source link

Getting some debug output instead of actual output #195

Open kishanios123 opened 1 year ago

kishanios123 commented 1 year ago

Example code:

var store = require('app-store-scraper');

store.search({
  term: 'Apple',
  page: 3,
  country : 'us',
  lang: 'lang'
})
.then(console.log)
.catch(console.log);

Error response:

{
  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,
      constructed: true,
      sync: true,
      needReadable: false,
      emittedReadable: false,
      readableListening: false,
      resumeScheduled: false,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      destroyed: true,
      errored: null,
      closed: true,
      closeEmitted: true,
      defaultEncoding: 'utf8',
      awaitDrainWriters: null,
      multiAwaitDrain: false,
      readingMore: true,
      dataEmitted: true,
      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: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'itunes.apple.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'itunes.apple.com',
      _closeAfterHandlingError: false,
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [ClientRequest],
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 53,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: false,
      [Symbol(kSetKeepAliveInitialDelay)]: 0,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object],
      [Symbol(RequestTimeout)]: undefined
    },
    httpVersionMajor: 1,
    httpVersionMinor: 1,
    httpVersion: '1.1',
    complete: true,
    rawHeaders: [
      'x-apple-jingle-correlation-key',
      'XVWVMQH7NTQ5VUWQ7I2UMUNSBA',
      'x-apple-request-uuid',
      'bd6d5640-ff6c-e1da-d2d0-fa354651b208',
      'x-apple-translated-wo-url',
      '/WebObjects/MZStoreServices.woa/ws/wsLookup?id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&country=us&entity=software&lang=lang&urlDesc=',
      'apple-tk',
      'false',
      'x-b3-spanid',
      '35f03b6a9d9b41e7',
      'Content-Type',
      'text/javascript; charset=utf-8',
      'b3',
      'bd6d5640ff6ce1dad2d0fa354651b208-35f03b6a9d9b41e7',
      'x-b3-traceid',
      'bd6d5640ff6ce1dad2d0fa354651b208',
      'x-webobjects-loadaverage',
      '0',
      'x-responding-instance',
      'MZStoreServices:4013006:::',
      'apple-seq',
      '0',
      'apple-originating-system',
      'MZStoreServices',
      'Content-Encoding',
      'gzip',
      'strict-transport-security',
      'max-age=31536000',
      'x-apple-orig-url',
      'https://mzstoreservices-int.itunes.apple.com/lookup?id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&country=us&entity=software&lang=lang',
      'x-apple-application-site',
      'MR22',
      'apple-timing-app',
      '1 ms',
      'x-apple-application-instance',
      '4013006',
      'Content-Length',
      '225',
      'Vary',
      'Accept-Encoding',
      'Expires',
      'Mon, 21 Aug 2023 12:38:58 GMT',
      'Cache-Control',
      'max-age=0, no-cache',
      'Pragma',
      'no-cache',
      'Date',
      'Mon, 21 Aug 2023 12:38:58 GMT',
      'X-Cache',
      'TCP_MISS from a23-211-135-222.deploy.akamaitechnologies.com (AkamaiGHost/11.2.2-50274567) (-)',
      'X-True-Cache-Key',
      '/L/itunes.apple.com/lookup vcd=2897 ci2=country=us&entity=software&id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&lang=lang///',
      'Connection',
      'close',
      'X-Cache-Remote',
      'TCP_MISS from a23-212-253-223.deploy.akamaitechnologies.com (AkamaiGHost/11.2.2-50274567) (-)',
      'X-Apple-Partner',
      'origin.0'
    ],
    rawTrailers: [],
    aborted: false,
    upgrade: false,
    url: '',
    method: null,
    statusCode: 400,
    statusMessage: 'Bad Request',
    client: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'itunes.apple.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'itunes.apple.com',
      _closeAfterHandlingError: false,
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [ClientRequest],
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 53,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: false,
      [Symbol(kSetKeepAliveInitialDelay)]: 0,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object],
      [Symbol(RequestTimeout)]: undefined
    },
    _consuming: false,
    _dumped: false,
    req: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'GET /lookup?id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&country=us&entity=software&lang=lang HTTP/1.1\r\n' +
        'host: itunes.apple.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/lookup?id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&country=us&entity=software&lang=lang',
      _ended: true,
      res: [Circular *1],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'itunes.apple.com',
      protocol: 'https:',
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kEndCalled)]: true,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(kUniqueHeaders)]: null
    },
    request: Request {
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      headers: {},
      method: 'GET',
      callback: [Function (anonymous)],
      readable: true,
      writable: true,
      explicitMethod: true,
      _qs: [Querystring],
      _auth: [Auth],
      _oauth: [OAuth],
      _multipart: [Multipart],
      _redirect: [Redirect],
      _tunnel: [Tunnel],
      setHeader: [Function (anonymous)],
      hasHeader: [Function (anonymous)],
      getHeader: [Function (anonymous)],
      removeHeader: [Function (anonymous)],
      localAddress: undefined,
      pool: {},
      dests: [],
      __isRequestRequest: true,
      _callback: [Function (anonymous)],
      uri: [Url],
      proxy: null,
      tunnel: true,
      setHost: true,
      originalCookieHeader: undefined,
      _disableCookies: true,
      _jar: undefined,
      port: 443,
      host: 'itunes.apple.com',
      path: '/lookup?id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&country=us&entity=software&lang=lang',
      httpModule: [Object],
      agentClass: [Function: Agent],
      agent: [Agent],
      _started: true,
      href: 'https://itunes.apple.com/lookup?id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&country=us&entity=software&lang=lang',
      req: [ClientRequest],
      ntick: true,
      response: [Circular *1],
      originalHost: 'itunes.apple.com',
      originalHostHeaderName: 'host',
      responseContent: [Circular *1],
      _destdata: true,
      _ended: true,
      _callbackCalled: true,
      [Symbol(kCapture)]: false
    },
    toJSON: [Function: responseToJSON],
    caseless: Caseless { dict: [Object] },
    body: "\x1F�\b\x00\x00\x00\x00\x00\x00\x00]O=O�@\f��+���T\x16�l\x1D\x19\x10H��\x0E��I����?*EU�;�P��b[O�6\x10H��Tq�І�r��:��i�\x0Fг���z��\f^�����_N2���DF���\x06v;�U��r\t[\b\x11s>`<Uh\x07G��FIg��K��\x05�a��e��]@\t%� ��MW\x05�b2/��_\x1F�vp\x07��h!�4���c$(>\x1DH��\x7FB������j�i\rt'�I*êU\x0B�9�����5��\x1B��8�3\x01\x00\x00",
    [Symbol(kCapture)]: false,
    [Symbol(kHeaders)]: {
      'x-apple-jingle-correlation-key': 'XVWVMQH7NTQ5VUWQ7I2UMUNSBA',
      'x-apple-request-uuid': 'bd6d5640-ff6c-e1da-d2d0-fa354651b208',
      'x-apple-translated-wo-url': '/WebObjects/MZStoreServices.woa/ws/wsLookup?id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&country=us&entity=software&lang=lang&urlDesc=',
      'apple-tk': 'false',
      'x-b3-spanid': '35f03b6a9d9b41e7',
      'content-type': 'text/javascript; charset=utf-8',
      b3: 'bd6d5640ff6ce1dad2d0fa354651b208-35f03b6a9d9b41e7',
      'x-b3-traceid': 'bd6d5640ff6ce1dad2d0fa354651b208',
      'x-webobjects-loadaverage': '0',
      'x-responding-instance': 'MZStoreServices:4013006:::',
      'apple-seq': '0',
      'apple-originating-system': 'MZStoreServices',
      'content-encoding': 'gzip',
      'strict-transport-security': 'max-age=31536000',
      'x-apple-orig-url': 'https://mzstoreservices-int.itunes.apple.com/lookup?id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&country=us&entity=software&lang=lang',
      'x-apple-application-site': 'MR22',
      'apple-timing-app': '1 ms',
      'x-apple-application-instance': '4013006',
      'content-length': '225',
      vary: 'Accept-Encoding',
      expires: 'Mon, 21 Aug 2023 12:38:58 GMT',
      'cache-control': 'max-age=0, no-cache',
      pragma: 'no-cache',
      date: 'Mon, 21 Aug 2023 12:38:58 GMT',
      'x-cache': 'TCP_MISS from a23-211-135-222.deploy.akamaitechnologies.com (AkamaiGHost/11.2.2-50274567) (-)',
      'x-true-cache-key': '/L/itunes.apple.com/lookup vcd=2897 ci2=country=us&entity=software&id=1606703142,1411596157,1510429086,445553058,1401019110,398129933,382617920,335393788,1480383173,1152299107,1531983371,1601638213,1441501230,1527561558,1459549731,507605066,1630699647,657878530,493226494,1074367771,1500901823,1541992656,1485913772,1200776424,506460513,320606217,1454778585,1435779669,1584216343,1486315142,421571209,1450682541,1561786392,1485310935,623592465,1584215812,1584215851,1563316278,1517805311,1505627452,1492560451,1526384700,1092704571,1529106085,1027151285,961390574,461316429,577363344,383457673,1173365557&lang=lang///',
      connection: 'close',
      'x-cache-remote': 'TCP_MISS from a23-212-253-223.deploy.akamaitechnologies.com (AkamaiGHost/11.2.2-50274567) (-)',
      'x-apple-partner': 'origin.0'
    },
    [Symbol(kHeadersCount)]: 58,
    [Symbol(kTrailers)]: null,
    [Symbol(kTrailersCount)]: 0,
    [Symbol(RequestTimeout)]: undefined
  }
}
sabatale commented 1 year ago

Same result @facundoolano.