this post was submitted on 29 Sep 2023
11 points (69.0% liked)

Linux

48655 readers
1510 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

[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!

top 9 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 1 year ago (1 children)

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.

[–] [email protected] 1 points 1 year ago

damn! thank you!

[–] Qvest 3 points 1 year ago* (last edited 1 year ago) (1 children)

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

[–] [email protected] 1 points 1 year ago* (last edited 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

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[–] [email protected] 0 points 1 year ago (1 children)

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)

[–] [email protected] 2 points 1 year ago

The goddamn hippies and artists are everywhere! /S

[–] [email protected] 1 points 1 year ago (1 children)

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

[–] [email protected] 1 points 1 year ago

thank you verymuch for telling me about this. I will give it a go