[SOLVED] Solution: https://lemmy.ml/comment/4317564


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

  1. Not download any songs multiple times by comparing the files you are trying to download with the songs you have downloaded already.
  2. Add the songs’ URL to the Archieve_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!

  • AnEilifintChorcra@sopuli.xyz
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    https://github.com/zotify-dev/zotify its python not bash but may be helpful, also it downloads the files from Spotify instead of YouTube.

    I know it checks the playlist folder to see if its already downloaded each song but I’m not sure if it checks other folders too, but it should be easy enough to edit yourself to make it do that.

  • iHUNTcriminals@lemm.ee
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    People down voting this one too. Capitalist Musicians. If they wouldn’t give it away free because the world needs it, then it must not have actually been worth anything.

    • Anonymous_TorPerson@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      1 year ago

      Capitalist Musicians

      haha… good one. If you are serious, I doubt if we have that many musicians in here (I mean, not enough to manipulate the voting system so badly at least)

  • Qvest@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    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 as yt-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 using yt-dlp flags to convert the mp4 or webm files into mp3 or other

    I 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

    • Anonymous_TorPerson@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      edit-2
      1 year ago

      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.

      (I might not know what I am talking about, feel free to criticize). And I tried downloading from Spotify directly using yt-dlp.

      it’s possible.

      https://paste.debian.net/plain/1293528

  • Kotton@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    If you have an android, you should just use spotiflyer and then just move them to your pc