Skip to content

A python program to listen along a Last.fm user with Spotify

Notifications You must be signed in to change notification settings

Hexalyse/LastFmListenAlong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

LastFmListenAlong

Description

LastFmListenAlong is a program made in Python, allowing you to listen along a Last.fm user, by playing the songs the user is listening to on Spotify, in real time.
It uses the Last.fm API to fetch what the user is listening to, and the Spotify API to search for the track on Spotify, and play it.

Configuration

First, you have to register an app on the Spotify developper page. Do not forget to whitelist a callback URL for the app (eg. http://localhost/). Note the API key and secret and populate it in the code.

Then you need to get an API key and secret on the Last.fm API page, and populate it in the code.

Dependencies

This program relies on the spotipy and pylast libraries. They also require requests. Install them with :

pip install spotipy
pip install pylast
pip install requests

Note that, at the date this program was created, the spotipy version installed by pip is a bit outdated and do not contain a method we need to play a song on Spotify.
You may need to get the last version of spotipy yourself here : plamere/spotipy and place it in the current directory (renaming it just "spotipy", so that Python can import it from the current dir when it's not installed system-wide).

Running

Once everything is configured, you just have to run the program with two parameters:

python listen.py lastfm_user_to_listen_along your_spotify_username

Blog article about it

If you're curious you can read a blog article on how I came up with this idea on my blog: here.

License

This program is released under no license. Do whatever you want with it. Share it, copy it, play with it, eat it.

About

A python program to listen along a Last.fm user with Spotify

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages