greendoescode / vlc-rpc

Discord rich presence for VLC media player. This is a fork of PigPogs VLC RPC, adding automatic album art.
MIT License
16 stars 3 forks source link

AxiosError: Request failed with status code 503 #11

Closed sdasda7777 closed 1 year ago

sdasda7777 commented 1 year ago

Hi, I sometimes get this error. Happened multiple times with different songs, it's not possible to deliberately reproduce, as far as I can tell. I believe it shouldn't be too hard to fix, just adding a better handling of bad responses should be enough.

PS C:\Users\sdasda7777\Downloads\vlc-rpc2-git\vlc-rpc> .\start.bat
Starting script...

> vlc-rpc@1.1.9 start
> node ./src/app.js

Connecting to Discord...
Logged in as [username]
Now playing Wollt ihr das Bett in Flammen sehen by Rammstein
Now playing Der Meister by Rammstein
Now playing Weisses Fleisch by Rammstein

C:\Users\sdasda7777\Downloads\vlc-rpc2-git\vlc-rpc\node_modules\axios\dist\node\axios.cjs:1855
    reject(new AxiosError(
           ^
AxiosError: Request failed with status code 503
    at settle (C:\Users\sdasda7777\Downloads\vlc-rpc2-git\vlc-rpc\node_modules\axios\dist\node\axios.cjs:1855:12)
    at IncomingMessage.handleStreamEnd (C:\Users\sdasda7777\Downloads\vlc-rpc2-git\vlc-rpc\node_modules\axios\dist\node\axios.cjs:2712:11)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ERR_BAD_RESPONSE',

[huge amount of data]

  _currentUrl: 'https://itunes.apple.com/search?media=music&term=Asche+zu+Asche+Rammstein',
        [Symbol(kCapture)]: false
      },
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kEndCalled)]: true,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype] {
        accept: [ 'Accept', 'application/json, text/plain, */*' ],
        'user-agent': [ 'User-Agent', 'axios/1.2.1' ],
        'accept-encoding': [ 'Accept-Encoding', 'gzip, compress, deflate, br' ],
        host: [ 'Host', 'itunes.apple.com' ]
      },
      [Symbol(errored)]: null,
      [Symbol(kUniqueHeaders)]: null
    },
    data: '<html><body><b>Http/1.1 Service Unavailable</b></body> </html>'
  }
}

Node.js v18.13.0
greendoescode commented 1 year ago

I believe this issue was just iTunes being unhappy, Can I close it?

sdasda7777 commented 1 year ago

Hey, I didn't get this error for some time now, so yeah, I guess it was solved somehow 😄