AlenVelocity/spotifydl-core

Doesnt work for podcasts?

domdewom opened this issue · 1 comments

Is it possible that the downloadTrack or even getTrack function doesnt work for podcast episodes? It seems to be returning an error. It does work for songs. But with podcasts it is trying to turn the url into spotify:track:... format which I believe is not working given that podcasts usually go by spotify:episode:... format. Is that possible? See below?

WebapiRegularError
An error occurred while communicating with Spotify's Web API. Details: Non existing id: 'spotify:track:5W5ri5RpcIKGztUTo0s3Ls'.

DETAILS

at null._toError (/tmp/__pdg__/dist/code/c28e27d6a25b09bce2d35455b1cc286b7c04602e0df962c83b5277bb90ab169d/node_modules/.pnpm/spotify-web-api-node@5.0.2/node_modules/spotify-web-api-node/src/http-manager.js:39:12)
 at null.null (/tmp/__pdg__/dist/code/c28e27d6a25b09bce2d35455b1cc286b7c04602e0df962c83b5277bb90ab169d/node_modules/.pnpm/spotify-web-api-node@5.0.2/node_modules/spotify-web-api-node/src/http-manager.js:71:25)
 at Request.Request.callback (/tmp/__pdg__/dist/code/c28e27d6a25b09bce2d35455b1cc286b7c04602e0df962c83b5277bb90ab169d/node_modules/.pnpm/superagent@6.1.0/node_modules/superagent/lib/node/index.js:905:3)
 at null.null (/tmp/__pdg__/dist/code/c28e27d6a25b09bce2d35455b1cc286b7c04602e0df962c83b5277bb90ab169d/node_modules/.pnpm/superagent@6.1.0/node_modules/superagent/lib/node/index.js:1127:20)
 at IncomingMessage.null (/tmp/__pdg__/dist/code/c28e27d6a25b09bce2d35455b1cc286b7c04602e0df962c83b5277bb90ab169d/node_modules/.pnpm/superagent@6.1.0/node_modules/superagent/lib/node/parsers/json.js:22:7)
 at Stream.emit (events.js:400:28)
 at Unzip.null (/tmp/__pdg__/dist/code/c28e27d6a25b09bce2d35455b1cc286b7c04602e0df962c83b5277bb90ab169d/node_modules/.pnpm/superagent@6.1.0/node_modules/superagent/lib/node/unzip.js:53:12)
 at Unzip.emit (events.js:400:28)
 at null.endReadableNT (internal/streams/readable.js:1333:12)
 at process.processTicksAndRejections (internal/process/task_queues.js:82:21)

My assumption is it calls getTrack also for Podcast Episodes instead of calling getEpisodes in the Spotify web api. Is that correct??

/**
   * Look up an episode.
   * @param {string} episodeId The episode's ID.
   * @param {Object} [options] The possible options, currently only market.
   * @param {requestCallback} [callback] Optional callback method to be called instead of the promise.
   * @example getEpisode('3Qm86XLflmIXVm1wcwkgDK').then(...)
   * @returns {Promise|undefined} A promise that if successful, returns an object containing information
   *          about the episode. Not returned if a callback is given.
   */
  getEpisode: function(episodeId, options, callback) {
    return WebApiRequest.builder(this.getAccessToken())
      .withPath('/v1/episodes/' + episodeId)
      .withQueryParameters(options)
      .build()
      .execute(HttpManager.get, callback);
  },