tweaselORG / parse-tunes

Library for fetching select data on iOS apps from the Apple App Store via undocumented internal iTunes APIs.
MIT License
10 stars 1 forks source link

Handle "Too Many Requests" error #10

Open baltpeter opened 1 year ago

baltpeter commented 1 year ago

I got this error when trying to fetch app details:

/home/benni/coding/JS/tweasel/experiments/monkey-july-2023/node_modules/parse-tunes/dist/src/app-details.ts:439
    return res.data[0].attributes;
                   ^

TypeError: Cannot read properties of undefined (reading '0')
    at $b3be88adecf6544a$export$22bc61add701495d (/home/benni/coding/JS/tweasel/experiments/monkey-july-2023/node_modules/parse-tunes/dist/src/app-details.ts:439:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///home/benni/coding/JS/tweasel/experiments/monkey-july-2023/node_modules/p-map/index.js:139:20
baltpeter commented 1 year ago

Logging res in the function reveals the problem:

{
  errors: [
    {
      id: 'KKNSZEUAJV6Y5CMAV34T4MKXHA',
      title: 'Too Many Requests',
      detail: 'Request is forbidden',
      status: '429',
      code: '42900'
    }
  ]
}