aso icon indicating copy to clipboard operation
aso copied to clipboard

Unhandled promise rejection.

Open vishal-sarvaiya-origin opened this issue 3 years ago • 8 comments

This is My code

I didn't make any changes into code. I follow steps as given in README.md File

//npm install aso

const gplay = require('aso')('gplay');
const itunes = require('aso')('itunes');

gplay.scores('panda').then(console.log);

itunes.scores('panda').then(console.log);

It gives me error

UnhandledPromiseRejectionWarning: #<Object>

AND

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined

vishal-sarvaiya-origin avatar Oct 10 '20 06:10 vishal-sarvaiya-origin

error The following error has been occurred

vishal-sarvaiya-origin avatar Oct 10 '20 06:10 vishal-sarvaiya-origin

same error here

burakyalti avatar Oct 21 '20 12:10 burakyalti

Any update? I am also experiencing the same errors unfortunately.

rylax avatar Jun 05 '21 21:06 rylax

Hi, I'd love to see an update on this too - just trying for the first time and not having any luck. If I catch the error I get this:

 {
  response: IncomingMessage {
    _readableState: ReadableState {
      objectMode: false,
      highWaterMark: 16384,
      buffer: BufferList { head: null, tail: null, length: 0 },
      length: 0,
      pipes: null,
      pipesCount: 0,
      flowing: true,
      ended: true,
      endEmitted: true,
      reading: false,
      sync: true,
      needReadable: false,
      emittedReadable: false,
      readableListening: false,
      resumeScheduled: false,
      paused: false,
      emitClose: true,
      autoDestroy: false,
      destroyed: false,
      defaultEncoding: 'utf8',
      awaitDrain: 0,
      readingMore: true,
      decoder: null,
      encoding: null
    },
    readable: false,
    _events: [Object: null prototype] {
      end: [Array],
      close: [Array],
      data: [Function],
      error: [Function]
    },
    _eventsCount: 4,
    _maxListeners: undefined,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      _SNICallback: null,
      servername: 'itunes.apple.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 9,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'itunes.apple.com',
      _readableState: [ReadableState],
      readable: true,
      _maxListeners: undefined,
      _writableState: [WritableState],
      writable: false,
      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(asyncId)]: 86,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    connection: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      _SNICallback: null,
      servername: 'itunes.apple.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 9,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'itunes.apple.com',
      _readableState: [ReadableState],
      readable: true,
      _maxListeners: undefined,
      _writableState: [WritableState],
      writable: false,
      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(asyncId)]: 86,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    httpVersionMajor: 1,
    httpVersionMinor: 1,
    httpVersion: '1.1',
    complete: true,
    headers: {
      'content-type': 'text/html',
      'content-length': '0',
      date: 'Wed, 07 Jul 2021 10:36:36 GMT',
      'x-cache': 'TCP_MISS from a173-222-211-175.deploy.akamaitechnologies.com (AkamaiGHost/10.4.2-33748240) (-)',
      'x-true-cache-key': '/L/itunes.apple.com/WebObjects/MZStore.woa/wa/search vcd=2897 ci2=clientApplication=Software&media=software&term=clean%20camera//.143441,24%20t%3anative/',
      connection: 'close',
      vary: 'X-Apple-Store-Front, Cookie, X-Apple-Store-Front, Cookie',
      'x-apple-partner': 'origin.0'
    },
    rawHeaders: [
      'Content-Type',
      'text/html',
      'Content-Length',
      '0',
      'Date',
      'Wed, 07 Jul 2021 10:36:36 GMT',
      'X-Cache',
      'TCP_MISS from a173-222-211-175.deploy.akamaitechnologies.com (AkamaiGHost/10.4.2-33748240) (-)',
      'X-True-Cache-Key',
      '/L/itunes.apple.com/WebObjects/MZStore.woa/wa/search vcd=2897 ci2=clientApplication=Software&media=software&term=clean%20camera//.143441,24%20t%3anative/',
      'Connection',
      'close',
      'Vary',
      'X-Apple-Store-Front, Cookie',
      'Vary',
      'X-Apple-Store-Front, Cookie',
      'X-Apple-Partner',
      'origin.0'
    ],
    trailers: {},
    rawTrailers: [],
    aborted: false,
    upgrade: false,
    url: '',
    method: null,
    statusCode: 503,
    statusMessage: 'Service Unavailable',
    client: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      _SNICallback: null,
      servername: 'itunes.apple.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 9,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'itunes.apple.com',
      _readableState: [ReadableState],
      readable: true,
      _maxListeners: undefined,
      _writableState: [WritableState],
      writable: false,
      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(asyncId)]: 86,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object]
    },
    _consuming: false,
    _dumped: false,
    req: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      socket: [TLSSocket],
      connection: [TLSSocket],
      _header: 'GET /WebObjects/MZStore.woa/wa/search?clientApplication=Software&media=software&term=clean%20camera HTTP/1.1\r\n' +
        'X-Apple-Store-Front: 143441,24 t:native\r\n' +
        'Accept-Language: en-us\r\n' +
        'host: itunes.apple.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _onPendingData: [Function: noopPendingOutput],
      agent: [Agent],
      socketPath: undefined,
      method: 'GET',
      insecureHTTPParser: undefined,
      path: '/WebObjects/MZStore.woa/wa/search?clientApplication=Software&media=software&term=clean%20camera',
      _ended: true,
      res: [Circular],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      [Symbol(kNeedDrain)]: false,
      [Symbol(isCorked)]: false,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    request: Request {
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      headers: [Object],
      method: 'GET',
      callback: [Function],
      readable: true,
      writable: true,
      explicitMethod: true,
      _qs: [Querystring],
      _auth: [Auth],
      _oauth: [OAuth],
      _multipart: [Multipart],
      _redirect: [Redirect],
      _tunnel: [Tunnel],
      setHeader: [Function],
      hasHeader: [Function],
      getHeader: [Function],
      removeHeader: [Function],
      localAddress: undefined,
      pool: {},
      dests: [],
      __isRequestRequest: true,
      _callback: [Function],
      uri: [Url],
      proxy: null,
      tunnel: true,
      setHost: true,
      originalCookieHeader: undefined,
      _disableCookies: true,
      _jar: undefined,
      port: 443,
      host: 'itunes.apple.com',
      path: '/WebObjects/MZStore.woa/wa/search?clientApplication=Software&media=software&term=clean%20camera',
      httpModule: [Object],
      agentClass: [Function: Agent],
      agent: [Agent],
      _started: true,
      href: 'https://itunes.apple.com/WebObjects/MZStore.woa/wa/search?clientApplication=Software&media=software&term=clean%20camera',
      req: [ClientRequest],
      ntick: true,
      response: [Circular],
      originalHost: 'itunes.apple.com',
      originalHostHeaderName: 'host',
      responseContent: [Circular],
      _ended: true,
      _callbackCalled: true
    },
    toJSON: [Function: responseToJSON],
    caseless: Caseless { dict: [Object] },
    body: ''
  }

michaelforrest avatar Jul 07 '21 10:07 michaelforrest

This url gives a 503 error - maybe it didn't used to? https://itunes.apple.com/WebObjects/MZStore.woa/wa/search?clientApplication=Software&media=software&term=clean%20camera

michaelforrest avatar Jul 07 '21 10:07 michaelforrest

I fixed this by installing directly from this repo instead of npm.

package.json:

"dependencies": {
  "aso": "https://github.com/facundoolano/aso",
  // ...
}

michaelforrest avatar Jul 07 '21 10:07 michaelforrest

update google-play-scraper 👍 , then aso works

npm i google-play-scraper@latest

acedigibits avatar Aug 25 '21 07:08 acedigibits

I fixed this by installing directly from this repo instead of npm.

package.json:

"dependencies": {
  "aso": "https://github.com/facundoolano/aso",
  // ...
}

Works for me. Thanks!

sidan5 avatar Aug 27 '23 15:08 sidan5