All Projects → SwagLyrics → Swspotify

SwagLyrics / Swspotify

Licence: mit
Cross-platform library to get the currently playing song and artist from Spotify w/o using the API or the internet. Very fast.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Swspotify

Spotlightify
The Spotify overlay controller
Stars: ✭ 190 (+251.85%)
Mutual labels:  spotify, cross-platform
Mbspotify
MusicBrainz Spotify integration hack for SF Music Hack Day 2014
Stars: ✭ 50 (-7.41%)
Mutual labels:  spotify
Coreutils
Cross-platform Rust rewrite of the GNU coreutils
Stars: ✭ 9,603 (+17683.33%)
Mutual labels:  cross-platform
Redasm
The OpenSource Disassembler
Stars: ✭ 1,042 (+1829.63%)
Mutual labels:  cross-platform
Mitsuhaxi
Universal iOS 11 audio visualizer
Stars: ✭ 44 (-18.52%)
Mutual labels:  spotify
Lyrics Crawler
Get the lyrics for the song currently playing on Spotify
Stars: ✭ 49 (-9.26%)
Mutual labels:  spotify
Reactnativecodereuseexample
Shows how to organize your code to reuse it as much as possible between Web, iOS and Android
Stars: ✭ 41 (-24.07%)
Mutual labels:  cross-platform
Audio player flutter
🎧 Apple Music / Tidal Audio Player for Flutter
Stars: ✭ 52 (-3.7%)
Mutual labels:  cross-platform
Shadowsocks Qt5
A cross-platform shadowsocks GUI client
Stars: ✭ 7,893 (+14516.67%)
Mutual labels:  cross-platform
Museeks
🎵 A simple, clean and cross-platform music player
Stars: ✭ 1,030 (+1807.41%)
Mutual labels:  cross-platform
Homebrew Public
Homebrew formula for open-source software developed by Spotify
Stars: ✭ 45 (-16.67%)
Mutual labels:  spotify
Blinkid Cordova
ID scanning for cross-platform apps built with Cordova and Phonegap.
Stars: ✭ 44 (-18.52%)
Mutual labels:  cross-platform
Capacitor Plugins
Official plugins for Capacitor ⚡️
Stars: ✭ 49 (-9.26%)
Mutual labels:  cross-platform
Keychain
A cross-platform wrapper for the OS credential storage
Stars: ✭ 43 (-20.37%)
Mutual labels:  cross-platform
Spocon
SpoCon - A Spotify Connect Client for Debian , Ubuntu and Raspberry Pi based on librespot-java
Stars: ✭ 51 (-5.56%)
Mutual labels:  spotify
Scplayer
Open source client of Spotify Connect closed library developed in Java
Stars: ✭ 41 (-24.07%)
Mutual labels:  spotify
Dnsforwarder
Just a DNS utility.
Stars: ✭ 1,029 (+1805.56%)
Mutual labels:  cross-platform
Counsel Spotify
Control Spotify App through Emacs
Stars: ✭ 49 (-9.26%)
Mutual labels:  spotify
Tus Resumable Upload Protocol
Open Protocol for Resumable File Uploads
Stars: ✭ 1,070 (+1881.48%)
Mutual labels:  cross-platform
Plog
Portable, simple and extensible C++ logging library
Stars: ✭ 1,061 (+1864.81%)
Mutual labels:  cross-platform

SwSpotify

Discord Server Build Status Build status codecov PyPI Downloads

SwSpotify is a Python library to get the song and artist of the currently playing song from the Spotify application faster and without using the API. It works on Windows, Linux, macOS and even the Spotify Web Player! 🥳

In order to add support for the Spotify Web Player, the SwagLyrics Chrome Extension needs to be installed. We have plans to extend this for other browsers as well.

If you're a developer using SwSpotify, you can direct your end users to install the extension to automatically make your application work with the Spotify Web Player. The source of the Chrome Extension is open sourced at https://github.com/SwagLyrics/SwagLyrics-Chrome-Extension.

The original repository was spotilib which worked just for Windows and hasn't been updated since a long while when it broke on account of Spotify updating their application.

Originally made for use in SwagLyrics for Spotify.

Installation

Requires Python3. Use pip or pip3 depending on your installation. You might want to use the --user flag on Linux to avoid using pip as root.

pip install SwSpotify

For linux you need dbus which is usually pre-installed.

Usage

Use it in your project by importing it as:

from SwSpotify import spotify

Then you can access the song and artist as:

>>> spotify.song()
'Hello'
>>> spotify.artist()
'Adele'

Since mostly song and artist are used in conjunction, there is a current() method as well.

>>> spotify.current()
('Hello', 'Adele')

This allows you to access song and artist by tuple unpacking as:

>>> song, artist = spotify.current()

A SpotifyNotRunning Exception is raised if Spotify is closed or paused. SpotifyClosed and SpotifyPaused inherit from SpotifyNotRunning, meaning that you can catch both at the same time:

try:
    title, artist = spotify.current()
except SpotifyNotRunning as e:
    print(e)
else:
    print(f"{title} - {artist}")

In case Spotify is closed or paused, that will automatically be reflected in the value of e.

For finer control you can catch SpotifyClosed and SpotifyPaused separately.

Compiling SwSpotify for Development

  • Clone the repo by git clone https://github.com/SwagLyrics/SwSpotify.git or use ssh.
  • cd into the cloned repo.
  • pip install -e . the -e flag installs it locally in editable mode.

Contributing

Sure, improvements/fixes/issues everything is welcome :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].