SwapnilSoni1999/spotify-dl

Possible to download Podcasts

domdewom opened this issue · 15 comments

Q:
Been trying to use your npm package to download Podcast episodes, but this doesnt seem to work. Songs work, podcasts dont. Wondering if this has anything to do with authenticating? To be honest I am not entirely sure how the authenticating process really works...

what is the issue your facing? like is there an error or does it just download the wrong thing?

No matter which episode I am trying to go for it spits out this:

ℹ Starting processing of episode (https://open.spotify.com/episode/5W5ri5RpcIKGztUTo0s3Ls)
ℹ extracting episode set 1/1
ℹ Generating new access token
✖ Failed to find episode, you may need to use auth
✔ Finished!

So it seems to find the episode but cannot download it... For songs it seems to work.

from memory podcasts required auth to be able to extract the api information about them, it might even have needed a spotify premium. but first try auth (--login)

How to go about it? All I get is this:

~ % spotifydl --login
⠋ Searching… Please be patient :)
See spotifydl --help for instructions
~ %

I am not entirely sure how to use auth or login for that matter...

sorry provide --login with the url of the thing you want so
spotifydl --login "https://open.spotify.com/episode/5W5ri5RpcIKGztUTo0s3Ls"

this should open spotify in another window to provide auth

Oh that works. Awesome! Thanks heaps.

Curious is there a way that it doesnt need to open a browser window each time? Like can I save the Spotify credentials somehow?

checkout the readme ;)

To use --u and --p (headless login) you must do a --l once first to grant required permissions (playlists, saved songs ect.)

Good point. Thanks for your help.

Actually one last question, been trying to use pipedream workflows to automatically download songs or podcast episodes from Spotify but somehow I seem to have issues getting it to work within the node.js environment. Seems to have issues with ffmpeg as well as the auth/access token. Any tips?

you could use docker instead as that would avoid the OS side of things, from memory if you've already done the -l it should keep working with -u and -p for a while, and then just ran it manually to reauth when the tokens expire (2 weeks i think?)

It seems Pipedream doesnt support docker - sadly enough, would make things so much easier. Is there any way I could import your awesome library within a node.js code block in Pipedream and call it up from there? How would I go about it? Is there a way? Thanks heaps!

i had a quick look and if they dont let you install packages not much can be done but

https://pipedream.com/docs/code/bash/#available-binaries

Unfortunately it is not possible to install packages from a package manager like apt or yum.

If you need a package pre-installed in your Bash steps, [just ask us](https://pipedream.com/support)

but maybe you can ask them to include ffmpeg in bash, but even then i think youll be stuck at the auth token stage anyway

As far as I understand you can import any kind of npm package, so I did manage to import ffmpeg via

import ffmpeg from "fluent-ffmpeg"; import ffmpegInstaller from "@ffmpeg-installer/ffmpeg"; ffmpeg.setFfmpegPath(ffmpegInstaller.path, {timeout: 60000});

Also the the auth token part should work given there is an integration with Spotify via predefined components:

export default defineComponent({ props: { spotify: { type: 'app', app: 'spotify' } }

Also I played around with other spotify download npm packages, such as this one. This one works for songs but not for podcast episodes sadly enough. Hence I have been trying to make it work with your awesome little package.

So essentially the part I am no clear on is how I would talk to your npm package. Is there a specific class/object I should import? I went through the structure of your code trying to understand how it works and I get it first goes through the setup part and then runner... I am trying to understand how I could just directly setup ffmpeg and pipe in the Spotify Auth token and then call up the download episode function? Super appreciative of any help :-)

ah i get you, atm its not really tailored towards being used in a non cli context. but a starting point would be looking at the https://github.com/SwapnilSoni1999/spotify-dl/blob/master/cli.js,

then replicating the arguments VIA argv maybe? if i get time ill look into giving it a try non cli but no promises

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale commented

This issue has been automatically closed as stale due to lack of activity, Please reopen if you think this needs to be