I am doing all of this using ChatGPT, I know enough bash to understand the script partially, but not enough to write the script myself.
I recently posted bash script(click) to download songs on spotify
using Spotdl
Updated Post
This is all good, but I am not trying to download whole playlists and I want to make sure to
- Not download any songs multiple times by comparing the files you are trying to download with the songs you have downloaded already.
- Add the songs’
URL
to theArchieve_file
so it doesn’t download it again. i.e., compare and if present, exit loop, if not present in file, download and add link to the file.
This was easier when I was dealing with only song
links and not playlist
links. But now, playlists complicates the equation, but if I can achieve this, I can basically add this script to crontab
and make sure I always have a local copy of the songs in my playlist and these playlists would be checked regularly for new downloads and new songs would be downloaded. This is really cool!
Now, the complications I am facing,
I don’t know how to get the URLs of the spotify songs
out of spotify playlists
using spotdl
or any cli package. If I can do this then, I can make the script go through each link clean
the link of unncessary attributes and then download it or if it’s downloaded already, move on to the next song.
Now, I don’t know how to do it. It would be very helpful if you guys could share any scripts that you have which will achieve this effect or help me get the song URL’s from a playlist using a cli package.
PS: I might need some time to reply, I might sleep rn Thank you for your help!
I don’t think downloading directly from Spotify is possible, considering they have DRM (I might not know what I am talking about, feel free to criticize). And I tried downloading from Spotify directly using
yt-dlp
.That said,
spotdl
seems to only download from YouTube (which is not DRM protected). So what I would recommend you do is ignore ChatGPT and use a well-known tool (such asyt-dlp
) in the terminal. It is as intuitive as it gets and it does not require you to do scripting (unless you want to). And find (or create) a playlist using your YouTube account and download that usingyt-dlp
flags to convert themp4
orwebm
files intomp3
or otherI think the docs will have what you’re looking for: https://github.com/yt-dlp/yt-dlp#usage-and-options and if not, good ol’ internet search is a couple keystrokes away
edit: oh F, I didn’t read it completely. You lost me at it’s not possible, but now after having read it, you might have a point.
it’s possible.
https://paste.debian.net/plain/1293528