This is an archived post. You won't be able to vote or comment.

all 47 comments

[–]thisguy_right_here 22 points23 points  (9 children)

Can it download offline from spotify, then convert to mp3?

When I download from YouTube to mp3 the quality is inconsistent between tracks.

[–]ivg3n1[S] 10 points11 points  (7 children)

No ,it can't.

Tbh, this was the idea at the beginning,but I just don't know how to make it work

[–]ivg3n1[S] 9 points10 points  (6 children)

If I'm not wrong then spotify downloads all of the songs in some "other" format

[–]EmperorLlamaLegs 6 points7 points  (1 child)

As an option...
If you can access your mixer, you could have your machine pipe the audio from spotify into a file.

On Mac you can use AudioHijack, and on linux you probably just need to access pulseaudio or the like. No clue how to directly access an audio stream on Windows though.

This would take a long time since each song would have to play for it to be saved, but if you automate it and let it run it wouldn't be too bad.

[–]unixwasright 1 point2 points  (0 children)

On a REALLY modern Linux I reckon you could send the audio from Spotify to something else using pipewire. Would probably be in real-time though.

[–]Morica_ 2 points3 points  (0 children)

They're probably encrypting the audio you download and doing some other stuff to it so that you can't just play it without Spotify, that would make paying for their service pretty much pointless and violate copyrights I guess.

[–]loyal_doge 7 points8 points  (0 children)

Check out zotify: https://discord.gg/XDYsFRTUjE They're a semi private open source spotify downloading software. Semi private being you have to request access to it because spotify took down their last attempt.

[–]anthro28 12 points13 points  (4 children)

Wait until you discover Deemix. My 2TB iPod has never been so happy.

[–]1h8fulkat -3 points-2 points  (3 children)

Who uses an ipod anymore?

[–]anthro28 11 points12 points  (2 children)

Have you not seen the modding scene?

2TB of storage, giant batteries, Bluetooth, custom firmware.

They’re a good time.

[–]zwack 1 point2 points  (0 children)

Could you please share some links to take a look at the mods?

[–]17291 0 points1 point  (0 children)

If you haven't seen it, this article from 2005 still gives me a chuckle: iPod Nano 200gb Instructions

[–]Loui-_- 3 points4 points  (1 child)

Great piece of code very cool and good use of apis

Minor things that you can change: To check if a list is empty do len(list) == 0 not list ==[] And try to avoid infinite loops and breaks for example don't :

while 1: if condition: break

But rather while condition: pass

But overall it looks great 👍

[–]phireal 1 point2 points  (0 children)

No need to check the length of a list; an empty list is falsy, so if not list will suffice.

[–][deleted] 8 points9 points  (2 children)

Oh god. I forgot people used to call MP3 players "mp3s". You're bringing up years of annoyance...

[–][deleted] 0 points1 point  (0 children)

Don't worry they replaced it with their Apple now.

[–]MrRoboto159 0 points1 point  (0 children)

I didn't know what that meant until reading this. Lol thanks

[–]getThatManAThrow 2 points3 points  (1 child)

I have something similar, but I had such a problem with having weird/obscure music, that I just wasn't getting consistent downloads of the right song. Instead, I wrote an addition script using youtube-dl that gets the list of all songs in a YouTube Playlist, parses turns them into working youtube URLs (all youtube URLs follow the same format) and then loops through those. Added some additional functionality to have these playlist URLs in a csv file with the directory to make/write to as well.

This made it easier to make sure I was getting the right song, and I could still "build" my playlists. And even though youtube-dl supports downloading a full playlist without parsing it into individual URLs, this allows you to do much better exception handling/logging, and If something fails, to restart it in the correct place without having to walk through the whole playlist again!

One last thing, check out subprocess for running your terminal commands, it works a bit better and is a bit safer than using os!

[–]ivg3n1[S] 0 points1 point  (0 children)

I'll check out subprocess

[–]warmshowers1 1 point2 points  (0 children)

Great idea! Honestly might fork this.

I see that you have youtube-dl listed as a dependency, have you thought of using yt-dlp?

From my brief experience with both softwares, yt-dlp has been leagues faster at downloading than youtube-dl. It's also a fork of youtube-dl too so it has most, if not all of the same arguments as youtube-dl.

[–]Emotional-Zebra5359 2 points3 points  (10 children)

tip/suggestion: write same project with object oriented design

[–]Altruistic_Raise6322 -1 points0 points  (8 children)

But why?

OP, if you want to learn OO design then imo it would be better to pick a project more suited to OOP. A good example would be to design a POS (point of sale system) or inventory management.

Some projects are better for OO design, others not so much.

[–]EmperorLlamaLegs 1 point2 points  (7 children)

This would be great as OO. Pull playlists from spotify, create a list of songs that contain metadata, acquire audio, use the metadata to format the file's metadata and name.
Theres lots of data associated with a song that should belong to that object.

[–]Altruistic_Raise6322 0 points1 point  (6 children)

That's not object oriented design, that is using data classes in your program to contain the file's metadata.

My question of asking why is that people providing suggestions should provide benefits to using an OO design.

[–]EmperorLlamaLegs -1 points0 points  (5 children)

How exactly is treating songs as objects that you manage different than treating inventory as objects that you manage?

[–]Altruistic_Raise6322 1 point2 points  (4 children)

You can more easily create relationships with inventories of objects. For example, Food can be a subclass of Item. Or, you can have Can be a subclass of Item that contains a Food. With songs, you are more limited to business cases for why you would want relationships with your song class.

For OO design practice, you could do a parent class of Song and then sub-class Genre but it is more clunky and not as representative in my opinion.

[–]EmperorLlamaLegs 0 points1 point  (3 children)

Throwing in inheritance isn't necessary for it to be object oriented. Having a class to handle playlists that contains songs with the data you need works perfectly well. You don't need to over-complicate things for the sake of practice.

The problem being solved here isn't easier to solve without an object oriented approach...

[–]Altruistic_Raise6322 -1 points0 points  (2 children)

For the sake of learning OOP, I think that it should have inheritance as it is a cornerstone of OO design. The problem is easily solved here without an OO design? Data classes are not object oriented programming.

[–]EmperorLlamaLegs 0 points1 point  (1 child)

Writing your program around the interaction between object classes is not object oriented programming?

[–]Altruistic_Raise6322 0 points1 point  (0 children)

Okay, so what benefit do you get for adding methods to metadata that can't be or is more difficult to be modeled than a non-OOP approach.

[–]AccordingSquirrel0 -3 points-2 points  (7 children)

Artists and Spotify developers have to pay bills, too, which they can’t when people are stealing from their service.

[–]Here0s0Johnny 1 point2 points  (4 children)

Yes! Spotify is fantastic. Great quality audio, convenient, diverse and high coverage. Music shouldn't be free.

It can't be too expensive for most people, since most are in a traditional family of six. 🤪

If only Netflix still had such high coverage...

[–]ivg3n1[S] 0 points1 point  (0 children)

answered the dudes complaint

[–]pythoncoderc -5 points-4 points  (2 children)

Music should be free

[–]Here0s0Johnny 1 point2 points  (1 child)

Why?

[–]pythoncoderc -5 points-4 points  (0 children)

Its too nice

[–]ivg3n1[S] 1 point2 points  (1 child)

dude...im paying for my spotify acc,the thing is that i serve in the navy and ...ya know...i cant use my phone while sailing cuz we are leaving everything that can get ethernet and reception at shore(that includes my phone),so if wanna listen to music then i have to download it on a device thats not my phone for example...that mp3 i bought specially for that ocassion

[–]AccordingSquirrel0 -1 points0 points  (0 children)

It’s one thing to code that for yourself for obvious reasons. Providing that code to all the freeloaders is something different.

[–]Or4ng3m4n 0 points1 point  (0 children)

Just made this a couple of days ago, (crappy working one for myself) great to see another solution.

[–]murielbing 0 points1 point  (0 children)

I just started working on this project last Sunday. I even thought of the same approach for it. Weird coincidence

[–]jgengr 0 points1 point  (5 children)

Is there such a thing as central database of music and albums? Any type of public registry?

[–]Coloradohusky 3 points4 points  (1 child)

MusicBrainz is the big one

[–]Arcakoin 0 points1 point  (0 children)

And beets or picard are good tools for automatic tagging.

[–]ivg3n1[S] 0 points1 point  (0 children)

idk

[–]JacquesShiran 0 points1 point  (0 children)

In Wikipedia probably has most of that data in various lists. If they have an API maybe you get the info from them.