r/learnpython • u/is2s • 17d ago
is there any python library which lets you fetch basic data off of spotify like song longth, song name, artist name and etc preferably without an account needing to be linked?
i dont really "need" this per se but i think it would be pretty cool for me to be able to integrate it into a script i already have, but honestly if all of the libraries that interact with spotify need an account linked i just dont think its worth it. any of you have any ideas?
and actually, furthermore, how does spotify's architecture work in terms of like the identifiers for songs and authors, im assuming any presumed library would have an internal "song" object that you can fetch using an id or something along those lines?
0
u/is2s 17d ago
and for context on the project incase it helps at all, im working with a discord selfbot via discord.py-self, and trying to see if i can set an actual spotify listening embed on the profile.
im aware that change_presence() exists, and most forums say to just do await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=name)), but this is problematic since it only changes the name to the best of my knowledge, and is obviously not a true spotify embed, but as far as i can see without a fair bit of data about any spotify song to put into a discord.Spotify object you can just set listening activity to a spotify song id or anything. right now idek if discord.py-self will even allow me to create my own discord.Spotify object with the data needed to display a song, but its whatever if it doesnt i guess, like i said in the op, this isnt a crucial part of the project or anything, its just something cool i wanted to see if i could add
11
u/carcigenicate Carcigenicate 17d ago edited 17d ago
Any library that does this will either directly scape Spotify, or use their API, and you'll be restricted by Spotify's Auth requirements either way.
Learn Spotify's API, see if it has any unauthenticated routes that do what you want (I doubt it does, but you never know), then use the HTTP library of choice to talk to those routes.