Open karastoyanov opened 1 year ago
I've been looking for some Python API and come across this: https://pypi.org/project/tekore/
Last update: 80cbb9beb897f25d595143ff86a52abc1c717d30
spotify_test script is a test function for Authentication and running test search for a specific song
@the-adventurist TODO:
spotify_test
script to receive specific Artist/Album/Song...and find it on SpotifyI tried several times to find a way to implement play /pause actions and some of that points but all my attempts failed. I searched in the documentation on "Spotify", particularly in the "examples" section, and also watched videos on youtube about this library but nowhere did I find code that does these actions. All examples of code with this library are about creating, and manipulating playlists and so on.
Last update: 6d8466285b6d38f9e2df808c672fe60602b2b44a 83863c081e8872aec84eb9dd8f906e781b34c01a
Spotify search and play songs functionality implemented. Try to finish the rest of the functions -> stop, next/previous track, play on repeat
def play_track(search):
result = sp.search(search, limit=1, type='track')
pattern = r'https:\/\/open.spotify.com\/track\/\d\w{1,}'
result = re.findall(pattern, str(result))
#print(result)
sp.start_playback(uris = result)
def stop_track():
pass
def next_track():
pass
def previous_track():
pass
def play_on_repeat():
pass