🍃 Spotify – get the URL of a random saved album
Usage
spotify-random-saved-album --h
usage: spotify-random-saved-album [-h] [--no-cache] [--update-cache] [--output-name] [--output-artist] [--uri]
options:
-h, --help show this help message and exit
--no-cache .cache.json won't be created
--update-cache force update cache file
--output-name append album's name to output
--output-artist append artist's name to output
--uri return URI instead of URL. You can pass URI to spotify.start_playback(context_uri=URI) to play the album instantly
(premium required)
Install - 7 steps:
-
Install dependencies and install the script:
sudo apt update sudo apt install git python3 python3-pippip install spotify-random-saved-album -
login and create a new Spotify Developer app at https://developer.spotify.com/dashboard/applications
-
Open the created app on the Dashboard and click
Edit settings -
Go to
Redirect URIs-> add redirect URLhttp://127.0.0.1:9090 -
Copy
Client IDandClient Secretfrom the app's main page -
Create a new file
/path/to/.envwhich will contain the Client ID and Client Secret:The
/path/to/.envfile should look like this:export SPOTIFY_ID=YOUR_CLIENT_ID export SPOTIFY_SECRET=YOUR_CLIENT_SEC(optional): create and populate
/path/to/.envwith the following commands:touch .env # creates .env file echo "SPOTIFY_ID=<YOUR_CLIENT_ID>" >> .env echo "SPOTIFY_SECRET=<YOUR_CLIENT_SEC>" >> .env cat .env
-
Get the URL of a random saved album:
(Option A) source the
/path/to/.env(sets $SPOTIFY_ID and $SPOTIFY_SECRET) and run thespotify-random-saved-albumcommandsource /path/to/.env && spotify-random-saved-album
(Option B) the variables explicitly and run the script:
SPOTIFY_ID=<YOUR_CLIENT_ID> SPOTIFY_SECRET=<YOUR_CLIENT_SEC> spotify-random-saved-album
Notes
You have to pass the OAuth via browser once on the last step.
Personal usecase of this script is to pipe the output (external link) to a browser shortcut which will open a random album.
Release files for spotify-random-saved-album 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spotify-random-saved-album-0.0.8.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spotify_random_saved_album-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.3 kB
Release files / spotify-random-saved-album-0.0.8.tar.gz
| Download URL | spotify-random-saved-album-0.0.8.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f33afb83377a86b779aa5ce46d6e8d54861c27304e2713da6ac4c4ed934fad24
|
|
BLAKE2b-256 checksum How to use checksums |
4447315be834dca6073e0bda0bbf0593a656bf1cbbcf95b40bacd2f17981ab09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / spotify_random_saved_album-0.0.8-py3-none-any.whl
| Download URL | spotify_random_saved_album-0.0.8-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f8ff4f34c0f45e599fea398450d71268c7a4e8a3e92226c42580cd8f22a1921
|
|
BLAKE2b-256 checksum How to use checksums |
166a17b1c90d84d3044e34074d96c2964509d76304912648ca6db5e2d0b41ad4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|