Skip to main content

Spotify Music Videos

travis

A simple tool to show Youtube music videos and lyrics for the currently playing Spotify songs with VLC.

example

Requirements

  • Python 3.6+
  • VLC

For Linux users:

  • PyGI (not packaged on PyPi, you need to install it from your distribution's repository - it's usually called python-gi, python-gobject or pygobject). Here's a quick tutorial on how to install it on most systems.

  • GLib. You most likely have it installed already.

How to install

You can use pip to install it:

pip3 install spotify-videos

Or download the latest release. Uncompress the .tar.gz file and run inside the folder:

python3 ./setup.py install

Note: you can add the --user flag to install it locally.

Or you can just run it without installing it with:

python3 -m spotify_videos

Compatibility

For Windows and Mac users, the Spotify Web API will be used. This means that:

  • You have to sign in and set it up manually
  • Only Spotify Premium users are able to use some functions
  • API calls are limited to 1 per second so there is more lag

How to obtain your client ID and your client secret:

  1. Go to the Spotify Developers Dashboard
  2. Create a new client ID. You can fill the descriptions as you like. Click No when asked if it's a commercial integration and accept the Terms and Conditions in the next step.
  3. Go to Edit Settings and type http://localhost:8888/callback/ in the Redirect URIs field.
  4. You can now copy your Client ID and Client Secret and add them when you call spotify-videos by passing them as arguments or by exporting the enviroment variables so that you don't have to type them again:
    • spotify-videos --username your_username --client-id your_client_id --client-secret your_client_secret
    • export SPOTIPY_CLIENT_ID='your-spotify-client-id'; export SPOTIPY_CLIENT_SECRET='your-spotify-client-secret'

You may be prompted to paste the resulting link that was opened in your browser into the program. After doing it, the authorization process will be complete. The auth info should be kept in a cache file named .cache-[your_username]

How to use

You can use these flags to modify the behavior of the program:

usage: spotify-videos [-h] [-v] [--debug] [-n] [-f] [-a VLC_ARGS]
                      [--width MAX_WIDTH] [--height MAX_HEIGHT] [-w]
                      [--username USERNAME] [--client-id CLIENT_ID]
                      [--client-secret CLIENT_SECRET]

Windows and Mac users must pass --username, --client-id and --client-secret to
use the web API. Read more about how to obtain them in the README
(https://github.com/marioortizmanero/spotify-music-videos).

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --debug               display debug messages
  -n, --no-lyrics       do not print lyrics
  -f, --fullscreen      play videos in fullscreen mode
  -a VLC_ARGS, --args VLC_ARGS
                        other arguments used when opening VLC. Note that some
                        like args='--fullscreen' won't work in here
  --width MAX_WIDTH     set the maximum width for the played videos
  --height MAX_HEIGHT   set the maximum height for the played videos
  -w, --use-web-api     forcefully use Spotify's web API
  --username USERNAME   your Spotify username. Mandatory if the web API is
                        being used. Example: --username='yourname'
  --client-id CLIENT_ID
                        your client ID. Mandatory if the web API is being
                        used. Check the README to see how to obtain yours.
                        Example: --client-
                        id='5fe01282e44241328a84e7c5cc169165'
  --client-secret CLIENT_SECRET
                        your client secret ID. Mandatory if the web API is
                        being used. Check the README to see how to obtain
                        yours. Example: --client-
                        secret='2665f6d143be47c1bc9ff284e9dfb350'

Current limitations:

  • Spotify doesn't currently (15/07/19) support the MPRIS property Position so the starting offset is calculated manually and may be a bit rough.
  • Spotify's Web API doesn't allow function calls on updates like DBus, meaning that the metadata has to be manually updated every second and checked in case of changes.

Documentation

Helpful documentation links for contributing:

Running module locally:

python -m spotify_videos

Running tests with unittest:

python -m unittest or python -m unittest discover -s tests

Release files for spotify-videos 1.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spotify-videos 1.7.1
File Size Uploaded
spotify-videos-1.7.1.tar.gz 24.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spotify-videos 1.7.1
File Interpreter ABI Platform
spotify_videos-1.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 51.4 kB

Release files / spotify-videos-1.7.1.tar.gz

Download URL spotify-videos-1.7.1.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
10e021042969f2cf6a0362e4969aebefe7b0f70cea6b7946122cde9e1371ab1d
BLAKE2b-256 checksum
How to use checksums
1699e87638ef51e6b0b88f1968289f6cad77b353bc196540477d904a3356bc84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

Release files / spotify_videos-1.7.1-py3-none-any.whl

Download URL spotify_videos-1.7.1-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
537a521030b10f1260ef7f347b005e086ca1f264ae688ec9466fa432c1130321
BLAKE2b-256 checksum
How to use checksums
dcf25e558110a334f5cc568a9d716516e74b10e7d5c922773ab4e1101c6f142d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

Release history Release notifications | RSS feed

1.8.2

1 release file

1.8.1

1 release file

1.8

2 release files

This release

1.7.1 This release

2 release files

1.7

3 release files

1.6.2

2 release files

1.6

3 release files

1.5

2 release files

1.4.4

2 release files

1.4.3

3 release files

1.4.1

3 release files

1.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page