Mar 16th, 2015
Never
Loadapplicationkeyfile (filename=b'spotifyappkey.key') source ΒΆ Load your libspotify application key file. If called without arguments, it tries to read spotifyappkey.key from the current working directory. This is an alternative to setting applicationkey yourself. The file must be a binary key file, not the C code key file that can be. Rips Spotify URIs to MP3s with ID3 tags and album covers positional arguments: uri One or more Spotify URI(s) (either URI, a file of URIs or a search query) optional arguments: -h, -help show this help message and exit -S SETTINGS, -settings SETTINGS Path to settings, config and temp files directory Default=/.spotify-ripper -a, -ascii.
#Python Script Setup. To get the python script running, run either pip install flask or pip install -r requirements.txt if you used git clone to clone the gist #libspotifyembeddedshared.so notes. Click on the Binary link and download your key as a binary file (by default: spotifyappkey.key) Note: to get the application key you will need to have a Spotify Premium account. Run Multi Room Audio Player and go to Tools-Settings, open Spotify tab.
Not a member of Pastebin yet?Sign Up, it unlocks many cool features!
- root@Maiku:~/example# LD_DEBUG=libs LD_LIBRARY_PATH=./common/libspotify_embedde d_shared.so ./run spotify_appkey.key
- 25272: find library=libspotify_embedded_shared.so [0]; searching
- 25272: search path=./common/libspotify_embedded_shared.so/tls/v7l/neo n/vfp:./common/libspotify_embedded_shared.so/tls/v7l/neon:./common/libspotify_ embedded_shared.so/tls/v7l/vfp:./common/libspotify_embedded_shared.so/tls/v7l:. ./common/libspotify_embedded_shared.so/tls/neon/vfp:./common/libspotify_embedde d_shared.so/tls/neon:./common/libspotify_embedded_shared.so/tls/vfp:./common/l ibspotify_embedded_shared.so/tls:./common/libspotify_embedded_shared.so/v7l/neo n/vfp:./common/libspotify_embedded_shared.so/v7l/neon:./common/libspotify_embe dded_shared.so/v7l/vfp:./common/libspotify_embedded_shared.so/v7l:./common/lib spotify_embedded_shared.so/neon/vfp:./common/libspotify_embedded_shared.so/neon :./common/libspotify_embedded_shared.so/vfp:./common/libspotify_embedded_share d.so (LD_LIBRARY_PATH)
- 25272: trying file=./common/libspotify_embedded_shared.so/tls/v7l/ne on/vfp/libspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/tls/v7l/ne on/libspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/tls/v7l/vf p/libspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/tls/v7l/li bspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/tls/neon/v fp/libspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/tls/neon/l ibspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/tls/vfp/li bspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/tls/libspo tify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/v7l/neon/v fp/libspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/v7l/neon/l ibspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/v7l/vfp/li bspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/v7l/libspo tify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/neon/vfp/l ibspotify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/neon/libsp otify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/vfp/libspo tify_embedded_shared.so
- 25272: trying file=./common/libspotify_embedded_shared.so/libspotify _embedded_shared.so
- 25272: search path=/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp:/lib/arm- linux-gnueabihf/tls/v7l/neon:/lib/arm-linux-gnueabihf/tls/v7l/vfp:/lib/arm-linux -gnueabihf/tls/v7l:/lib/arm-linux-gnueabihf/tls/neon/vfp:/lib/arm-linux-gnueabih f/tls/neon:/lib/arm-linux-gnueabihf/tls/vfp:/lib/arm-linux-gnueabihf/tls:/lib/ar m-linux-gnueabihf/v7l/neon/vfp:/lib/arm-linux-gnueabihf/v7l/neon:/lib/arm-linux- gnueabihf/v7l/vfp:/lib/arm-linux-gnueabihf/v7l:/lib/arm-linux-gnueabihf/neon/vfp :/lib/arm-linux-gnueabihf/neon:/lib/arm-linux-gnueabihf/vfp:/lib/arm-linux-gnuea bihf:/usr/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp:/usr/lib/arm-linux-gnueabihf/ tls/v7l/neon:/usr/lib/arm-linux-gnueabihf/tls/v7l/vfp:/usr/lib/arm-linux-gnueabi hf/tls/v7l:/usr/lib/arm-linux-gnueabihf/tls/neon/vfp:/usr/lib/arm-linux-gnueabih f/tls/neon:/usr/lib/arm-linux-gnueabihf/tls/vfp:/usr/lib/arm-linux-gnueabihf/tls :/usr/lib/arm-linux-gnueabihf/v7l/neon/vfp:/usr/lib/arm-linux-gnueabihf/v7l/neon :/usr/lib/arm-linux-gnueabihf/v7l/vfp:/usr/lib/arm-linux-gnueabihf/v7l:/usr/lib/ arm-linux-gnueabihf/neon/vfp:/usr/lib/arm-linux-gnueabihf/neon:/usr/lib/arm-linu x-gnueabihf/vfp:/usr/lib/arm-linux-gnueabihf:/lib/tls/v7l/neon/vfp:/lib/tls/v7l/ neon:/lib/tls/v7l/vfp:/lib/tls/v7l:/lib/tls/neon/vfp:/lib/tls/neon:/lib/tls/vfp: /lib/tls:/lib/v7l/neon/vfp:/lib/v7l/neon:/lib/v7l/vfp:/lib/v7l:/lib/neon/vfp:/li b/neon:/lib/vfp:/lib:/usr/lib/tls/v7l/neon/vfp:/usr/lib/tls/v7l/neon:/usr/lib/tl s/v7l/vfp:/usr/lib/tls/v7l:/usr/lib/tls/neon/vfp:/usr/lib/tls/neon:/usr/lib/tls/ vfp:/usr/lib/tls:/usr/lib/v7l/neon/vfp:/usr/lib/v7l/neon:/usr/lib/v7l/vfp:/usr/l ib/v7l:/usr/lib/neon/vfp:/usr/lib/neon:/usr/lib/vfp:/usr/lib (system search path)
- 25272: trying file=/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp/libspoti fy_embedded_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/tls/v7l/neon/libspotify_e mbedded_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/tls/v7l/vfp/libspotify_em bedded_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/tls/v7l/libspotify_embedd ed_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/tls/neon/vfp/libspotify_e mbedded_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/tls/neon/libspotify_embed ded_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/tls/vfp/libspotify_embedd ed_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/tls/libspotify_embedded_s hared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/v7l/neon/vfp/libspotify_e mbedded_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/v7l/neon/libspotify_embed ded_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/v7l/vfp/libspotify_embedd ed_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/v7l/libspotify_embedded_s hared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/neon/vfp/libspotify_embed ded_shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/neon/libspotify_embedded_ shared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/vfp/libspotify_embedded_s hared.so
- 25272: trying file=/lib/arm-linux-gnueabihf/libspotify_embedded_share d.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp/libs potify_embedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/tls/v7l/neon/libspoti fy_embedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/tls/v7l/vfp/libspotif y_embedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/tls/v7l/libspotify_em bedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/tls/neon/vfp/libspoti fy_embedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/tls/neon/libspotify_e mbedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/tls/vfp/libspotify_em bedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/tls/libspotify_embedd ed_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/v7l/neon/vfp/libspoti fy_embedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/v7l/neon/libspotify_e mbedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/v7l/vfp/libspotify_em bedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/v7l/libspotify_embedd ed_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/neon/vfp/libspotify_e mbedded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/neon/libspotify_embed ded_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/vfp/libspotify_embedd ed_shared.so
- 25272: trying file=/usr/lib/arm-linux-gnueabihf/libspotify_embedded_s hared.so
- 25272: trying file=/lib/tls/v7l/neon/vfp/libspotify_embedded_shared.s o
- 25272: trying file=/lib/tls/v7l/neon/libspotify_embedded_shared.so
- 25272: trying file=/lib/tls/v7l/vfp/libspotify_embedded_shared.so
- 25272: trying file=/lib/tls/v7l/libspotify_embedded_shared.so
- 25272: trying file=/lib/tls/neon/vfp/libspotify_embedded_shared.so
- 25272: trying file=/lib/tls/neon/libspotify_embedded_shared.so
- 25272: trying file=/lib/tls/vfp/libspotify_embedded_shared.so
- 25272: trying file=/lib/tls/libspotify_embedded_shared.so
- 25272: trying file=/lib/v7l/neon/vfp/libspotify_embedded_shared.so
- 25272: trying file=/lib/v7l/neon/libspotify_embedded_shared.so
- 25272: trying file=/lib/v7l/vfp/libspotify_embedded_shared.so
- 25272: trying file=/lib/v7l/libspotify_embedded_shared.so
- 25272: trying file=/lib/neon/vfp/libspotify_embedded_shared.so
- 25272: trying file=/lib/neon/libspotify_embedded_shared.so
- 25272: trying file=/lib/vfp/libspotify_embedded_shared.so
- 25272: trying file=/lib/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/tls/v7l/neon/vfp/libspotify_embedded_shar ed.so
- 25272: trying file=/usr/lib/tls/v7l/neon/libspotify_embedded_shared.s o
- 25272: trying file=/usr/lib/tls/v7l/vfp/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/tls/v7l/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/tls/neon/vfp/libspotify_embedded_shared.s o
- 25272: trying file=/usr/lib/tls/neon/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/tls/vfp/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/tls/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/v7l/neon/vfp/libspotify_embedded_shared.s o
- 25272: trying file=/usr/lib/v7l/neon/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/v7l/vfp/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/v7l/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/neon/vfp/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/neon/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/vfp/libspotify_embedded_shared.so
- 25272: trying file=/usr/lib/libspotify_embedded_shared.so
- ./run: error while loading shared libraries: libspotify_embedded_shared.so: cann ot open shared object file: No such file or directory
![Spotify appkey.key downloader Spotify appkey.key downloader](/uploads/1/3/3/8/133868451/882027795.jpg)
RAW Paste Data
TL;DR: If you have a premium subscription to Spotify, you can develop third-party Spotify applications with Python, libspotify, and the pyspotify bindings. Install pyspotify 2.x from GitHub (documentation is here), the one in PyPi is stale. I created a tool that takes a CSV file of
Artist,Title
entries and creates a playlist in Spotify. You can find the source code on GitHub.I'm a big fan of Spotify. I use Spotify at home, at work, in the gym, in the car, at coffee shops, on airplanes, and anywhere else you can imagine listening to music. I pay $9.99/month (at time of writing) for the premium subscription which allows you to sync playlists and stream music, commercial-free, to any device. Another perk of the premium subscription is ability to use libspotify to create third-party Spotify applications.
I recently wanted to create a playlist in Spotify from a CSV file consisting of about 250
Artist,Title
entries. Unfortunately, there is no 'Import from CSV File' menu item in the Spotify application..I checked. This means I had to either (a) create a playlist, search for each song one-by-one, find the best match, and add it to the playlist or (b) get creative and write a script to do it for me. I knew this could be accomplished with a small program and using libspotify could make it possible with minimal effort. In the interest of getting it done quickly, I opted to use Python. A quick search for Python-to- libspotify bindings turned up pyspotify.After some experimenting, I managed to piece together a 'working' prototype. I won't show you that code; it crashed occasionally, everything was hard-coded, and it was very much a 'one off' script..but it did the job. Briefly, here's how it works: first a session is created and the user is logged in. For each
Artist,Title
entry in the input CSV file, the Spotify song database is queried. Each query will return zero or more matching tracks. The track that best matches (if any) is added to a list. Finally, a playlist is created and the matching tracks are added to the playlist.For the prototype, I used the version of pyspotify available in PyPi, version 1.11. A majority of this version was written in C and hence must be tediously maintained to work correctly with each version of libspotify on each platform. Version 2.x of pyspotify is written completely in Python, and uses CFFI, the Foreign Function Interface for Python calling C code. Given access to C source code that defines the data structures and functions of a library, CFFI can automatically generate Python bindings. This reduces the likelihood of programming mistakes, and allows the developers of a binding to focus on making it more Pythonic. Another benefit of using CFFI is that if a feature becomes available in the library it will be immediately available to a programmer in Python, albeit without a Pythonic interface. pyspotify 2.x is being actively maintained and has implemented Pythonic support for a majority of the libspotify interfaces (of course all the underlying libspotify API are available), and has some great documentation, but unfortunately lacks quality examples. You can find pyspotify version 2.x on GitHub.
I decided to re-write my tool using pyspotify version 2, making it more robust. Hopefully it can be a helpful example to others who want to do something with Spotify in Python using pyspotify. You can find the source code here.
Spotify Appkey.key Downloader
I developed the tool on Mac OS X 10.9 (Mavericks) using the factory-installed Python 2.7.5. It should work out-of-the-box on other platforms, but I haven't tested it.
How to Run the Tool on Mac OS X 10.9
Install libspotify
libspotify is freely available from the Spotify developer website for a number of platforms. For OS X, it's most conveniently installed using the Homebrew package manager.
$ brew install libspotify
Install pyspotify
The version of pyspotify on PyPi is 1.11, so unfortunately
pip
is not going to help us here. Free download playlist spotify. We must download the package directly and install it.Tip: For those familiar with Virtual Python Environments, now would be a good time to create one. I may cover this later but for now I'll keep it simple. For those unfamiliar, don't worry, it isn't required (but do read up on it).
$ cd ~$ git clone https://github.com/mopidy/pyspotify.git$ cd pyspotify$ python setup.py install
Download the Project
$ git clone https://github.com/mborgerson/spotify-playlist-from-csv.git$ cd spotify-playlist-from-csv
Download Your libspotify API Key
Spotify_appkey.key Download
Download your API key in binary format and save it as spotify_appkey.key place it in the spotify-playlist- from-csv directory.
Run the Tool
You can see the program help by passing the
--help
argument.Spotify Appkey.key Downloads
```$ python main.py -husage: main.py [-h] [-p] file name
Builds a playlist in Spotify by searching for tracks from a CSV file withArtist, Song entries.
Spotify premium 2 months free trial. https://naviclever193.weebly.com/spotify-launcher-download.html. positional arguments: file Input CSV file name Name of the playlist to create
optional arguments: -h, --help show this help message and exit -p Re-login using the previous credentials```